-
Notifications
You must be signed in to change notification settings - Fork 24
Build CLI for arm64 Linux (and Alpine) #1442
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
34 commits
Select commit
Hold shift + click to select a range
8dec86c
cross-build now supports linux arm64
sgagniere fcb0a69
added entry to goreleaser and removed the rest of the references to t…
sgagniere 3da0091
Some dockerfiles + build scripts, snapshot flag is temporary
sgagniere 84ba307
Removed snapshot flag (not included, but the base image was updated t…
sgagniere 1919e51
Modifications to release make targets
sgagniere e23802a
some cleanup & switched to vendoring for linux glibc amd64
sgagniere b7d2302
Combined the linux glibc sh files into one
sgagniere 3b4fe85
Removed some redundant lines and rearranged others in release.mk
sgagniere 5ca33f5
Merge from main
sgagniere 48b8321
Repair standard_build_layout after merge
sgagniere 7cbbccc
A comment was in a misleading spot; moved it
sgagniere edb474b
Oops, forgot to make generate-packaging-patch
sgagniere 013f041
Removed redundant if else block
sgagniere 0903953
Remove unnecessary library file
sgagniere bd49840
Build linux glibc versions using cross compile instead of docker images
sgagniere b362f61
generate packaging patch
sgagniere b51c8a7
Restore accidentally deleted lines
sgagniere e3107c1
Restore and update glibc goreleaser file
sgagniere 1dd2e3e
missing newline
sgagniere 2acc431
Split back into two goreleaser files to avoid goreleaser errors from …
sgagniere 8884869
Removed disable upload flags in the goreleasers and added back the li…
sgagniere 9969c7a
chore: minor version bump v2.26.0 [ci skip]
sgagniere e65ada2
Revert "chore: minor version bump v2.26.0 [ci skip]"
sgagniere b00269b
fixed alignment
sgagniere ff641cc
formatting changes
sgagniere e763d4f
Revert the last 11 commits (ouch)
sgagniere 400e469
Merge branch 'main' of github.com:confluentinc/cli into linux-arm64
sgagniere dacddc3
Redoing formatting change that got reverted with everything else
sgagniere 1d39e0a
update ARCHIVE_TYPES var for copying stag archives to latest
sgagniere bbf8485
Updated linux dockerfiles to use images from prod ecr
sgagniere a517cb5
added back another change that got clobbered in my reversion
sgagniere 1f96d29
Merge branch 'main' of github.com:confluentinc/cli into linux-arm64
sgagniere 7f393bc
Added platform flag to fix a minor annoyance where Docker will ignore…
sgagniere 386347f
Added the same fix as the last commit, but for the amd64 image on arm…
sgagniere File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| project_name: confluent | ||
|
|
||
| dist: dist | ||
|
|
||
| before: | ||
| hooks: | ||
| # TODO: [CLI-92] we delete the semaphore cache during release to workaround an issue with semaphore and goreleaser | ||
| - rm -rf $GOPATH/pkg/mod | ||
|
|
||
| # NOTE: This will put all builds into the same ./dist folder. There is no way to configure goreleaser output directories per-build, only per-project. | ||
| # That means that we should probably not rely on the CI's directory layout for publishing binaries to s3 since cloud and rbac will be intermingled. | ||
| builds: | ||
| - binary: confluent | ||
| main: cmd/confluent/main.go | ||
| flags: | ||
| - -mod=vendor | ||
| ldflags: | ||
| - -s -w -X main.version={{.Env.VERSION}} -X main.commit={{.ShortCommit}} -X main.date={{.Date}} -X main.host={{.Env.HOSTNAME}} | ||
| gcflags: | ||
| - all=-trimpath={{.Env.HOME}}/git | ||
| asmflags: | ||
| - all=-trimpath={{.Env.HOME}}/git | ||
| goos: | ||
| - linux | ||
| goarch: | ||
| - arm64 | ||
|
|
||
| release: | ||
| disable: true | ||
|
|
||
| archives: | ||
| - id: binary | ||
| format: binary | ||
| - id: archive | ||
| name_template: "{{ .ProjectName }}_v{{ .Version }}_{{ .Os }}_{{ .Arch }}" | ||
| format: tar.gz | ||
| format_overrides: | ||
| - goos: windows | ||
| format: zip | ||
| wrap_in_directory: "{{ .ProjectName }}" | ||
| files: | ||
| - LICENSE | ||
| - legal/**/* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,14 @@ | ||
| #!/bin/bash | ||
|
|
||
| cp ~/.netrc . | ||
| go mod vendor | ||
| #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 | ||
| docker container rm cli-linux-glibc-builder | ||
| #arm64 | ||
| docker build . -f ./dockerfiles/Dockerfile_linux_glibc_arm64 -t cli-linux-glibc-arm64-builder-image | ||
| 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 | ||
| rm -rf vendor |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,13 +1,9 @@ | ||
| FROM 037803949979.dkr.ecr.us-west-1.amazonaws.com/centos-base:latest | ||
| FROM --platform=linux/amd64 050879227952.dkr.ecr.us-west-1.amazonaws.com/confluentinc/cli-centos-base-amd64:latest | ||
|
|
||
| COPY . /go/src/github.com/confluentinc/cli/ | ||
|
|
||
| COPY .netrc /root/.netrc | ||
| RUN chmod 600 /root/.netrc | ||
sgagniere marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| RUN cd /go/src/github.com/confluentinc/cli && \ | ||
| make gorelease-linux-glibc | ||
|
|
||
| RUN cd /go/src/github.com/confluentinc/cli && \ | ||
| for file in dist/*linux*; do mv -v "$file" "${file/linux/linux}"; done ; \ | ||
| for file in dist/*.txt; do mv -v "$file" "${file/checksums/checksums_linux}"; done; | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| FROM --platform=linux/arm64/v8 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 && \ | ||
| for file in dist/*.txt; do mv -v "$file" "${file/checksums/checksums_linux_arm64}"; done; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mind explaining why this was changed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Originally I did this because I had issues getting my github credentials to work on the arm64 image, but I went back and updated this amd64 file too because it feels slightly cleaner.
This way, we download all the dependencies before we copy into the image instead of downloading them in the image, and that way we don't need to copy our netrc into the cli directory and into the image.