-
Notifications
You must be signed in to change notification settings - Fork 20
fix(kube): Update kube scripts to pull from ghcr #513
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
Merged
matthewgrossman
merged 8 commits into
main
from
mgrossman/aircore-857-gpu-testing-on-dev-blue-via-minikube
Jun 30, 2026
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
ce4613d
fix(kube): Update kube scripts to pull from ghcr
matthewgrossman 438763f
add nvcrimagepullsecret
matthewgrossman 101ad89
consolidate secrets
matthewgrossman 8015407
more consolidation
matthewgrossman 3d2d1b4
update
matthewgrossman f7d3180
Merge branch 'main' into mgrossman/aircore-857-gpu-testing-on-dev-blu…
matthewgrossman 6d12367
comment about argv
matthewgrossman 6e0dd22
placeholder
matthewgrossman File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,73 @@ | ||
| #!/usr/bin/env bash | ||
| # Shared utilities for e2e K8s setup scripts. | ||
|
|
||
| # --------------------------------------------------------------------------- | ||
| # Logging | ||
| # --------------------------------------------------------------------------- | ||
|
|
||
| log_info() { echo -e "\033[0;32m[INFO]\033[0m $*"; } | ||
| log_warn() { echo -e "\033[1;33m[WARN]\033[0m $*"; } | ||
| log_error() { echo -e "\033[0;31m[ERROR]\033[0m $*"; } | ||
|
|
||
| # --------------------------------------------------------------------------- | ||
| # Secrets | ||
| # --------------------------------------------------------------------------- | ||
|
|
||
| # _dockerconfigjson SERVER USERNAME PASSWORD | ||
| # | ||
| # Prints a dockerconfigjson blob for a single registry. | ||
| _dockerconfigjson() { | ||
| printf '{"auths":{"%s":{"username":"%s","password":"%s","auth":"%s"}}}' \ | ||
| "$1" "$2" "$3" "$(printf '%s:%s' "$2" "$3" | base64 | tr -d '\n')" | ||
| } | ||
|
|
||
| # create_platform_secrets NAMESPACE | ||
| # | ||
| # Creates the standard set of platform secrets in the given namespace. | ||
| # NGC secrets are always created (with a placeholder if NGC_API_KEY is unset) | ||
| # because the helm chart expects the ngc-api secret to exist. Other secrets | ||
| # are created only when their corresponding env var is set: | ||
| # - ghcr-pull: when GITHUB_TOKEN is set | ||
| # - huggingface-token: when HF_TOKEN is set | ||
| # | ||
| # Secret values are passed via process substitution to keep them out of | ||
| # process arguments visible in /proc. | ||
| create_platform_secrets() { | ||
| local namespace="${1:?namespace is required}" | ||
| local kubectl_ns=(kubectl -n "${namespace}") | ||
| local ngc_key="${NGC_API_KEY:-placeholder}" | ||
|
|
||
| if [ -z "${NGC_API_KEY:-}" ]; then | ||
| log_warn "NGC_API_KEY not set, creating NGC secrets with placeholder" | ||
| fi | ||
|
|
||
| log_info "Creating NGC API secret..." | ||
| "${kubectl_ns[@]}" create secret generic ngc-api \ | ||
| --from-file=NGC_API_KEY=<(printf '%s' "${ngc_key}") \ | ||
| --dry-run=client -o yaml | "${kubectl_ns[@]}" apply -f - | ||
|
|
||
| log_info "Creating NGC image pull secret..." | ||
| "${kubectl_ns[@]}" create secret generic nvcrimagepullsecret \ | ||
| --type=kubernetes.io/dockerconfigjson \ | ||
| --from-file=.dockerconfigjson=<(_dockerconfigjson nvcr.io '$oauthtoken' "${ngc_key}") \ | ||
| --dry-run=client -o yaml | "${kubectl_ns[@]}" apply -f - | ||
|
|
||
| if [ -n "${GITHUB_TOKEN:-}" ]; then | ||
| log_info "Creating GHCR image pull secret..." | ||
| "${kubectl_ns[@]}" create secret generic ghcr-pull \ | ||
| --type=kubernetes.io/dockerconfigjson \ | ||
| --from-file=.dockerconfigjson=<(_dockerconfigjson ghcr.io x-access-token "${GITHUB_TOKEN}") \ | ||
| --dry-run=client -o yaml | "${kubectl_ns[@]}" apply -f - | ||
| else | ||
| log_warn "GITHUB_TOKEN not set, skipping GHCR image pull secret" | ||
| fi | ||
|
|
||
| if [ -n "${HF_TOKEN:-}" ]; then | ||
| log_info "Creating HuggingFace token secret..." | ||
| "${kubectl_ns[@]}" create secret generic huggingface-token \ | ||
| --from-file=HF_TOKEN=<(printf '%s' "${HF_TOKEN}") \ | ||
| --dry-run=client -o yaml | "${kubectl_ns[@]}" apply -f - | ||
| else | ||
| log_warn "HF_TOKEN not set, skipping HuggingFace token secret" | ||
| fi | ||
| } |
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
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
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
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.
Uh oh!
There was an error while loading. Please reload this page.