Skip to content

feat: pass GITHUB_SPACK_TOKEN secret for access private repos#296

Open
wdconinc wants to merge 5 commits into
masterfrom
github-spack-token
Open

feat: pass GITHUB_SPACK_TOKEN secret for access private repos#296
wdconinc wants to merge 5 commits into
masterfrom
github-spack-token

Conversation

@wdconinc
Copy link
Copy Markdown
Contributor

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?

  • High (please describe reason below)
  • Medium
  • Low

What kind of change does this PR introduce?

  • Bug fix (issue #__)
  • New feature (issue: installation from private repositories)
  • Optimization (issue #__)
  • Updated documentation
  • other: __

Please check if any of the following apply

  • This PR introduces breaking changes. Please describe changes users need to make below.
  • This PR changes default behavior. Please describe changes below.
  • AI was used in preparing this PR. Please describe usage below.

Copilot AI review requested due to automatic review settings May 18, 2026 23:24
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_TOKEN secret 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 ~/.netrc with 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 in spack install, spack clean, or spack gc will skip the rm -f ~/.netrc cleanup at line 264. Use an EXIT trap 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

Comment thread .github/workflows/build-push.yml Outdated
Comment thread containers/eic/Dockerfile
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings May 18, 2026 23:30
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

Comment thread .github/workflows/build-push.yml Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings May 18, 2026 23:44
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants