ci: prevent github api rate limits using docker buildkit secrets#350
Open
Andrurachi wants to merge 1 commit intoeth-act:masterfrom
Open
ci: prevent github api rate limits using docker buildkit secrets#350Andrurachi wants to merge 1 commit intoeth-act:masterfrom
Andrurachi wants to merge 1 commit intoeth-act:masterfrom
Conversation
Author
|
Hey @han0110 , It looks like the token fix successfully bypassed the rate limit, but it caused ziskup to fetch the latest unpinned version of ZisK (v0.16.1). It looks like v0.16.1 broke the Docker builds for two reasons:
I see you just opened #351 to update ZisK to v0.17.0 (which I assume handles these changes). Once your PR is merged, I can rebase this branch on top of it. Let me know if you'd prefer me to handle this differently in the meantime :) |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
closes #41
Context
The CI pipeline frequently fails due to GitHub API rate limits when downloading dependencies and SDKs during unauthenticated Docker builds.
Solution
This PR passes the repository's
${{ secrets.GITHUB_TOKEN }}into the Docker builds to allow authenticated fetching, increasing the rate limit.Security Implementation
To prevent the token from leaking into the
docker historyor image metadata, this implementation avoids--build-arg. Instead, it uses Docker BuildKit secrets to mount the token as a temporary file during the build process, which leaves no trace in the final image.Changes:
DOCKER_BUILDKIT=1and passed theGITHUB_TOKENsecret to the build steps.build-image.shtopass--secret id=github_tokenif the environment variable is present.Dockerfile.base(and Zisk cluster) files to useRUN --mount=type=secret,id=github_token.install_*_sdk.shscripts to read the temporary secret mount. Implementedgit config url...insteadOffor source-compiled SDKs, and injected HTTP Authorization headers for SDKs thatcurlprecompiled binaries (SP1/Risc0).