-
Notifications
You must be signed in to change notification settings - Fork 2.2k
[NVIDIA-850] Move signed precompiled drivers to registry.stage.redhat.io #79860
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
Open
josecastillolema
wants to merge
4
commits into
openshift:main
Choose a base branch
from
josecastillolema:precompiled-driver2
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
7cba171
[NVIDIA-850] Move signed precompiled drivers to registry.stage.redhat.io
josecastillolema a438e10
Fix possible credential leak
josecastillolema 34ae982
Adjust timeout and machineCount wait condition
josecastillolema 12e7fa9
Switch from cli to cli-jq image
josecastillolema 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
17 changes: 17 additions & 0 deletions
17
ci-operator/step-registry/nvidia-gpu-operator/merge-stage-credentials/OWNERS
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,17 @@ | ||
| approvers: | ||
| - empovit | ||
| - fabiendupont | ||
| - ggordanired | ||
| - josecastillolema | ||
| - TomerNewman | ||
| - wabouhamad | ||
| - ybettan | ||
| options: {} | ||
| reviewers: | ||
| - empovit | ||
| - fabiendupont | ||
| - ggordanired | ||
| - josecastillolema | ||
| - TomerNewman | ||
| - wabouhamad | ||
| - ybettan |
51 changes: 51 additions & 0 deletions
51
...-operator/merge-stage-credentials/nvidia-gpu-operator-merge-stage-credentials-commands.sh
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,51 @@ | ||
| #!/bin/bash | ||
|
|
||
| set -euo pipefail | ||
|
|
||
| if [[ "${MERGE_STAGE_REGISTRY_CREDENTIALS}" != "true" ]]; then | ||
| echo "MERGE_STAGE_REGISTRY_CREDENTIALS is not 'true', skipping." | ||
| exit 0 | ||
| fi | ||
|
|
||
| STAGE_REGISTRY_PATH="/var/run/vault/mirror-registry/registry_stage.json" | ||
|
|
||
| if [[ ! -f "${STAGE_REGISTRY_PATH}" ]]; then | ||
| echo "Stage registry credentials not found at ${STAGE_REGISTRY_PATH}" | ||
| exit 1 | ||
| fi | ||
|
|
||
| echo "Extracting current cluster pull secret..." | ||
| oc extract secret/pull-secret -n openshift-config --confirm --to /tmp | ||
|
|
||
| echo "Merging registry.stage.redhat.io credentials..." | ||
| [[ $- == *x* ]] && WAS_TRACING=true || WAS_TRACING=false | ||
| set +x | ||
| stage_auth_user=$(jq -r '.user' "${STAGE_REGISTRY_PATH}") | ||
| stage_auth_password=$(jq -r '.password' "${STAGE_REGISTRY_PATH}") | ||
| stage_registry_auth=$(echo -n "${stage_auth_user}:${stage_auth_password}" | base64 -w 0) | ||
| $WAS_TRACING && set -x | ||
|
|
||
| jq --argjson stage "{\"registry.stage.redhat.io\": {\"auth\": \"${stage_registry_auth}\"}}" \ | ||
| '.auths |= . + $stage' /tmp/.dockerconfigjson > /tmp/new-dockerconfigjson | ||
|
|
||
| echo "Updating cluster pull secret..." | ||
| oc set data secret/pull-secret -n openshift-config \ | ||
| --from-file=.dockerconfigjson=/tmp/new-dockerconfigjson | ||
|
|
||
| echo "Waiting for MCP worker pool to propagate..." | ||
| total=$(oc get mcp worker -o jsonpath='{.status.machineCount}') | ||
| COUNTER=0 | ||
| while [ $COUNTER -lt 600 ]; do | ||
| sleep 20 | ||
| COUNTER=$((COUNTER + 20)) | ||
| updated=$(oc get mcp worker -o jsonpath='{.status.updatedMachineCount}') | ||
| echo "MCP rollout: ${updated}/${total} machines updated (${COUNTER}s elapsed)" | ||
| if [[ "${updated}" == "${total}" ]]; then | ||
| echo "MCP rollout complete." | ||
| exit 0 | ||
| fi | ||
| done | ||
|
coderabbitai[bot] marked this conversation as resolved.
Outdated
|
||
|
|
||
| echo "MCP rollout timed out after ${COUNTER}s" | ||
| oc get mcp worker -o yaml | ||
| exit 1 | ||
|
coderabbitai[bot] marked this conversation as resolved.
Outdated
|
||
23 changes: 23 additions & 0 deletions
23
...tor/merge-stage-credentials/nvidia-gpu-operator-merge-stage-credentials-ref.metadata.json
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,23 @@ | ||
| { | ||
| "path": "nvidia-gpu-operator/merge-stage-credentials/nvidia-gpu-operator-merge-stage-credentials-ref.yaml", | ||
| "owners": { | ||
| "approvers": [ | ||
| "empovit", | ||
| "fabiendupont", | ||
| "ggordanired", | ||
| "josecastillolema", | ||
| "TomerNewman", | ||
| "wabouhamad", | ||
| "ybettan" | ||
| ], | ||
| "reviewers": [ | ||
| "empovit", | ||
| "fabiendupont", | ||
| "ggordanired", | ||
| "josecastillolema", | ||
| "TomerNewman", | ||
| "wabouhamad", | ||
| "ybettan" | ||
| ] | ||
| } | ||
| } |
30 changes: 30 additions & 0 deletions
30
...gpu-operator/merge-stage-credentials/nvidia-gpu-operator-merge-stage-credentials-ref.yaml
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,30 @@ | ||
| ref: | ||
| as: nvidia-gpu-operator-merge-stage-credentials | ||
| from: cli | ||
| cli: latest | ||
| grace_period: 10m | ||
| commands: nvidia-gpu-operator-merge-stage-credentials-commands.sh | ||
| timeout: 10m | ||
| resources: | ||
| requests: | ||
| cpu: 100m | ||
| memory: 100Mi | ||
| env: | ||
| - name: MERGE_STAGE_REGISTRY_CREDENTIALS | ||
| default: "false" | ||
| documentation: |- | ||
| When set to "true", merges registry.stage.redhat.io credentials into | ||
| the cluster global pull secret. Required for pulling precompiled driver | ||
| images from the Red Hat staging registry. When "false", the step is a | ||
| no-op. | ||
| credentials: | ||
| - namespace: test-credentials | ||
| name: openshift-custom-mirror-registry | ||
| mount_path: /var/run/vault/mirror-registry | ||
| documentation: |- | ||
| Merges registry.stage.redhat.io pull credentials into the cluster global | ||
| pull secret so that the GPU operator can pull precompiled driver images | ||
| from the Red Hat staging registry. | ||
|
|
||
| Controlled by the MERGE_STAGE_REGISTRY_CREDENTIALS env var. When set to | ||
| "false" (default), the step exits immediately as a no-op. |
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.