-
Notifications
You must be signed in to change notification settings - Fork 47
Refactor and harden H100 GPU CI workflow #694
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
Merged
Changes from all commits
Commits
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
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,19 @@ | ||
| #!/usr/bin/env bash | ||
| # Copyright (c) 2026, NVIDIA CORPORATION. All rights reserved. | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| set -euo pipefail | ||
|
|
||
| mkdir -p dist | ||
| CGO_ENABLED=0 go build -trimpath -o dist/aicr ./cmd/aicr |
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 @@ | ||
| #!/usr/bin/env bash | ||
| # Copyright (c) 2026, NVIDIA CORPORATION. All rights reserved. | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| set -euo pipefail | ||
|
|
||
| if ! command -v yq >/dev/null 2>&1; then | ||
| echo "::error::yq is required to read testing.snapshot_agent_cuda_image from .settings.yaml" | ||
| exit 1 | ||
| fi | ||
|
|
||
| SNAPSHOT_AGENT_CUDA_IMAGE="$(yq eval '.testing.snapshot_agent_cuda_image // ""' .settings.yaml)" | ||
| if [[ -z "${SNAPSHOT_AGENT_CUDA_IMAGE}" || "${SNAPSHOT_AGENT_CUDA_IMAGE}" == "null" ]]; then | ||
| echo "::error::testing.snapshot_agent_cuda_image must be set in .settings.yaml" | ||
| exit 1 | ||
| fi | ||
|
|
||
| if [[ ! -f dist/aicr ]]; then | ||
| echo "::error::dist/aicr not found; build the AICR CLI before building the snapshot agent image" | ||
| exit 1 | ||
| fi | ||
|
|
||
| # Build snapshot agent image with CUDA base (provides nvidia-smi for GPU detection). | ||
| # Uses cuda:base (~250MB) instead of cuda:runtime (~1.8GB) because only nvidia-smi is needed. | ||
| timeout 900s docker build \ | ||
| --build-arg SNAPSHOT_AGENT_CUDA_IMAGE="${SNAPSHOT_AGENT_CUDA_IMAGE}" \ | ||
| -t ko.local:smoke-test -f - . <<'DOCKERFILE' | ||
| ARG SNAPSHOT_AGENT_CUDA_IMAGE | ||
| FROM ${SNAPSHOT_AGENT_CUDA_IMAGE} | ||
| COPY dist/aicr /usr/local/bin/aicr | ||
| ENTRYPOINT ["/usr/local/bin/aicr"] | ||
| DOCKERFILE | ||
|
|
||
| # Load onto all nodes. The snapshot agent requests nvidia.com/gpu but does not | ||
| # set a node selector, so it can land on any GPU-capable node including the | ||
| # control-plane in the L40G smoke test. | ||
| timeout 900 kind load docker-image ko.local:smoke-test --name "${KIND_CLUSTER_NAME}" || { | ||
| echo "::warning::kind load attempt 1 failed for ko.local:smoke-test, retrying..." | ||
| timeout 900 kind load docker-image ko.local:smoke-test --name "${KIND_CLUSTER_NAME}" | ||
| } |
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,59 @@ | ||
| #!/usr/bin/env bash | ||
| # Copyright (c) 2026, NVIDIA CORPORATION. All rights reserved. | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| set -euo pipefail | ||
|
|
||
| VALIDATOR_PHASES="${VALIDATOR_PHASES:-}" | ||
| if [[ -n "${VALIDATOR_PHASES}" ]]; then | ||
| if [[ "${VALIDATOR_PHASES}" == "none" ]]; then | ||
| echo "Skipping validator builds (validator_phases=none)" | ||
| exit 0 | ||
| fi | ||
| PHASES="${VALIDATOR_PHASES}" | ||
| else | ||
| # Default: build all phases (backwards compatible). | ||
| PHASES="deployment,performance,conformance" | ||
| fi | ||
|
|
||
| : "${KIND_CLUSTER_NAME:?KIND_CLUSTER_NAME must be set}" | ||
|
|
||
| mkdir -p dist/validator | ||
| for phase in ${PHASES//,/ }; do | ||
| if ! [[ "${phase}" =~ ^[a-z][a-z0-9_-]*$ ]]; then | ||
| echo "::error::invalid validator phase '${phase}'; expected ^[a-z][a-z0-9_-]*$" | ||
| exit 1 | ||
| fi | ||
| echo "Building validator binary: ${phase}" | ||
| CGO_ENABLED=0 go build -trimpath -o "dist/validator/${phase}" "./validators/${phase}" | ||
| done | ||
|
|
||
| for phase in ${PHASES//,/ }; do | ||
| if [[ ! -d "validators/${phase}/testdata" ]]; then | ||
| echo "::error::validators/${phase}/testdata is missing" | ||
| exit 1 | ||
| fi | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
| docker build -t "ko.local/aicr-validators/${phase}:latest" -f - . <<DOCKERFILE | ||
| FROM gcr.io/distroless/static-debian12:nonroot | ||
| COPY dist/validator/${phase} /${phase} | ||
| COPY validators/${phase}/testdata /app/testdata | ||
| WORKDIR /app | ||
| USER nonroot | ||
| ENTRYPOINT ["/${phase}"] | ||
| DOCKERFILE | ||
| timeout 600 kind load docker-image "ko.local/aicr-validators/${phase}:latest" --name "${KIND_CLUSTER_NAME}" || { | ||
| echo "::warning::kind load attempt 1 failed for ko.local/aicr-validators/${phase}:latest, retrying..." | ||
| timeout 600 kind load docker-image "ko.local/aicr-validators/${phase}:latest" --name "${KIND_CLUSTER_NAME}" | ||
| } | ||
| done | ||
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,18 @@ | ||
| #!/usr/bin/env bash | ||
| # Copyright (c) 2026, NVIDIA CORPORATION. All rights reserved. | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| set -euo pipefail | ||
|
|
||
| cp dist/aicr ./aicr |
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,80 @@ | ||
| # Copyright (c) 2026, NVIDIA CORPORATION. All rights reserved. | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| name: 'Check Control Plane Health' | ||
| description: 'Fails if Kind control-plane static pods are missing, unready, or unstable.' | ||
|
|
||
| inputs: | ||
| cluster_name: | ||
| description: 'Kind cluster name' | ||
| required: true | ||
| namespace: | ||
| description: 'Namespace that contains the control-plane pods' | ||
| required: false | ||
| default: kube-system | ||
| components: | ||
| description: 'Space-separated component label values to check' | ||
| required: false | ||
| default: kube-apiserver kube-controller-manager kube-scheduler etcd | ||
| wait_timeout: | ||
| description: 'Timeout for each component readiness wait' | ||
| required: false | ||
| default: 60s | ||
| max_restarts: | ||
| description: 'Compatibility input; with stability_window=0s, fail if historical restartCount exceeds this ceiling' | ||
| required: false | ||
| default: '1' | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
| stability_window: | ||
| description: 'Optional duration to watch for new control-plane restarts after pods are Ready' | ||
| required: false | ||
| default: '0s' | ||
| stability_probe_interval: | ||
| description: 'Interval for active API server probes during the stability window' | ||
| required: false | ||
| default: '10s' | ||
| stability_probe_failure_threshold: | ||
| description: 'Consecutive active stability probe failures allowed before failing' | ||
| required: false | ||
| default: '2' | ||
| lease_components: | ||
| description: 'Space-separated leader election lease names to check for freshness' | ||
| required: false | ||
| default: kube-controller-manager kube-scheduler | ||
| lease_stale_timeout: | ||
| description: 'Maximum allowed leader election lease age at the end of a stability window' | ||
| required: false | ||
| default: '120s' | ||
| runtime_diagnostics: | ||
| description: 'Collect expensive kind node runtime diagnostics such as docker stats, crictl, and journalctl on failure' | ||
| required: false | ||
| default: 'false' | ||
|
|
||
| runs: | ||
| using: 'composite' | ||
| steps: | ||
| - name: Check control-plane pods | ||
| shell: bash | ||
| env: | ||
| KIND_CLUSTER_NAME: ${{ inputs.cluster_name }} | ||
| NAMESPACE: ${{ inputs.namespace }} | ||
| COMPONENTS: ${{ inputs.components }} | ||
| WAIT_TIMEOUT: ${{ inputs.wait_timeout }} | ||
| MAX_RESTARTS: ${{ inputs.max_restarts }} | ||
| STABILITY_WINDOW: ${{ inputs.stability_window }} | ||
| STABILITY_PROBE_INTERVAL: ${{ inputs.stability_probe_interval }} | ||
| STABILITY_PROBE_FAILURE_THRESHOLD: ${{ inputs.stability_probe_failure_threshold }} | ||
| LEASE_COMPONENTS: ${{ inputs.lease_components }} | ||
| LEASE_STALE_TIMEOUT: ${{ inputs.lease_stale_timeout }} | ||
| RUNTIME_DIAGNOSTICS: ${{ inputs.runtime_diagnostics }} | ||
| run: bash "${{ github.action_path }}/check-control-plane-health.sh" | ||
Oops, something went wrong.
Oops, something went wrong.
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.