From a521843442566139c82a50b72ca2b87223639c4d Mon Sep 17 00:00:00 2001 From: CrazyMax Date: Tue, 3 Jan 2023 20:01:12 +0100 Subject: [PATCH 1/3] Dockerfile: use default apt mirrors Use default apt mirrors and also check APT_MIRROR is set before updating mirrors. Signed-off-by: CrazyMax (cherry picked from commit a1d2132bf6391b18cc225f0f113ff43efedece66) Signed-off-by: Sebastiaan van Stijn --- Dockerfile | 3 +-- Jenkinsfile | 11 +++++------ docker-bake.hcl | 2 +- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/Dockerfile b/Dockerfile index ae34c6f16e..bd25310bfa 100644 --- a/Dockerfile +++ b/Dockerfile @@ -27,8 +27,7 @@ FROM --platform=$BUILDPLATFORM ${GOLANG_IMAGE} AS base COPY --from=xx / / RUN echo 'Binary::apt::APT::Keep-Downloaded-Packages "true";' > /etc/apt/apt.conf.d/keep-cache ARG APT_MIRROR -RUN sed -ri "s/(httpredir|deb).debian.org/${APT_MIRROR:-deb.debian.org}/g" /etc/apt/sources.list \ - && sed -ri "s/(security).debian.org/${APT_MIRROR:-security.debian.org}/g" /etc/apt/sources.list +RUN test -n "$APT_MIRROR" && sed -ri "s/(httpredir|deb|security).debian.org/${APT_MIRROR}/g" /etc/apt/sources.list || true ARG DEBIAN_FRONTEND RUN apt-get update && apt-get install --no-install-recommends -y file ENV GO111MODULE=off diff --git a/Jenkinsfile b/Jenkinsfile index 46b87c454a..b5cd7d275d 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -17,7 +17,6 @@ pipeline { DOCKER_BUILDKIT = '1' DOCKER_EXPERIMENTAL = '1' DOCKER_GRAPHDRIVER = 'overlay2' - APT_MIRROR = 'cdn-fastly.deb.debian.org' CHECK_CONFIG_COMMIT = '33a3680e08d1007e72c3b3f1454f823d8e9948ee' TESTDEBUG = '0' TIMEOUT = '120m' @@ -78,7 +77,7 @@ pipeline { stage("Build dev image") { steps { sh ''' - docker build --force-rm --build-arg APT_MIRROR -t docker:${GIT_COMMIT} . + docker build --force-rm -t docker:${GIT_COMMIT} . ''' } } @@ -190,7 +189,7 @@ pipeline { stage("Build dev image") { steps { sh ''' - docker build --force-rm --build-arg APT_MIRROR -t docker:${GIT_COMMIT} . + docker build --force-rm -t docker:${GIT_COMMIT} . ''' } } @@ -276,7 +275,7 @@ pipeline { stage("Build dev image") { steps { sh ''' - docker buildx build --load --force-rm --build-arg APT_MIRROR -t docker:${GIT_COMMIT} . + docker buildx build --load --force-rm -t docker:${GIT_COMMIT} . ''' } } @@ -388,7 +387,7 @@ pipeline { stage("Build dev image") { steps { sh ''' - docker buildx build --load --force-rm --build-arg APT_MIRROR -t docker:${GIT_COMMIT} . + docker buildx build --load --force-rm -t docker:${GIT_COMMIT} . ''' } } @@ -472,7 +471,7 @@ pipeline { } stage("Build dev image") { steps { - sh 'docker build --force-rm --build-arg APT_MIRROR -t docker:${GIT_COMMIT} .' + sh 'docker build --force-rm -t docker:${GIT_COMMIT} .' } } stage("Unit tests") { diff --git a/docker-bake.hcl b/docker-bake.hcl index 899551f9e4..1fa77c708f 100644 --- a/docker-bake.hcl +++ b/docker-bake.hcl @@ -1,5 +1,5 @@ variable "APT_MIRROR" { - default = "cdn-fastly.deb.debian.org" + default = "" } variable "DOCKER_DEBUG" { default = "" From abc61ff43b968e19ae1d692597167129cd25ec93 Mon Sep 17 00:00:00 2001 From: CrazyMax Date: Tue, 3 Jan 2023 19:58:05 +0100 Subject: [PATCH 2/3] Makefile: remove unused BUILD_APT_MIRROR BUILD_APT_MIRROR added in https://github.com/moby/moby/pull/26375 is not used anymore. Signed-off-by: CrazyMax (cherry picked from commit 7c697f58f26a7da79e540640345fd25a4614f624) Signed-off-by: Sebastiaan van Stijn --- Makefile | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/Makefile b/Makefile index db7e58be63..108b3d8441 100644 --- a/Makefile +++ b/Makefile @@ -31,7 +31,6 @@ export VALIDATE_ORIGIN_BRANCH # make DOCKER_LDFLAGS="-X github.com/docker/docker/daemon/graphdriver.priority=overlay2,devicemapper" dynbinary # DOCKER_ENVS := \ - -e BUILD_APT_MIRROR \ -e BUILDFLAGS \ -e KEEPBUNDLE \ -e DOCKER_BUILD_ARGS \ @@ -107,8 +106,6 @@ DOCKER_PORT_FORWARD := $(if $(DOCKER_PORT),-p "$(DOCKER_PORT)",) DELVE_PORT_FORWARD := $(if $(DELVE_PORT),-p "$(DELVE_PORT)",) DOCKER_FLAGS := $(DOCKER) run --rm --privileged $(DOCKER_CONTAINER_NAME) $(DOCKER_ENVS) $(DOCKER_MOUNT) $(DOCKER_PORT_FORWARD) $(DELVE_PORT_FORWARD) -BUILD_APT_MIRROR := $(if $(DOCKER_BUILD_APT_MIRROR),--build-arg APT_MIRROR=$(DOCKER_BUILD_APT_MIRROR)) -export BUILD_APT_MIRROR SWAGGER_DOCS_PORT ?= 9000 @@ -140,7 +137,7 @@ ifdef DOCKER_SYSTEMD DOCKER_BUILD_ARGS += --build-arg=SYSTEMD=true endif -BUILD_OPTS := ${BUILD_APT_MIRROR} ${DOCKER_BUILD_ARGS} ${DOCKER_BUILD_OPTS} -f "$(DOCKERFILE)" +BUILD_OPTS := ${DOCKER_BUILD_ARGS} ${DOCKER_BUILD_OPTS} -f "$(DOCKERFILE)" BUILD_CMD := $(BUILDX) build BAKE_CMD := $(BUILDX) bake From 55ba1841f738d3846b23f3c8e740058ef2cb0885 Mon Sep 17 00:00:00 2001 From: Sam Thibault Date: Mon, 14 Aug 2023 14:03:52 +0200 Subject: [PATCH 3/3] remove s390x and ppc64ls pipelines Signed-off-by: Sam Thibault (cherry picked from commit 59aa3dce8a3abc9d6eb29df7c76b4484e8758234) Signed-off-by: Sebastiaan van Stijn --- Jenkinsfile | 398 ---------------------------------------------------- 1 file changed, 398 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index b5cd7d275d..26008bcfeb 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -9,8 +9,6 @@ pipeline { } parameters { booleanParam(name: 'arm64', defaultValue: true, description: 'ARM (arm64) Build/Test') - booleanParam(name: 's390x', defaultValue: false, description: 'IBM Z (s390x) Build/Test') - booleanParam(name: 'ppc64le', defaultValue: false, description: 'PowerPC (ppc64le) Build/Test') booleanParam(name: 'dco', defaultValue: true, description: 'Run the DCO check') } environment { @@ -51,402 +49,6 @@ pipeline { } stage('Build') { parallel { - stage('s390x') { - when { - beforeAgent true - // Skip this stage on PRs unless the checkbox is selected - anyOf { - not { changeRequest() } - expression { params.s390x } - } - } - agent { label 's390x-ubuntu-2004' } - - stages { - stage("Print info") { - steps { - sh 'docker version' - sh 'docker info' - sh ''' - echo "check-config.sh version: ${CHECK_CONFIG_COMMIT}" - curl -fsSL -o ${WORKSPACE}/check-config.sh "https://raw.githubusercontent.com/moby/moby/${CHECK_CONFIG_COMMIT}/contrib/check-config.sh" \ - && bash ${WORKSPACE}/check-config.sh || true - ''' - } - } - stage("Build dev image") { - steps { - sh ''' - docker build --force-rm -t docker:${GIT_COMMIT} . - ''' - } - } - stage("Unit tests") { - steps { - sh ''' - sudo modprobe ip6table_filter - ''' - sh ''' - docker run --rm -t --privileged \ - -v "$WORKSPACE/bundles:/go/src/github.com/docker/docker/bundles" \ - --name docker-pr$BUILD_NUMBER \ - -e DOCKER_EXPERIMENTAL \ - -e DOCKER_GITCOMMIT=${GIT_COMMIT} \ - -e DOCKER_GRAPHDRIVER \ - -e VALIDATE_REPO=${GIT_URL} \ - -e VALIDATE_BRANCH=${CHANGE_TARGET} \ - docker:${GIT_COMMIT} \ - hack/test/unit - ''' - } - post { - always { - junit testResults: 'bundles/junit-report*.xml', allowEmptyResults: true - } - } - } - stage("Integration tests") { - environment { TEST_SKIP_INTEGRATION_CLI = '1' } - steps { - sh ''' - docker run --rm -t --privileged \ - -v "$WORKSPACE/bundles:/go/src/github.com/docker/docker/bundles" \ - --name docker-pr$BUILD_NUMBER \ - -e DOCKER_EXPERIMENTAL \ - -e DOCKER_GITCOMMIT=${GIT_COMMIT} \ - -e DOCKER_GRAPHDRIVER \ - -e TESTDEBUG \ - -e TEST_SKIP_INTEGRATION_CLI \ - -e TIMEOUT \ - -e VALIDATE_REPO=${GIT_URL} \ - -e VALIDATE_BRANCH=${CHANGE_TARGET} \ - docker:${GIT_COMMIT} \ - hack/make.sh \ - dynbinary \ - test-integration - ''' - } - post { - always { - junit testResults: 'bundles/**/*-report.xml', allowEmptyResults: true - } - } - } - } - - post { - always { - sh ''' - echo "Ensuring container killed." - docker rm -vf docker-pr$BUILD_NUMBER || true - ''' - - sh ''' - echo "Chowning /workspace to jenkins user" - docker run --rm -v "$WORKSPACE:/workspace" busybox chown -R "$(id -u):$(id -g)" /workspace - ''' - - catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE', message: 'Failed to create bundles.tar.gz') { - sh ''' - bundleName=s390x-integration - echo "Creating ${bundleName}-bundles.tar.gz" - # exclude overlay2 directories - find bundles -path '*/root/*overlay2' -prune -o -type f \\( -name '*-report.json' -o -name '*.log' -o -name '*.prof' -o -name '*-report.xml' \\) -print | xargs tar -czf ${bundleName}-bundles.tar.gz - ''' - - archiveArtifacts artifacts: '*-bundles.tar.gz', allowEmptyArchive: true - } - } - cleanup { - sh 'make clean' - deleteDir() - } - } - } - stage('s390x integration-cli') { - when { - beforeAgent true - // Skip this stage on PRs unless the checkbox is selected - anyOf { - not { changeRequest() } - expression { params.s390x } - } - } - agent { label 's390x-ubuntu-2004' } - - stages { - stage("Print info") { - steps { - sh 'docker version' - sh 'docker info' - sh ''' - echo "check-config.sh version: ${CHECK_CONFIG_COMMIT}" - curl -fsSL -o ${WORKSPACE}/check-config.sh "https://raw.githubusercontent.com/moby/moby/${CHECK_CONFIG_COMMIT}/contrib/check-config.sh" \ - && bash ${WORKSPACE}/check-config.sh || true - ''' - } - } - stage("Build dev image") { - steps { - sh ''' - docker build --force-rm -t docker:${GIT_COMMIT} . - ''' - } - } - stage("Integration-cli tests") { - environment { TEST_SKIP_INTEGRATION = '1' } - steps { - sh ''' - docker run --rm -t --privileged \ - -v "$WORKSPACE/bundles:/go/src/github.com/docker/docker/bundles" \ - --name docker-pr$BUILD_NUMBER \ - -e DOCKER_GITCOMMIT=${GIT_COMMIT} \ - -e DOCKER_GRAPHDRIVER \ - -e TEST_SKIP_INTEGRATION \ - -e TIMEOUT \ - -e VALIDATE_REPO=${GIT_URL} \ - -e VALIDATE_BRANCH=${CHANGE_TARGET} \ - docker:${GIT_COMMIT} \ - hack/make.sh \ - dynbinary \ - test-integration - ''' - } - post { - always { - junit testResults: 'bundles/**/*-report.xml', allowEmptyResults: true - } - } - } - } - - post { - always { - sh ''' - echo "Ensuring container killed." - docker rm -vf docker-pr$BUILD_NUMBER || true - ''' - - sh ''' - echo "Chowning /workspace to jenkins user" - docker run --rm -v "$WORKSPACE:/workspace" busybox chown -R "$(id -u):$(id -g)" /workspace - ''' - - catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE', message: 'Failed to create bundles.tar.gz') { - sh ''' - bundleName=s390x-integration-cli - echo "Creating ${bundleName}-bundles.tar.gz" - # exclude overlay2 directories - find bundles -path '*/root/*overlay2' -prune -o -type f \\( -name '*-report.json' -o -name '*.log' -o -name '*.prof' -o -name '*-report.xml' \\) -print | xargs tar -czf ${bundleName}-bundles.tar.gz - ''' - - archiveArtifacts artifacts: '*-bundles.tar.gz', allowEmptyArchive: true - } - } - cleanup { - sh 'make clean' - deleteDir() - } - } - } - stage('ppc64le') { - when { - beforeAgent true - // Skip this stage on PRs unless the checkbox is selected - anyOf { - not { changeRequest() } - expression { params.ppc64le } - } - } - agent { label 'ppc64le-ubuntu-1604' } - - stages { - stage("Print info") { - steps { - sh 'docker version' - sh 'docker info' - sh ''' - echo "check-config.sh version: ${CHECK_CONFIG_COMMIT}" - curl -fsSL -o ${WORKSPACE}/check-config.sh "https://raw.githubusercontent.com/moby/moby/${CHECK_CONFIG_COMMIT}/contrib/check-config.sh" \ - && bash ${WORKSPACE}/check-config.sh || true - ''' - } - } - stage("Build dev image") { - steps { - sh ''' - docker buildx build --load --force-rm -t docker:${GIT_COMMIT} . - ''' - } - } - stage("Unit tests") { - steps { - sh ''' - sudo modprobe ip6table_filter - ''' - sh ''' - docker run --rm -t --privileged \ - -v "$WORKSPACE/bundles:/go/src/github.com/docker/docker/bundles" \ - --name docker-pr$BUILD_NUMBER \ - -e DOCKER_EXPERIMENTAL \ - -e DOCKER_GITCOMMIT=${GIT_COMMIT} \ - -e DOCKER_GRAPHDRIVER \ - -e VALIDATE_REPO=${GIT_URL} \ - -e VALIDATE_BRANCH=${CHANGE_TARGET} \ - docker:${GIT_COMMIT} \ - hack/test/unit - ''' - } - post { - always { - junit testResults: 'bundles/junit-report*.xml', allowEmptyResults: true - } - } - } - stage("Integration tests") { - environment { TEST_SKIP_INTEGRATION_CLI = '1' } - steps { - sh ''' - docker run --rm -t --privileged \ - -v "$WORKSPACE/bundles:/go/src/github.com/docker/docker/bundles" \ - --name docker-pr$BUILD_NUMBER \ - -e DOCKER_EXPERIMENTAL \ - -e DOCKER_GITCOMMIT=${GIT_COMMIT} \ - -e DOCKER_GRAPHDRIVER \ - -e TESTDEBUG \ - -e TEST_SKIP_INTEGRATION_CLI \ - -e TIMEOUT \ - -e VALIDATE_REPO=${GIT_URL} \ - -e VALIDATE_BRANCH=${CHANGE_TARGET} \ - docker:${GIT_COMMIT} \ - hack/make.sh \ - dynbinary \ - test-integration - ''' - } - post { - always { - junit testResults: 'bundles/**/*-report.xml', allowEmptyResults: true - } - } - } - } - - post { - always { - sh ''' - echo "Ensuring container killed." - docker rm -vf docker-pr$BUILD_NUMBER || true - ''' - - sh ''' - echo "Chowning /workspace to jenkins user" - docker run --rm -v "$WORKSPACE:/workspace" busybox chown -R "$(id -u):$(id -g)" /workspace - ''' - - catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE', message: 'Failed to create bundles.tar.gz') { - sh ''' - bundleName=ppc64le-integration - echo "Creating ${bundleName}-bundles.tar.gz" - # exclude overlay2 directories - find bundles -path '*/root/*overlay2' -prune -o -type f \\( -name '*-report.json' -o -name '*.log' -o -name '*.prof' -o -name '*-report.xml' \\) -print | xargs tar -czf ${bundleName}-bundles.tar.gz - ''' - - archiveArtifacts artifacts: '*-bundles.tar.gz', allowEmptyArchive: true - } - } - cleanup { - sh 'make clean' - deleteDir() - } - } - } - stage('ppc64le integration-cli') { - when { - beforeAgent true - // Skip this stage on PRs unless the checkbox is selected - anyOf { - not { changeRequest() } - expression { params.ppc64le } - } - } - agent { label 'ppc64le-ubuntu-1604' } - - stages { - stage("Print info") { - steps { - sh 'docker version' - sh 'docker info' - sh ''' - echo "check-config.sh version: ${CHECK_CONFIG_COMMIT}" - curl -fsSL -o ${WORKSPACE}/check-config.sh "https://raw.githubusercontent.com/moby/moby/${CHECK_CONFIG_COMMIT}/contrib/check-config.sh" \ - && bash ${WORKSPACE}/check-config.sh || true - ''' - } - } - stage("Build dev image") { - steps { - sh ''' - docker buildx build --load --force-rm -t docker:${GIT_COMMIT} . - ''' - } - } - stage("Integration-cli tests") { - environment { TEST_SKIP_INTEGRATION = '1' } - steps { - sh ''' - docker run --rm -t --privileged \ - -v "$WORKSPACE/bundles:/go/src/github.com/docker/docker/bundles" \ - --name docker-pr$BUILD_NUMBER \ - -e DOCKER_GITCOMMIT=${GIT_COMMIT} \ - -e DOCKER_GRAPHDRIVER \ - -e TEST_SKIP_INTEGRATION \ - -e TIMEOUT \ - -e VALIDATE_REPO=${GIT_URL} \ - -e VALIDATE_BRANCH=${CHANGE_TARGET} \ - docker:${GIT_COMMIT} \ - hack/make.sh \ - dynbinary \ - test-integration - ''' - } - post { - always { - junit testResults: 'bundles/**/*-report.xml', allowEmptyResults: true - } - } - } - } - - post { - always { - sh ''' - echo "Ensuring container killed." - docker rm -vf docker-pr$BUILD_NUMBER || true - ''' - - sh ''' - echo "Chowning /workspace to jenkins user" - docker run --rm -v "$WORKSPACE:/workspace" busybox chown -R "$(id -u):$(id -g)" /workspace - ''' - - catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE', message: 'Failed to create bundles.tar.gz') { - sh ''' - bundleName=ppc64le-integration-cli - echo "Creating ${bundleName}-bundles.tar.gz" - # exclude overlay2 directories - find bundles -path '*/root/*overlay2' -prune -o -type f \\( -name '*-report.json' -o -name '*.log' -o -name '*.prof' -o -name '*-report.xml' \\) -print | xargs tar -czf ${bundleName}-bundles.tar.gz - ''' - - archiveArtifacts artifacts: '*-bundles.tar.gz', allowEmptyArchive: true - } - } - cleanup { - sh 'make clean' - deleteDir() - } - } - } stage('arm64') { when { beforeAgent true