From f088bcadd544b652729b01b12a3ce64d216d37df Mon Sep 17 00:00:00 2001 From: Bjorn Neergaard Date: Tue, 15 Nov 2022 01:47:30 -0700 Subject: [PATCH 1/4] ignorefiles: cleanup Signed-off-by: Bjorn Neergaard (cherry picked from commit 4f17d17009a47d41154617aa5b5d828456e8bbc8) Signed-off-by: Sebastiaan van Stijn --- .dockerignore | 5 +---- .gitignore | 41 ++++++++++++++++++++++------------------- 2 files changed, 23 insertions(+), 23 deletions(-) diff --git a/.dockerignore b/.dockerignore index 2a8bcd5a54..71c1853815 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,7 +1,4 @@ .git -.go-pkg-cache -.gopath -bundles +bundles/ cli/winresources/**/winres.json cli/winresources/**/*.syso -vendor/pkg diff --git a/.gitignore b/.gitignore index aa50be77c6..d3f896b19e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,27 +1,30 @@ -# Docker project generated files to ignore -# if you want to ignore files created by your editor/tools, -# please consider a global .gitignore https://help.github.com/articles/ignoring-files -*.exe -*.exe~ -*.gz +# If you want to ignore files created by your editor/tools, please consider a +# [global .gitignore](https://help.github.com/articles/ignoring-files). + +*~ +*.bak *.orig -test.main .*.swp .DS_Store -# a .bashrc may be added to customize the build environment +thumbs.db + +# local repository customization +.envrc .bashrc .editorconfig -.gopath/ -.go-pkg-cache/ -bundles/ -cli/winresources/**/winres.json -cli/winresources/**/*.syso -cmd/dockerd/dockerd -contrib/builder/rpm/*/changelog -vendor/pkg/ -go-test-report.json -profile.out -junit-report.xml # top-level go.mod is not meant to be checked in /go.mod +# build artifacts +bundles/ +cli/winresources/*/*.syso +cli/winresources/*/winres.json +contrib/builder/rpm/*/changelog + +# ci artifacts +*.exe +*.gz +go-test-report.json +junit-report.xml +profile.out +test.main From 0c4b6b17425e35ab2898c2f2887f2a2cd68e4d2f Mon Sep 17 00:00:00 2001 From: CrazyMax Date: Fri, 25 Nov 2022 22:57:57 +0100 Subject: [PATCH 2/4] ci: define timeout for jobs Signed-off-by: CrazyMax (cherry picked from commit 426e3926ef9da15edf8821824bdcdeb25e201bdc) Signed-off-by: Sebastiaan van Stijn --- .github/workflows/.windows.yml | 2 ++ .github/workflows/buildkit.yml | 3 ++- .github/workflows/test.yml | 5 +++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/.windows.yml b/.github/workflows/.windows.yml index deef06e9d1..2cc388986b 100644 --- a/.github/workflows/.windows.yml +++ b/.github/workflows/.windows.yml @@ -105,6 +105,7 @@ jobs: unit-test: runs-on: ${{ inputs.os }} + timeout-minutes: 120 env: GOPATH: ${{ github.workspace }}\go GOBIN: ${{ github.workspace }}\go\bin @@ -239,6 +240,7 @@ jobs: integration-test: runs-on: ${{ inputs.os }} + timeout-minutes: 120 needs: - build - integration-test-prepare diff --git a/.github/workflows/buildkit.yml b/.github/workflows/buildkit.yml index bfdeda40fb..954c006c0d 100644 --- a/.github/workflows/buildkit.yml +++ b/.github/workflows/buildkit.yml @@ -45,9 +45,10 @@ jobs: retention-days: 1 test: + runs-on: ubuntu-20.04 + timeout-minutes: 120 needs: - build - runs-on: ubuntu-20.04 strategy: fail-fast: false matrix: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index adbb99702c..1193acda50 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -117,6 +117,7 @@ jobs: unit: runs-on: ubuntu-20.04 + timeout-minutes: 120 needs: - build-dev steps: @@ -192,6 +193,7 @@ jobs: docker-py: runs-on: ubuntu-20.04 + timeout-minutes: 120 needs: - build-dev steps: @@ -239,6 +241,7 @@ jobs: integration-flaky: runs-on: ubuntu-20.04 + timeout-minutes: 120 needs: - build-dev steps: @@ -267,6 +270,7 @@ jobs: integration: runs-on: ${{ matrix.os }} + timeout-minutes: 120 needs: - build-dev strategy: @@ -411,6 +415,7 @@ jobs: integration-cli: runs-on: ubuntu-20.04 + timeout-minutes: 120 needs: - build-dev - integration-cli-prepare From f547f2f3c0a948f2d59d646deeb6f87f610ce124 Mon Sep 17 00:00:00 2001 From: CrazyMax Date: Fri, 25 Nov 2022 11:46:51 +0100 Subject: [PATCH 3/4] Makefile: always use buildx Signed-off-by: CrazyMax (cherry picked from commit bade242dddafaa84151941d4f6754c4aa4c59a52) Signed-off-by: Sebastiaan van Stijn --- .github/workflows/test.yml | 2 -- Jenkinsfile | 12 ---------- Makefile | 45 +++++--------------------------------- 3 files changed, 6 insertions(+), 53 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1193acda50..be8f94d874 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -19,8 +19,6 @@ env: GOTESTLIST_VERSION: v0.2.0 TESTSTAT_VERSION: v0.1.3 ITG_CLI_MATRIX_SIZE: 6 - BUILDX: docker buildx - USE_BUILDX: 1 DOCKER_EXPERIMENTAL: 1 DOCKER_GRAPHDRIVER: overlay2 diff --git a/Jenkinsfile b/Jenkinsfile index 772d43f45f..9e9755a67a 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -260,12 +260,6 @@ pipeline { } } agent { label 'ppc64le-ubuntu-1604' } - // ppc64le machines run on Docker 18.06, and buildkit has some - // bugs on that version. Build and use buildx instead. - environment { - USE_BUILDX = '1' - DOCKER_BUILDKIT = '0' - } stages { stage("Print info") { @@ -379,12 +373,6 @@ pipeline { } } agent { label 'ppc64le-ubuntu-1604' } - // ppc64le machines run on Docker 18.06, and buildkit has some - // bugs on that version. Build and use buildx instead. - environment { - USE_BUILDX = '1' - DOCKER_BUILDKIT = '0' - } stages { stage("Print info") { diff --git a/Makefile b/Makefile index cfe3c17e4b..3de756456a 100644 --- a/Makefile +++ b/Makefile @@ -1,21 +1,7 @@ .PHONY: all binary dynbinary build cross help install manpages run shell test test-docker-py test-integration test-unit validate validate-% win -BUILDX_VERSION ?= v0.9.1 - -ifdef USE_BUILDX -BUILDX ?= $(shell command -v buildx) -BUILDX ?= $(shell command -v docker-buildx) -DOCKER_BUILDX_CLI_PLUGIN_PATH ?= ~/.docker/cli-plugins/docker-buildx -BUILDX ?= $(shell if [ -x "$(DOCKER_BUILDX_CLI_PLUGIN_PATH)" ]; then echo $(DOCKER_BUILDX_CLI_PLUGIN_PATH); fi) -endif - -ifndef USE_BUILDX -DOCKER_BUILDKIT := 1 -export DOCKER_BUILDKIT -endif - -BUILDX ?= bundles/buildx DOCKER ?= docker +BUILDX ?= $(DOCKER) buildx # set the graph driver as the current graphdriver if not set DOCKER_GRAPHDRIVER := $(if $(DOCKER_GRAPHDRIVER),$(DOCKER_GRAPHDRIVER),$(shell docker info 2>&1 | grep "Storage Driver" | sed 's/.*: //')) @@ -155,12 +141,7 @@ DOCKER_BUILD_ARGS += --build-arg=SYSTEMD=true endif BUILD_OPTS := ${BUILD_APT_MIRROR} ${DOCKER_BUILD_ARGS} ${DOCKER_BUILD_OPTS} -f "$(DOCKERFILE)" -ifdef USE_BUILDX -BUILD_OPTS += $(BUILDX_BUILD_EXTRA_OPTS) BUILD_CMD := $(BUILDX) build -else -BUILD_CMD := $(DOCKER) build -endif # This is used for the legacy "build" target and anything still depending on it BUILD_CROSS = @@ -178,14 +159,14 @@ default: binary all: build ## validate all checks, build linux binaries, run all tests,\ncross build non-linux binaries, and generate archives $(DOCKER_RUN_DOCKER) bash -c 'hack/validate/default && hack/make.sh' -binary: buildx ## build statically linked linux binaries +binary: bundles ## build statically linked linux binaries $(BUILD_CMD) $(BUILD_OPTS) --output=bundles/ --target=$@ $(VERSION_AUTOGEN_ARGS) . -dynbinary: buildx ## build dynamically linked linux binaries +dynbinary: bundles ## build dynamically linked linux binaries $(BUILD_CMD) $(BUILD_OPTS) --output=bundles/ --target=$@ $(VERSION_AUTOGEN_ARGS) . cross: BUILD_OPTS += --build-arg CROSS=true --build-arg DOCKER_CROSSPLATFORMS -cross: buildx ## cross build the binaries for darwin, freebsd and\nwindows +cross: bundles ## cross build the binaries for darwin, freebsd and\nwindows $(BUILD_CMD) $(BUILD_OPTS) --output=bundles/ --target=$@ $(VERSION_AUTOGEN_ARGS) . bundles: @@ -213,11 +194,8 @@ build: shell_target := --target=dev else build: shell_target := --target=final endif -ifdef USE_BUILDX -build: buildx_load := --load -endif -build: buildx - $(BUILD_CMD) $(BUILD_OPTS) $(shell_target) $(buildx_load) $(BUILD_CROSS) -t "$(DOCKER_IMAGE)" . +build: bundles + $(BUILD_CMD) $(BUILD_OPTS) $(shell_target) --load $(BUILD_CROSS) -t "$(DOCKER_IMAGE)" . shell: build ## start a shell inside the build env $(DOCKER_RUN_DOCKER) bash @@ -268,14 +246,3 @@ swagger-docs: ## preview the API documentation -e 'REDOC_OPTIONS=hide-hostname="true" lazy-rendering' \ -p $(SWAGGER_DOCS_PORT):80 \ bfirsh/redoc:1.14.0 - -.PHONY: buildx -ifdef USE_BUILDX -ifeq ($(BUILDX), bundles/buildx) -buildx: bundles/buildx ## build buildx cli tool -endif -endif - -bundles/buildx: bundles ## build buildx CLI tool - curl -fsSL https://raw.githubusercontent.com/moby/buildkit/70deac12b5857a1aa4da65e90b262368e2f71500/hack/install-buildx | VERSION="$(BUILDX_VERSION)" BINDIR="$(@D)" bash - $@ version From de3143c6b929880b498e3088bb55ff706221d904 Mon Sep 17 00:00:00 2001 From: CrazyMax Date: Tue, 29 Nov 2022 11:59:09 +0100 Subject: [PATCH 4/4] Jenkinsfile: Fix dev image build fox ppc64le/s390x archs Signed-off-by: CrazyMax (cherry picked from commit f7e59cbccc20a80841cea0d33a42a8bafa519d8c) Signed-off-by: Sebastiaan van Stijn --- Jenkinsfile | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 9e9755a67a..46b87c454a 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -276,8 +276,7 @@ pipeline { stage("Build dev image") { steps { sh ''' - make bundles/buildx - bundles/buildx build --load --force-rm --build-arg APT_MIRROR -t docker:${GIT_COMMIT} . + docker buildx build --load --force-rm --build-arg APT_MIRROR -t docker:${GIT_COMMIT} . ''' } } @@ -389,8 +388,7 @@ pipeline { stage("Build dev image") { steps { sh ''' - make bundles/buildx - bundles/buildx build --load --force-rm --build-arg APT_MIRROR -t docker:${GIT_COMMIT} . + docker buildx build --load --force-rm --build-arg APT_MIRROR -t docker:${GIT_COMMIT} . ''' } }