ci(render-quarto): pass GITHUB_TOKEN as BuildKit secret to avoid Docker API rate limit#4028
Open
anshul23102 wants to merge 1 commit into
Open
Conversation
…rate limit The Docker build step in render-quarto.yml runs make inside the container, which calls confirm_deps.R -> remotes::install_deps() when any package dependency is not already present in pecan/depends:latest. Those calls hit the unauthenticated GitHub API and fail with HTTP 403 when concurrent CI jobs exhaust the 60 req/hr limit. Fix: enable Docker BuildKit and pass GITHUB_TOKEN from the GitHub Actions environment as a BuildKit secret (id=GITHUB_PAT). The secret is mounted read-only inside the single RUN layer via --mount=type=secret, exported as GITHUB_PAT (the variable remotes respects), and never written into any image layer, so it does not appear in docker history or image metadata.
Member
|
@anshul23102 Thanks for working on this and for your patience with the wait for review. I'm curious why you're passing the token only to the base build and not to other builds, especially For context, when we've used this approach in the past (see #3083) we passed the secret to all three of the Ping @robkooper: Any other factors we should consider before re-adding secrets? |
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.
Summary
The
render-notebookCI job was failing intermittently with:This happened inside the Docker build step at
modules/data.atmosphere, whereconfirm_deps.Rcallsremotes::install_deps()when a package dependency is not already cached inpecan/depends:latest. Those calls hit the unauthenticated GitHub API (60 req/hr limit), which is exhausted during concurrent CI runs.Fix: Enable Docker BuildKit and pass
GITHUB_TOKENfrom the GitHub Actions environment as a BuildKit secret. The secret is mounted read-only inside the singleRUNlayer via--mount=type=secret, exported asGITHUB_PAT(the variableremotesconsults automatically), and is never written into any image layer -- it does not appear indocker historyor image metadata.Authenticated requests receive 5,000 req/hr, well above what the
makedependency checks need.Changes
.github/workflows/render-quarto.yml: enableDOCKER_BUILDKIT=1, passGITHUB_TOKENas a BuildKit secret todocker build.docker/base/Dockerfile: use--mount=type=secret,id=GITHUB_PATin theRUNlayer so the token is available as$GITHUB_PATduringmake.Test plan
render-notebookCI passes on this PR