-
Notifications
You must be signed in to change notification settings - Fork 642
fix: [CLI-792] moving image building process to a private docker repo #6110
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
Conversation
🎉 Snyk checks have passed. No issues have been found so far.✅ security/snyk check is complete. No issues have been found. (View Details) ✅ license/snyk check is complete. No issues have been found. (View Details) ✅ code/snyk check is complete. No issues have been found. (View Details) |
eaba0bf
to
af35941
Compare
.circleci/config.yml
Outdated
docker-amd64: | ||
docker: | ||
- image: snyklabs/cli-build:20250429-091242 | ||
- image: snyklabs/cli-build-private:20250818-112438 |
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.
Not awesome naming, but to not break the pipelines I didn't want to make the existing repository private.
af35941
to
7f4df73
Compare
7f4df73
to
dec1485
Compare
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: docker/setup-buildx-action@v2 | ||
- uses: docker/setup-buildx-action@v3 |
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.
34c7ad1
to
7912168
Compare
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.
Every step that needs the private docker images now needs credentials attached, thus the long list of new contexts in this file.
b64b572
to
4e97969
Compare
if [[ -n "${CI:-}" ]]; then | ||
# In CI: don't echo every command to reduce noise | ||
set -euo pipefail | ||
else | ||
# Local development: echo all commands for debugging | ||
set -exuo pipefail | ||
fi |
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.
Github actions throws error about too long logs and starts to reduce the output on each run. I've taken the decision to handle it like this. Opinions welcome.
5e791b1
to
86e8adc
Compare
runner: ubuntu-24.04 | ||
docker_arch: x86_64 | ||
- arch: arm64 | ||
runner: ubuntu-24.04-arm |
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.
4e0e080
to
dc89e48
Compare
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.
Building a arm64
image on a amd64
runner took more than 2 hours, so I paralleled the script instead, now it takes 10 minutes to create both. The downside was that the complexity of Bash script and GH yaml increased a tad.
This now generated a tag outside the runner, to keep it the same for both images.
The bash script now takes the architecture and the tag as arguments.
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.
Praise: Really nice!
dc89e48
to
d91ee79
Compare
f9f58ea
to
b237c9a
Compare
source /home/circleci/.sdkman/bin/sdkman-init.sh | ||
CANDIDATE=$(sdk list java | grep tem | grep 17.0. | head -1 | cut -f 6 -d "|" | xargs) | ||
yes | sdk install java "$CANDIDATE" | ||
yes | sdk install gradle 9.0.0 |
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.
vim \ | ||
make \ | ||
maven \ | ||
gradle \ |
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.
Doing this in the sdkman
part of the installation. Debian stable still installs Gradle 8.
e3c4edb
to
71ad5e7
Compare
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.
This contains outdated Gradle < 9 logic, which caused the regression tests to fail.
Changes: * Added credentials to the circleci config and contexts where needed * Silenced the very verbose logging when running on Github Actions, but kept the verbosity when running locally * Elaborated some comment strings here and there * Updated the Docker tags from the GH image builder script
71ad5e7
to
5604157
Compare
Pull Request Submission Checklist
are release-note ready, emphasizing
what was changed, not how.
What does this PR do?
We used to publish our build images to a public Docker Hub repo. This made our CircleCI configuration easier to maintain but in turn made our build images public which needn't be. This change moves the CircleCI executor images to a private Docker Hub repository, and modifies our image build script to reflect that.
Also paralleled the image building process.
Where should the reviewer start?
The CircleCI config.
e2e
pipeline: https://app.circleci.com/pipelines/github/snyk/cli?branch=dotkas/CLI-792/move-to-private-docker-repo-e2eHow should this be manually tested?
What's the product update that needs to be communicated to CLI users?
N/A, internal change.