feat: pass GITHUB_SPACK_TOKEN secret for access private repos#296
Open
wdconinc wants to merge 5 commits into
Open
feat: pass GITHUB_SPACK_TOKEN secret for access private repos#296wdconinc wants to merge 5 commits into
wdconinc wants to merge 5 commits into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds plumbing to forward an optional GITHUB_SPACK_TOKEN secret to the EIC builder image so Spack can fetch sources from private GitHub repos (e.g. eic/dawn, eic/dawncut). When the secret is present, the install step writes a ~/.netrc for github.com and removes it after the install completes.
Changes:
- Forward a new
GITHUB_SPACK_TOKENsecret through the GitHub Actions workflow and GitLab CI buildx invocation. - In
containers/eic/Dockerfile, mount the secret into both builder install stages, write a temporary~/.netrcwith the token, and delete it after install.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| containers/eic/Dockerfile | Mounts new secret in both install stages; conditionally writes/removes ~/.netrc around spack install. |
| .gitlab-ci.yml | Passes GITHUB_SPACK_TOKEN env to the buildx build as a --secret. |
| .github/workflows/build-push.yml | Adds GITHUB_SPACK_TOKEN to the secrets: list forwarded to docker/build-push-action. |
Comments suppressed due to low confidence (1)
containers/eic/Dockerfile:264
- Same concern as the first builder stage: with
set -e, a failure inspack install,spack clean, orspack gcwill skip therm -f ~/.netrccleanup at line 264. Use anEXITtrap to remove the netrc unconditionally so the token is not left behind on failure.
if [ -s /run/secrets/GITHUB_SPACK_TOKEN ]; then
printf 'machine github.com login x-access-token password %s\n' \
"$(cat /run/secrets/GITHUB_SPACK_TOKEN)" > ~/.netrc
chmod 600 ~/.netrc
fi
export CCACHE_DIR=/ccache
spack ${SPACK_FLAGS} install ${SPACK_INSTALL_FLAGS}
spack clean --downloads --stage
spack gc --yes-to-all go go-bootstrap rust rust-bootstrap py-setuptools-rust py-maturin
rm -f ~/.netrc
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
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.
Briefly, what does this PR introduce? Please link to any relevant presentations or discussions.
This PR adds the capability to download from private GitHub repositories (https://github.com/eic/dawn, https://github.com/eic/dawncut). This allows us to add some bug fixes there to make the dawn views in https://github.com/eic/epic to work again.
What is the urgency of this PR?
What kind of change does this PR introduce?
Please check if any of the following apply