From 56db0f350e5b2f3b105b49665c0c2e8cdecea293 Mon Sep 17 00:00:00 2001 From: Steven Gagniere Date: Fri, 7 Oct 2022 15:31:39 -0700 Subject: [PATCH 01/19] switch to a new ubuntu bionic based image for faster compilation of glibc arm64 bin/archive from amd64 machines --- .goreleaser-linux-glibc-arm64.yml | 7 ++++--- dockerfiles/Dockerfile_linux_glibc_arm64 | 4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.goreleaser-linux-glibc-arm64.yml b/.goreleaser-linux-glibc-arm64.yml index ac055795d2..1596969063 100644 --- a/.goreleaser-linux-glibc-arm64.yml +++ b/.goreleaser-linux-glibc-arm64.yml @@ -20,6 +20,10 @@ builds: - all=-trimpath={{.Env.HOME}}/git asmflags: - all=-trimpath={{.Env.HOME}}/git + env: + - CGO_ENABLED=1 + - CC=aarch64-linux-gnu-gcc + - CXX=aarch64-linux-gnu-g++ goos: - linux goarch: @@ -34,9 +38,6 @@ archives: - id: archive name_template: "{{ .ProjectName }}_v{{ .Version }}_{{ .Os }}_{{ .Arch }}" format: tar.gz - format_overrides: - - goos: windows - format: zip wrap_in_directory: "{{ .ProjectName }}" files: - legal/**/* diff --git a/dockerfiles/Dockerfile_linux_glibc_arm64 b/dockerfiles/Dockerfile_linux_glibc_arm64 index d8ffd96d0f..12744633de 100644 --- a/dockerfiles/Dockerfile_linux_glibc_arm64 +++ b/dockerfiles/Dockerfile_linux_glibc_arm64 @@ -1,4 +1,4 @@ -FROM --platform=linux/arm64/v8 050879227952.dkr.ecr.us-west-1.amazonaws.com/confluentinc/cli-centos-base-arm64:latest +FROM --platform=linux/amd64 cli-ubuntu-base-cross:latest COPY . /go/src/github.com/confluentinc/cli/ @@ -6,4 +6,4 @@ RUN cd /go/src/github.com/confluentinc/cli && \ make gorelease-linux-glibc-arm64 RUN cd /go/src/github.com/confluentinc/cli && \ - for file in dist/*.txt; do mv -v "$file" "${file/checksums/checksums_linux_arm64}"; done; + rename 's/checksums/checksums_linux_arm64/' dist/*.txt From 4e9fc9e41957487473af197c769805ec60df6747 Mon Sep 17 00:00:00 2001 From: Steven Gagniere Date: Fri, 7 Oct 2022 20:17:24 -0700 Subject: [PATCH 02/19] update base image tags in the dockerfiles --- dockerfiles/Dockerfile_linux_glibc | 2 +- dockerfiles/Dockerfile_linux_glibc_arm64 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dockerfiles/Dockerfile_linux_glibc b/dockerfiles/Dockerfile_linux_glibc index 0b8a9a10ef..70086004e6 100644 --- a/dockerfiles/Dockerfile_linux_glibc +++ b/dockerfiles/Dockerfile_linux_glibc @@ -1,4 +1,4 @@ -FROM --platform=linux/amd64 050879227952.dkr.ecr.us-west-1.amazonaws.com/confluentinc/cli-centos-base-amd64:latest +FROM --platform=linux/amd64 050879227952.dkr.ecr.us-west-1.amazonaws.com/confluentinc/cli-centos-base-amd64:2.0 COPY . /go/src/github.com/confluentinc/cli/ diff --git a/dockerfiles/Dockerfile_linux_glibc_arm64 b/dockerfiles/Dockerfile_linux_glibc_arm64 index 12744633de..976ca75ab4 100644 --- a/dockerfiles/Dockerfile_linux_glibc_arm64 +++ b/dockerfiles/Dockerfile_linux_glibc_arm64 @@ -1,4 +1,4 @@ -FROM --platform=linux/amd64 cli-ubuntu-base-cross:latest +FROM --platform=linux/amd64 050879227952.dkr.ecr.us-west-1.amazonaws.com/confluentinc/cli-centos-base-arm64:2.0 COPY . /go/src/github.com/confluentinc/cli/ From ed4bf11ba134f0f7a2be4b02fb52091dd48c0ffc Mon Sep 17 00:00:00 2001 From: Steven Gagniere Date: Fri, 7 Oct 2022 20:19:41 -0700 Subject: [PATCH 03/19] remove windows format override in glibc goreleaser file since it doesn't build the windows binary --- .goreleaser-linux-glibc.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.goreleaser-linux-glibc.yml b/.goreleaser-linux-glibc.yml index 11b80040aa..6d894bb589 100644 --- a/.goreleaser-linux-glibc.yml +++ b/.goreleaser-linux-glibc.yml @@ -34,9 +34,6 @@ archives: - id: archive name_template: "{{ .ProjectName }}_v{{ .Version }}_{{ .Os }}_{{ .Arch }}" format: tar.gz - format_overrides: - - goos: windows - format: zip wrap_in_directory: "{{ .ProjectName }}" files: - legal/**/* From 2f6194932b9e7b8d0733a260e403fa1d0d4e6240 Mon Sep 17 00:00:00 2001 From: Steven Gagniere Date: Fri, 7 Oct 2022 20:39:47 -0700 Subject: [PATCH 04/19] changed centos to ubuntu in the image name for the updated arm64 building image --- dockerfiles/Dockerfile_linux_glibc_arm64 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dockerfiles/Dockerfile_linux_glibc_arm64 b/dockerfiles/Dockerfile_linux_glibc_arm64 index 976ca75ab4..a3eabc6052 100644 --- a/dockerfiles/Dockerfile_linux_glibc_arm64 +++ b/dockerfiles/Dockerfile_linux_glibc_arm64 @@ -1,4 +1,4 @@ -FROM --platform=linux/amd64 050879227952.dkr.ecr.us-west-1.amazonaws.com/confluentinc/cli-centos-base-arm64:2.0 +FROM --platform=linux/amd64 050879227952.dkr.ecr.us-west-1.amazonaws.com/confluentinc/cli-ubuntu-base-arm64:latest COPY . /go/src/github.com/confluentinc/cli/ From b4d5b1588c951c9ea9269c232e0e592b12629b1a Mon Sep 17 00:00:00 2001 From: Steven Gagniere Date: Mon, 10 Oct 2022 13:43:12 -0700 Subject: [PATCH 05/19] Add support for building the arm64 binary inside an arm64 image when building on an m1 --- .goreleaser-linux-glibc-arm64.yml | 4 ---- build_linux_glibc.sh | 12 +++++++++--- dockerfiles/Dockerfile_linux_glibc_arm64_m1 | 9 +++++++++ mk-files/release.mk | 9 +++++++-- 4 files changed, 25 insertions(+), 9 deletions(-) create mode 100644 dockerfiles/Dockerfile_linux_glibc_arm64_m1 diff --git a/.goreleaser-linux-glibc-arm64.yml b/.goreleaser-linux-glibc-arm64.yml index 1596969063..eccbf522da 100644 --- a/.goreleaser-linux-glibc-arm64.yml +++ b/.goreleaser-linux-glibc-arm64.yml @@ -20,10 +20,6 @@ builds: - all=-trimpath={{.Env.HOME}}/git asmflags: - all=-trimpath={{.Env.HOME}}/git - env: - - CGO_ENABLED=1 - - CC=aarch64-linux-gnu-gcc - - CXX=aarch64-linux-gnu-g++ goos: - linux goarch: diff --git a/build_linux_glibc.sh b/build_linux_glibc.sh index 2131c6ebbc..2bd901fdd7 100755 --- a/build_linux_glibc.sh +++ b/build_linux_glibc.sh @@ -1,13 +1,19 @@ #!/bin/bash go mod vendor -#amd64 +#build amd64 docker build . -f ./dockerfiles/Dockerfile_linux_glibc -t cli-linux-glibc-builder-image docker container create --name cli-linux-glibc-builder cli-linux-glibc-builder-image docker container cp cli-linux-glibc-builder:/go/src/github.com/confluentinc/cli/dist/. ./dist/ docker container rm cli-linux-glibc-builder -#arm64 -docker build . -f ./dockerfiles/Dockerfile_linux_glibc_arm64 -t cli-linux-glibc-arm64-builder-image + +#build arm64 +architecture=$(uname -m) +if [ "$architecture" == 'x86_64' ]; then + docker build . -f ./dockerfiles/Dockerfile_linux_glibc_arm64 -t cli-linux-glibc-arm64-builder-image +else + docker build . -f ./dockerfiles/Dockerfile_linux_glibc_arm64_m1 -t cli-linux-glibc-arm64-builder-image +fi docker container create --name cli-linux-glibc-arm64-builder cli-linux-glibc-arm64-builder-image docker container cp cli-linux-glibc-arm64-builder:/go/src/github.com/confluentinc/cli/dist/. ./dist/ docker container rm cli-linux-glibc-arm64-builder diff --git a/dockerfiles/Dockerfile_linux_glibc_arm64_m1 b/dockerfiles/Dockerfile_linux_glibc_arm64_m1 new file mode 100644 index 0000000000..0072602311 --- /dev/null +++ b/dockerfiles/Dockerfile_linux_glibc_arm64_m1 @@ -0,0 +1,9 @@ +FROM --platform=linux/arm64 050879227952.dkr.ecr.us-west-1.amazonaws.com/confluentinc/cli-centos-base-arm64:latest + +COPY . /go/src/github.com/confluentinc/cli/ + +RUN cd /go/src/github.com/confluentinc/cli && \ + make gorelease-linux-glibc-arm64 + +RUN cd /go/src/github.com/confluentinc/cli && \ + rename 's/checksums/checksums_linux_arm64/' dist/*.txt diff --git a/mk-files/release.mk b/mk-files/release.mk index 76ae8d98d3..2da4dae51e 100644 --- a/mk-files/release.mk +++ b/mk-files/release.mk @@ -47,12 +47,17 @@ endef .PHONY: gorelease-linux-glibc gorelease-linux-glibc: GO111MODULE=off go get -u github.com/inconshreveable/mousetrap && \ - GOPRIVATE=github.com/confluentinc GONOSUMDB=github.com/confluentinc,github.com/golangci/go-misc VERSION=$(VERSION) HOSTNAME="$(HOSTNAME)" S3FOLDER=$(S3_STAG_FOLDER_NAME)/confluent-cli goreleaser release --rm-dist -f .goreleaser-linux-glibc.yml + GOPRIVATE=github.com/confluentinc GONOSUMDB=github.com/confluentinc,github.com/golangci/go-misc VERSION=$(VERSION) HOSTNAME="$(HOSTNAME)" goreleaser release --rm-dist -f .goreleaser-linux-glibc.yml .PHONY: gorelease-linux-glibc-arm64 gorelease-linux-glibc-arm64: +ifneq (,$(findstring x86_64,$(shell uname -m))) GO111MODULE=off go get -u github.com/inconshreveable/mousetrap && \ - GOPRIVATE=github.com/confluentinc GONOSUMDB=github.com/confluentinc,github.com/golangci/go-misc VERSION=$(VERSION) HOSTNAME="$(HOSTNAME)" S3FOLDER=$(S3_STAG_FOLDER_NAME)/confluent-cli goreleaser release --rm-dist -f .goreleaser-linux-glibc-arm64.yml + GOPRIVATE=github.com/confluentinc GONOSUMDB=github.com/confluentinc,github.com/golangci/go-misc VERSION=$(VERSION) HOSTNAME="$(HOSTNAME)" CGO_ENABLED=1 CC=aarch64-linux-gnu-gcc CXX=aarch64-linux-gnu-g++ goreleaser release --rm-dist -f .goreleaser-linux-glibc-arm64.yml +else + GO111MODULE=off go get -u github.com/inconshreveable/mousetrap && \ + GOPRIVATE=github.com/confluentinc GONOSUMDB=github.com/confluentinc,github.com/golangci/go-misc VERSION=$(VERSION) HOSTNAME="$(HOSTNAME)" goreleaser release --rm-dist -f .goreleaser-linux-glibc-arm64.yml +endif # This builds the Darwin, Windows and Linux binaries using goreleaser on the host computer. Goreleaser takes care of uploading the resulting binaries/archives/checksums to S3. # Uploading linux glibc files because its goreleaser file has set release disabled From ad7fe2287060ee8f52bebb17a3809a4ccbc019fd Mon Sep 17 00:00:00 2001 From: Steven Gagniere Date: Mon, 10 Oct 2022 17:48:37 -0700 Subject: [PATCH 06/19] updated the m1 dockerfile to pull the updated image --- dockerfiles/Dockerfile_linux_glibc_arm64_m1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dockerfiles/Dockerfile_linux_glibc_arm64_m1 b/dockerfiles/Dockerfile_linux_glibc_arm64_m1 index 0072602311..ce2983ea34 100644 --- a/dockerfiles/Dockerfile_linux_glibc_arm64_m1 +++ b/dockerfiles/Dockerfile_linux_glibc_arm64_m1 @@ -1,4 +1,4 @@ -FROM --platform=linux/arm64 050879227952.dkr.ecr.us-west-1.amazonaws.com/confluentinc/cli-centos-base-arm64:latest +FROM --platform=linux/arm64/v8 050879227952.dkr.ecr.us-west-1.amazonaws.com/confluentinc/cli-ubuntu-base-arm64:m1 COPY . /go/src/github.com/confluentinc/cli/ From d04d0b0d9035167c08ce4b28c87d5223e82f6bb7 Mon Sep 17 00:00:00 2001 From: Steven Gagniere <108363707+sgagniere@users.noreply.github.com> Date: Tue, 11 Oct 2022 18:59:53 -0700 Subject: [PATCH 07/19] Update dockerfiles/Dockerfile_linux_glibc_arm64 Co-authored-by: Brian Strauch --- dockerfiles/Dockerfile_linux_glibc_arm64 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dockerfiles/Dockerfile_linux_glibc_arm64 b/dockerfiles/Dockerfile_linux_glibc_arm64 index a3eabc6052..7a51df0640 100644 --- a/dockerfiles/Dockerfile_linux_glibc_arm64 +++ b/dockerfiles/Dockerfile_linux_glibc_arm64 @@ -6,4 +6,4 @@ RUN cd /go/src/github.com/confluentinc/cli && \ make gorelease-linux-glibc-arm64 RUN cd /go/src/github.com/confluentinc/cli && \ - rename 's/checksums/checksums_linux_arm64/' dist/*.txt + sed 's/checksums/checksums_linux_arm64/' dist/*.txt From eedebc7aae931daf66966b310bdf721885102086 Mon Sep 17 00:00:00 2001 From: Steven Gagniere Date: Wed, 12 Oct 2022 18:09:10 -0700 Subject: [PATCH 08/19] move duplicated line outside of if --- mk-files/release.mk | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/mk-files/release.mk b/mk-files/release.mk index 2da4dae51e..e0022afdbb 100644 --- a/mk-files/release.mk +++ b/mk-files/release.mk @@ -51,11 +51,10 @@ gorelease-linux-glibc: .PHONY: gorelease-linux-glibc-arm64 gorelease-linux-glibc-arm64: + GO111MODULE=off go get -u github.com/inconshreveable/mousetrap ifneq (,$(findstring x86_64,$(shell uname -m))) - GO111MODULE=off go get -u github.com/inconshreveable/mousetrap && \ GOPRIVATE=github.com/confluentinc GONOSUMDB=github.com/confluentinc,github.com/golangci/go-misc VERSION=$(VERSION) HOSTNAME="$(HOSTNAME)" CGO_ENABLED=1 CC=aarch64-linux-gnu-gcc CXX=aarch64-linux-gnu-g++ goreleaser release --rm-dist -f .goreleaser-linux-glibc-arm64.yml else - GO111MODULE=off go get -u github.com/inconshreveable/mousetrap && \ GOPRIVATE=github.com/confluentinc GONOSUMDB=github.com/confluentinc,github.com/golangci/go-misc VERSION=$(VERSION) HOSTNAME="$(HOSTNAME)" goreleaser release --rm-dist -f .goreleaser-linux-glibc-arm64.yml endif From 76d6d34f810afc2c5f9abad5999f80ebce0488de Mon Sep 17 00:00:00 2001 From: Steven Gagniere <108363707+sgagniere@users.noreply.github.com> Date: Wed, 12 Oct 2022 18:10:41 -0700 Subject: [PATCH 09/19] Update dockerfiles/Dockerfile_linux_glibc_arm64_m1 Co-authored-by: Brian Strauch --- dockerfiles/Dockerfile_linux_glibc_arm64_m1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dockerfiles/Dockerfile_linux_glibc_arm64_m1 b/dockerfiles/Dockerfile_linux_glibc_arm64_m1 index ce2983ea34..67ab6600be 100644 --- a/dockerfiles/Dockerfile_linux_glibc_arm64_m1 +++ b/dockerfiles/Dockerfile_linux_glibc_arm64_m1 @@ -1,4 +1,4 @@ -FROM --platform=linux/arm64/v8 050879227952.dkr.ecr.us-west-1.amazonaws.com/confluentinc/cli-ubuntu-base-arm64:m1 +FROM --platform=linux/arm64/v8 050879227952.dkr.ecr.us-west-1.amazonaws.com/confluentinc/cli-ubuntu-base-arm64:arm64 COPY . /go/src/github.com/confluentinc/cli/ From 9e3bef0b6064a8d16e3b9aa631150f69e0b51f96 Mon Sep 17 00:00:00 2001 From: Steven Gagniere <108363707+sgagniere@users.noreply.github.com> Date: Wed, 12 Oct 2022 18:21:24 -0700 Subject: [PATCH 10/19] Update build_linux_glibc.sh Co-authored-by: Brian Strauch --- build_linux_glibc.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build_linux_glibc.sh b/build_linux_glibc.sh index 2bd901fdd7..d4fc193538 100755 --- a/build_linux_glibc.sh +++ b/build_linux_glibc.sh @@ -10,7 +10,7 @@ docker container rm cli-linux-glibc-builder #build arm64 architecture=$(uname -m) if [ "$architecture" == 'x86_64' ]; then - docker build . -f ./dockerfiles/Dockerfile_linux_glibc_arm64 -t cli-linux-glibc-arm64-builder-image + docker build . -f ./dockerfiles/Dockerfile_linux_glibc_arm64_from_amd64 -t cli-linux-glibc-arm64-builder-image else docker build . -f ./dockerfiles/Dockerfile_linux_glibc_arm64_m1 -t cli-linux-glibc-arm64-builder-image fi From b0bae26e01f9438f4a6e9d10bd4477685bdf0429 Mon Sep 17 00:00:00 2001 From: Steven Gagniere Date: Wed, 12 Oct 2022 18:24:27 -0700 Subject: [PATCH 11/19] renaming dockerfiles --- build_linux_glibc.sh | 2 +- dockerfiles/Dockerfile_linux_glibc_arm64 | 4 ++-- ...glibc_arm64_m1 => Dockerfile_linux_glibc_arm64_from_amd64} | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) rename dockerfiles/{Dockerfile_linux_glibc_arm64_m1 => Dockerfile_linux_glibc_arm64_from_amd64} (50%) diff --git a/build_linux_glibc.sh b/build_linux_glibc.sh index d4fc193538..d5decadd53 100755 --- a/build_linux_glibc.sh +++ b/build_linux_glibc.sh @@ -12,7 +12,7 @@ architecture=$(uname -m) if [ "$architecture" == 'x86_64' ]; then docker build . -f ./dockerfiles/Dockerfile_linux_glibc_arm64_from_amd64 -t cli-linux-glibc-arm64-builder-image else - docker build . -f ./dockerfiles/Dockerfile_linux_glibc_arm64_m1 -t cli-linux-glibc-arm64-builder-image + docker build . -f ./dockerfiles/Dockerfile_linux_glibc_arm64 -t cli-linux-glibc-arm64-builder-image fi docker container create --name cli-linux-glibc-arm64-builder cli-linux-glibc-arm64-builder-image docker container cp cli-linux-glibc-arm64-builder:/go/src/github.com/confluentinc/cli/dist/. ./dist/ diff --git a/dockerfiles/Dockerfile_linux_glibc_arm64 b/dockerfiles/Dockerfile_linux_glibc_arm64 index 7a51df0640..67ab6600be 100644 --- a/dockerfiles/Dockerfile_linux_glibc_arm64 +++ b/dockerfiles/Dockerfile_linux_glibc_arm64 @@ -1,4 +1,4 @@ -FROM --platform=linux/amd64 050879227952.dkr.ecr.us-west-1.amazonaws.com/confluentinc/cli-ubuntu-base-arm64:latest +FROM --platform=linux/arm64/v8 050879227952.dkr.ecr.us-west-1.amazonaws.com/confluentinc/cli-ubuntu-base-arm64:arm64 COPY . /go/src/github.com/confluentinc/cli/ @@ -6,4 +6,4 @@ RUN cd /go/src/github.com/confluentinc/cli && \ make gorelease-linux-glibc-arm64 RUN cd /go/src/github.com/confluentinc/cli && \ - sed 's/checksums/checksums_linux_arm64/' dist/*.txt + rename 's/checksums/checksums_linux_arm64/' dist/*.txt diff --git a/dockerfiles/Dockerfile_linux_glibc_arm64_m1 b/dockerfiles/Dockerfile_linux_glibc_arm64_from_amd64 similarity index 50% rename from dockerfiles/Dockerfile_linux_glibc_arm64_m1 rename to dockerfiles/Dockerfile_linux_glibc_arm64_from_amd64 index 67ab6600be..7a51df0640 100644 --- a/dockerfiles/Dockerfile_linux_glibc_arm64_m1 +++ b/dockerfiles/Dockerfile_linux_glibc_arm64_from_amd64 @@ -1,4 +1,4 @@ -FROM --platform=linux/arm64/v8 050879227952.dkr.ecr.us-west-1.amazonaws.com/confluentinc/cli-ubuntu-base-arm64:arm64 +FROM --platform=linux/amd64 050879227952.dkr.ecr.us-west-1.amazonaws.com/confluentinc/cli-ubuntu-base-arm64:latest COPY . /go/src/github.com/confluentinc/cli/ @@ -6,4 +6,4 @@ RUN cd /go/src/github.com/confluentinc/cli && \ make gorelease-linux-glibc-arm64 RUN cd /go/src/github.com/confluentinc/cli && \ - rename 's/checksums/checksums_linux_arm64/' dist/*.txt + sed 's/checksums/checksums_linux_arm64/' dist/*.txt From 6a90c45a6b8503616b79e06d35e69eca2ee6f1f8 Mon Sep 17 00:00:00 2001 From: Steven Gagniere Date: Wed, 12 Oct 2022 18:26:16 -0700 Subject: [PATCH 12/19] change rename to sed in the other dockerfile --- dockerfiles/Dockerfile_linux_glibc_arm64 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dockerfiles/Dockerfile_linux_glibc_arm64 b/dockerfiles/Dockerfile_linux_glibc_arm64 index 67ab6600be..a36ac060e8 100644 --- a/dockerfiles/Dockerfile_linux_glibc_arm64 +++ b/dockerfiles/Dockerfile_linux_glibc_arm64 @@ -6,4 +6,4 @@ RUN cd /go/src/github.com/confluentinc/cli && \ make gorelease-linux-glibc-arm64 RUN cd /go/src/github.com/confluentinc/cli && \ - rename 's/checksums/checksums_linux_arm64/' dist/*.txt + sed 's/checksums/checksums_linux_arm64/' dist/*.txt From 27db8230228bed44646636504cbfad35ddcab29b Mon Sep 17 00:00:00 2001 From: Steven Gagniere Date: Wed, 2 Nov 2022 15:53:31 -0700 Subject: [PATCH 13/19] Remove go111module=off download for mousetrap --- mk-files/release.mk | 3 --- 1 file changed, 3 deletions(-) diff --git a/mk-files/release.mk b/mk-files/release.mk index e6828b1619..19e288fb92 100644 --- a/mk-files/release.mk +++ b/mk-files/release.mk @@ -46,12 +46,10 @@ endef # The glibc container doesn't need to publish to S3 so it doesn't need to $(caasenv-authenticate) .PHONY: gorelease-linux-glibc gorelease-linux-glibc: - GO111MODULE=off go get -u github.com/inconshreveable/mousetrap && \ GOPRIVATE=github.com/confluentinc GONOSUMDB=github.com/confluentinc,github.com/golangci/go-misc VERSION=$(VERSION) goreleaser release --rm-dist -f .goreleaser-linux-glibc.yml .PHONY: gorelease-linux-glibc-arm64 gorelease-linux-glibc-arm64: - GO111MODULE=off go get -u github.com/inconshreveable/mousetrap ifneq (,$(findstring x86_64,$(shell uname -m))) GOPRIVATE=github.com/confluentinc GONOSUMDB=github.com/confluentinc,github.com/golangci/go-misc VERSION=$(VERSION) CGO_ENABLED=1 CC=aarch64-linux-gnu-gcc CXX=aarch64-linux-gnu-g++ goreleaser release --rm-dist -f .goreleaser-linux-glibc-arm64.yml else @@ -65,7 +63,6 @@ gorelease: $(eval token := $(shell (grep github.com ~/.netrc -A 2 | grep password || grep github.com ~/.netrc -A 2 | grep login) | head -1 | awk -F' ' '{ print $$2 }')) $(aws-authenticate) && \ echo "BUILDING FOR DARWIN, WINDOWS, AND ALPINE LINUX" && \ - GO111MODULE=off go get -u github.com/inconshreveable/mousetrap && \ GOPRIVATE=github.com/confluentinc VERSION=$(VERSION) GITHUB_TOKEN=$(token) S3FOLDER=$(S3_STAG_FOLDER_NAME)/confluent-cli goreleaser release --rm-dist --timeout 60m -f .goreleaser.yml; \ rm -f CLIEVCodeSigningCertificate2.pfx && \ echo "BUILDING FOR GLIBC LINUX" && \ From 28ea8861bf730875d1fb434bb76a3222dc624295 Mon Sep 17 00:00:00 2001 From: Steven Gagniere Date: Wed, 2 Nov 2022 16:01:57 -0700 Subject: [PATCH 14/19] removing gonosumdb, it should default to whatever is in goprivate now --- mk-files/release.mk | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mk-files/release.mk b/mk-files/release.mk index 19e288fb92..fe03997867 100644 --- a/mk-files/release.mk +++ b/mk-files/release.mk @@ -46,14 +46,14 @@ endef # The glibc container doesn't need to publish to S3 so it doesn't need to $(caasenv-authenticate) .PHONY: gorelease-linux-glibc gorelease-linux-glibc: - GOPRIVATE=github.com/confluentinc GONOSUMDB=github.com/confluentinc,github.com/golangci/go-misc VERSION=$(VERSION) goreleaser release --rm-dist -f .goreleaser-linux-glibc.yml + GOPRIVATE=github.com/confluentinc VERSION=$(VERSION) goreleaser release --rm-dist -f .goreleaser-linux-glibc.yml .PHONY: gorelease-linux-glibc-arm64 gorelease-linux-glibc-arm64: ifneq (,$(findstring x86_64,$(shell uname -m))) - GOPRIVATE=github.com/confluentinc GONOSUMDB=github.com/confluentinc,github.com/golangci/go-misc VERSION=$(VERSION) CGO_ENABLED=1 CC=aarch64-linux-gnu-gcc CXX=aarch64-linux-gnu-g++ goreleaser release --rm-dist -f .goreleaser-linux-glibc-arm64.yml + GOPRIVATE=github.com/confluentinc VERSION=$(VERSION) CGO_ENABLED=1 CC=aarch64-linux-gnu-gcc CXX=aarch64-linux-gnu-g++ goreleaser release --rm-dist -f .goreleaser-linux-glibc-arm64.yml else - GOPRIVATE=github.com/confluentinc GONOSUMDB=github.com/confluentinc,github.com/golangci/go-misc VERSION=$(VERSION) goreleaser release --rm-dist -f .goreleaser-linux-glibc-arm64.yml + GOPRIVATE=github.com/confluentinc VERSION=$(VERSION) goreleaser release --rm-dist -f .goreleaser-linux-glibc-arm64.yml endif # This builds the Darwin, Windows and Linux binaries using goreleaser on the host computer. Goreleaser takes care of uploading the resulting binaries/archives/checksums to S3. From bbc7b382a66b4b6b00f54544603d874bd3a3c079 Mon Sep 17 00:00:00 2001 From: Steven Gagniere Date: Wed, 2 Nov 2022 17:42:04 -0700 Subject: [PATCH 15/19] go mod tidy because why not --- go.mod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go.mod b/go.mod index c920baa587..c9896e7588 100644 --- a/go.mod +++ b/go.mod @@ -63,6 +63,7 @@ require ( github.com/jonboulle/clockwork v0.2.2 github.com/linkedin/goavro/v2 v2.11.1 github.com/mattn/go-isatty v0.0.16 + github.com/mitchellh/go-homedir v1.1.0 github.com/olekukonko/tablewriter v0.0.5 github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 github.com/pkg/errors v0.9.1 @@ -306,7 +307,6 @@ require ( github.com/mbilski/exhaustivestruct v1.2.0 // indirect github.com/mgechev/revive v1.2.3 // indirect github.com/mitchellh/copystructure v1.2.0 // indirect - github.com/mitchellh/go-homedir v1.1.0 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/mitchellh/reflectwalk v1.0.2 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect From 6055c4b00357b0d6557011601a3f13df2f3d9723 Mon Sep 17 00:00:00 2001 From: Steven Gagniere <108363707+sgagniere@users.noreply.github.com> Date: Wed, 2 Nov 2022 17:45:56 -0700 Subject: [PATCH 16/19] Update build_linux_glibc.sh Co-authored-by: Brian Strauch --- build_linux_glibc.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/build_linux_glibc.sh b/build_linux_glibc.sh index d5decadd53..52e538b782 100755 --- a/build_linux_glibc.sh +++ b/build_linux_glibc.sh @@ -1,7 +1,8 @@ #!/bin/bash go mod vendor -#build amd64 + +# Build linux/amd64 docker build . -f ./dockerfiles/Dockerfile_linux_glibc -t cli-linux-glibc-builder-image docker container create --name cli-linux-glibc-builder cli-linux-glibc-builder-image docker container cp cli-linux-glibc-builder:/go/src/github.com/confluentinc/cli/dist/. ./dist/ From b6939702198918923adc5d52ed51f26c782c2482 Mon Sep 17 00:00:00 2001 From: Steven Gagniere Date: Wed, 2 Nov 2022 17:48:23 -0700 Subject: [PATCH 17/19] moved build_linux_glibc.sh to scripts --- mk-files/release.mk | 2 +- build_linux_glibc.sh => scripts/build_linux_glibc.sh | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename build_linux_glibc.sh => scripts/build_linux_glibc.sh (100%) diff --git a/mk-files/release.mk b/mk-files/release.mk index fe03997867..59b8cca2d3 100644 --- a/mk-files/release.mk +++ b/mk-files/release.mk @@ -66,7 +66,7 @@ gorelease: GOPRIVATE=github.com/confluentinc VERSION=$(VERSION) GITHUB_TOKEN=$(token) S3FOLDER=$(S3_STAG_FOLDER_NAME)/confluent-cli goreleaser release --rm-dist --timeout 60m -f .goreleaser.yml; \ rm -f CLIEVCodeSigningCertificate2.pfx && \ echo "BUILDING FOR GLIBC LINUX" && \ - ./build_linux_glibc.sh && \ + scripts/build_linux_glibc.sh && \ aws s3 cp dist/confluent_$(VERSION)_linux_amd64.tar.gz $(S3_STAG_PATH)/confluent-cli/archives/$(VERSION_NO_V)/confluent_$(VERSION)_linux_amd64.tar.gz && \ aws s3 cp dist/confluent_$(VERSION)_linux_arm64.tar.gz $(S3_STAG_PATH)/confluent-cli/archives/$(VERSION_NO_V)/confluent_$(VERSION)_linux_arm64.tar.gz && \ aws s3 cp dist/confluent_linux_amd64_v1/confluent $(S3_STAG_PATH)/confluent-cli/binaries/$(VERSION_NO_V)/confluent_$(VERSION_NO_V)_linux_amd64 && \ diff --git a/build_linux_glibc.sh b/scripts/build_linux_glibc.sh similarity index 100% rename from build_linux_glibc.sh rename to scripts/build_linux_glibc.sh From c798cfc7cb9910f8068a70161fa9e9bc2afa1a52 Mon Sep 17 00:00:00 2001 From: Steven Gagniere <108363707+sgagniere@users.noreply.github.com> Date: Thu, 3 Nov 2022 10:23:43 -0700 Subject: [PATCH 18/19] Update scripts/build_linux_glibc.sh Co-authored-by: Brian Strauch --- scripts/build_linux_glibc.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/build_linux_glibc.sh b/scripts/build_linux_glibc.sh index 52e538b782..f651571f61 100755 --- a/scripts/build_linux_glibc.sh +++ b/scripts/build_linux_glibc.sh @@ -8,7 +8,7 @@ docker container create --name cli-linux-glibc-builder cli-linux-glibc-builder-i docker container cp cli-linux-glibc-builder:/go/src/github.com/confluentinc/cli/dist/. ./dist/ docker container rm cli-linux-glibc-builder -#build arm64 +# Build linux/arm64 architecture=$(uname -m) if [ "$architecture" == 'x86_64' ]; then docker build . -f ./dockerfiles/Dockerfile_linux_glibc_arm64_from_amd64 -t cli-linux-glibc-arm64-builder-image From 01fc79903812bc4f92ce407cabf6c9a7783b7749 Mon Sep 17 00:00:00 2001 From: Steven Gagniere Date: Thu, 8 Dec 2022 13:53:34 -0800 Subject: [PATCH 19/19] replace sed with rename --- dockerfiles/Dockerfile_linux_glibc_arm64 | 2 +- dockerfiles/Dockerfile_linux_glibc_arm64_from_amd64 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dockerfiles/Dockerfile_linux_glibc_arm64 b/dockerfiles/Dockerfile_linux_glibc_arm64 index a36ac060e8..67ab6600be 100644 --- a/dockerfiles/Dockerfile_linux_glibc_arm64 +++ b/dockerfiles/Dockerfile_linux_glibc_arm64 @@ -6,4 +6,4 @@ RUN cd /go/src/github.com/confluentinc/cli && \ make gorelease-linux-glibc-arm64 RUN cd /go/src/github.com/confluentinc/cli && \ - sed 's/checksums/checksums_linux_arm64/' dist/*.txt + rename 's/checksums/checksums_linux_arm64/' dist/*.txt diff --git a/dockerfiles/Dockerfile_linux_glibc_arm64_from_amd64 b/dockerfiles/Dockerfile_linux_glibc_arm64_from_amd64 index 7a51df0640..a3eabc6052 100644 --- a/dockerfiles/Dockerfile_linux_glibc_arm64_from_amd64 +++ b/dockerfiles/Dockerfile_linux_glibc_arm64_from_amd64 @@ -6,4 +6,4 @@ RUN cd /go/src/github.com/confluentinc/cli && \ make gorelease-linux-glibc-arm64 RUN cd /go/src/github.com/confluentinc/cli && \ - sed 's/checksums/checksums_linux_arm64/' dist/*.txt + rename 's/checksums/checksums_linux_arm64/' dist/*.txt