Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .github/workflows/e2e-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,13 @@ jobs:
with:
name: values-overrides
path: ${{ github.workspace }}
- name: Set up Helm
uses: azure/setup-helm@9bc31f4ebc9c6b171d7bfbaa5d006ae7abdb4310 # v5.0.1
- name: Verify the published Helm chart is available
env:
HELM_CHART: ${{ needs.publish-helm-oci-chart.outputs.chart_reference }}
HELM_CHART_VERSION: ${{ needs.publish-helm-oci-chart.outputs.chart_version }}
run: helm show chart "${HELM_CHART}" --version "${HELM_CHART_VERSION}"
- name: Set up Holodeck
uses: NVIDIA/holodeck@e0f3932cf284d92421a55536839fa821a14116aa # v0.3.7
with:
Expand Down Expand Up @@ -124,6 +131,8 @@ jobs:
env:
OPERATOR_VERSION: ${{ needs.variables.outputs.operator_version }}
OPERATOR_IMAGE: ${{ needs.variables.outputs.operator_image }}
HELM_CHART: ${{ needs.publish-helm-oci-chart.outputs.chart_reference }}
HELM_CHART_VERSION: ${{ needs.publish-helm-oci-chart.outputs.chart_version }}
GPU_PRODUCT_NAME: "Tesla-T4"
SKIP_LAUNCH: "true"
CONTAINER_RUNTIME: "containerd"
Expand Down Expand Up @@ -158,6 +167,13 @@ jobs:
with:
name: values-overrides
path: ${{ github.workspace }}
- name: Set up Helm
uses: azure/setup-helm@9bc31f4ebc9c6b171d7bfbaa5d006ae7abdb4310 # v5.0.1
- name: Verify the published Helm chart is available
env:
HELM_CHART: ${{ needs.publish-helm-oci-chart.outputs.chart_reference }}
HELM_CHART_VERSION: ${{ needs.publish-helm-oci-chart.outputs.chart_version }}
run: helm show chart "${HELM_CHART}" --version "${HELM_CHART_VERSION}"
- name: Set up Holodeck
uses: NVIDIA/holodeck@e0f3932cf284d92421a55536839fa821a14116aa # v0.3.7
with:
Expand Down Expand Up @@ -192,6 +208,8 @@ jobs:
env:
OPERATOR_VERSION: ${{ needs.variables.outputs.operator_version }}
OPERATOR_IMAGE: ${{ needs.variables.outputs.operator_image }}
HELM_CHART: ${{ needs.publish-helm-oci-chart.outputs.chart_reference }}
HELM_CHART_VERSION: ${{ needs.publish-helm-oci-chart.outputs.chart_version }}
GPU_PRODUCT_NAME: "Tesla-T4"
SKIP_LAUNCH: "true"
CONTAINER_RUNTIME: "containerd"
Expand Down
13 changes: 13 additions & 0 deletions .github/workflows/publish-helm-oci-chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,13 @@ on:
operator_version:
required: true
type: string
outputs:
chart_reference:
description: "The OCI reference of the published Helm chart"
value: ${{ jobs.publish-helm-chart.outputs.chart_reference }}
chart_version:
description: "The version of the published Helm chart"
value: ${{ jobs.publish-helm-chart.outputs.chart_version }}

permissions:
contents: read
Expand All @@ -36,6 +43,9 @@ jobs:
publish-helm-chart:
runs-on: ubuntu-latest
timeout-minutes: 10
outputs:
chart_reference: ${{ steps.publish.outputs.chart_reference }}
chart_version: ${{ steps.package.outputs.chart_version }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
name: Check out code
Expand Down Expand Up @@ -89,6 +99,7 @@ jobs:
echo "chart_version=${CHART_VERSION}" >> "${GITHUB_OUTPUT}"

- name: Publish Helm OCI chart
id: publish
env:
GITHUB_REPOSITORY_OWNER: ${{ github.repository_owner }}
CHART_PACKAGE: ${{ steps.package.outputs.chart_package }}
Expand All @@ -100,4 +111,6 @@ jobs:
CHART_REPOSITORY="oci://ghcr.io/${LOWERCASE_REPO_OWNER}/gpu-operator/charts"

helm push "${CHART_PACKAGE}" "${CHART_REPOSITORY}"

echo "chart_reference=${CHART_REPOSITORY}/gpu-operator" >> "${GITHUB_OUTPUT}"
echo "::notice::Published Helm chart to ${CHART_REPOSITORY}/gpu-operator:${CHART_VERSION}"
2 changes: 2 additions & 0 deletions tests/local.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,6 @@ remote \
GPU_MODE="${GPU_MODE}" \
NGC_API_KEY="${NGC_API_KEY}" \
VALUES_FILE="${VALUES_FILE:-}" \
HELM_CHART="${HELM_CHART:-}" \
HELM_CHART_VERSION="${HELM_CHART_VERSION:-}" \
${TEST_CASE}
6 changes: 6 additions & 0 deletions tests/scripts/.definitions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,9 @@ TERRAFORM="terraform -chdir=${TERRAFORM_DIR}"
: ${PRIVATE_REGISTRY:="nvcr.io"}

: ${GPU_MODE:="gpu"}

CHART_REFERENCE="${HELM_CHART:-${PROJECT_DIR}/deployments/gpu-operator}"
HELM_CMD_ARGS=("${CHART_REFERENCE}")
if [[ -n "${HELM_CHART_VERSION:-}" ]]; then
HELM_CMD_ARGS+=(--version "${HELM_CHART_VERSION}")
fi
6 changes: 3 additions & 3 deletions tests/scripts/end-to-end-nvidia-driver.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ test_nvidiadriver_helm_render_options() {
local render_file
render_file=$(mktemp)

${HELM} template gpu-operator "${PROJECT_DIR}/deployments/gpu-operator" \
${HELM} template gpu-operator "${HELM_CMD_ARGS[@]}" \
-n "${TEST_NAMESPACE}" \
--set driver.nvidiaDriverCRD.enabled=true \
--set driver.nvidiaDriverCRD.deployDefaultCR=true > "${render_file}"
grep -q "kind: NVIDIADriver" "${render_file}"
grep -q "default: true" "${render_file}"

${HELM} template gpu-operator "${PROJECT_DIR}/deployments/gpu-operator" \
${HELM} template gpu-operator "${HELM_CMD_ARGS[@]}" \
-n "${TEST_NAMESPACE}" \
--set driver.nvidiaDriverCRD.enabled=true \
--set driver.nvidiaDriverCRD.deployDefaultCR=false > "${render_file}"
Expand All @@ -23,7 +23,7 @@ test_nvidiadriver_helm_render_options() {
exit 1
fi

${HELM} template gpu-operator "${PROJECT_DIR}/deployments/gpu-operator" \
${HELM} template gpu-operator "${HELM_CMD_ARGS[@]}" \
-n "${TEST_NAMESPACE}" \
--set driver.nvidiaDriverCRD.enabled=false \
--set driver.nvidiaDriverCRD.deployDefaultCR=true > "${render_file}"
Expand Down
4 changes: 2 additions & 2 deletions tests/scripts/install-operator.sh
Original file line number Diff line number Diff line change
Expand Up @@ -105,15 +105,15 @@ echo "Operator image: ${OPERATOR_IMAGE}:${OPERATOR_VERSION}"

if [[ "${USE_VALUES_FILE}" == "true" ]]; then
echo "Using values file approach: ${VALUES_FILE}"
${HELM} install ${PROJECT_DIR}/deployments/gpu-operator --generate-name \
${HELM} install "${HELM_CMD_ARGS[@]}" --generate-name \
-n "${TEST_NAMESPACE}" \
${EXTRA_VALUES_FILES} \
-f "${VALUES_FILE}" \
${OPERATOR_OPTIONS} \
--wait
else
echo "Using --set flags approach"
${HELM} install ${PROJECT_DIR}/deployments/gpu-operator --generate-name \
${HELM} install "${HELM_CMD_ARGS[@]}" --generate-name \
-n "${TEST_NAMESPACE}" \
${OPERATOR_OPTIONS} \
${TOOLKIT_CONTAINER_OPTIONS} \
Expand Down
2 changes: 1 addition & 1 deletion tests/scripts/migrate-clusterpolicy-to-nvidiadriver.sh
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ if [[ -z "${operator_name}" ]]; then
fi

echo "Migrating Helm release/${operator_name} from ClusterPolicy driver management to NVIDIADriver"
${HELM} upgrade "${operator_name}" "${PROJECT_DIR}/deployments/gpu-operator" \
${HELM} upgrade "${operator_name}" "${HELM_CMD_ARGS[@]}" \
-n "${TEST_NAMESPACE}" \
--reuse-values \
${OPERATOR_OPTIONS:-} \
Expand Down
Loading