-
Notifications
You must be signed in to change notification settings - Fork 251
feat(e2e): Under testing kai hack deployments, Add hami testing option, installing kai-resource-isolator #2033
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| #!/bin/bash | ||
| # Copyright 2026 NVIDIA CORPORATION | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
| # | ||
| # Installs kai-resource-isolator with kai-vgpu-monitor enabled for HAMi/hamicore | ||
| # e2e (see --test-hami in hack/setup-e2e-cluster.sh). | ||
| # | ||
| # Overrides (optional): | ||
| # ISOLATOR_CHART_REF OCI ref or local chart path | ||
| # (default: oci://docker.io/projecthami/kai-resource-isolator) | ||
| # ISOLATOR_CHART_VERSION Chart version when using OCI (default: 1.1.0-chart) | ||
| # ISOLATOR_NAMESPACE Install namespace (default: kai-resource-isolator) | ||
| # ISOLATOR_RELEASE Helm release name (default: kai-resource-isolator) | ||
| # ISOLATOR_HELM_EXTRA_ARGS Extra args appended to helm upgrade (word-split) | ||
| set -euo pipefail | ||
|
|
||
| ISOLATOR_CHART_REF="${ISOLATOR_CHART_REF:-oci://docker.io/projecthami/kai-resource-isolator}" | ||
| ISOLATOR_CHART_VERSION="${ISOLATOR_CHART_VERSION:-1.1.0-chart}" | ||
| ISOLATOR_NAMESPACE="${ISOLATOR_NAMESPACE:-kai-resource-isolator}" | ||
| ISOLATOR_RELEASE="${ISOLATOR_RELEASE:-kai-resource-isolator}" | ||
|
|
||
| HELM_ARGS=( | ||
| upgrade --install "${ISOLATOR_RELEASE}" "${ISOLATOR_CHART_REF}" | ||
| --namespace "${ISOLATOR_NAMESPACE}" | ||
| --create-namespace | ||
| --set monitor.enabled=true | ||
| --wait | ||
| --timeout 5m | ||
| ) | ||
|
|
||
| # --version only applies to OCI/repo charts, not a local filesystem chart path. | ||
| if [[ "${ISOLATOR_CHART_REF}" == oci://* ]] || [[ "${ISOLATOR_CHART_REF}" == *://* ]]; then | ||
| HELM_ARGS+=(--version "${ISOLATOR_CHART_VERSION}") | ||
| fi | ||
|
|
||
| # shellcheck disable=SC2206 | ||
| if [[ -n "${ISOLATOR_HELM_EXTRA_ARGS:-}" ]]; then | ||
| EXTRA=( ${ISOLATOR_HELM_EXTRA_ARGS} ) | ||
| HELM_ARGS+=("${EXTRA[@]}") | ||
| fi | ||
|
|
||
| echo "Installing kai-resource-isolator from ${ISOLATOR_CHART_REF} (monitor.enabled=true)..." | ||
| helm "${HELM_ARGS[@]}" | ||
|
|
||
| echo "Waiting for isolator webhook deployment..." | ||
| kubectl -n "${ISOLATOR_NAMESPACE}" rollout status \ | ||
| "deployment/${ISOLATOR_RELEASE}-webhook" --timeout=180s | ||
|
|
||
| echo "kai-resource-isolator installed (mutating webhook + monitor chart resources)." | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -31,6 +31,7 @@ trap cleanup EXIT | |
|
|
||
| # Parse named parameters | ||
| TEST_THIRD_PARTY_INTEGRATIONS=${TEST_THIRD_PARTY_INTEGRATIONS:-"false"} | ||
| TEST_HAMI=${TEST_HAMI:-"false"} | ||
| LOCAL_IMAGES_BUILD=${LOCAL_IMAGES_BUILD:-"false"} | ||
| INSTALL_VPA=${INSTALL_VPA:-"false"} | ||
| SKIP_KAI_INSTALL=${SKIP_KAI_INSTALL:-"false"} | ||
|
|
@@ -41,6 +42,10 @@ while [[ $# -gt 0 ]]; do | |
| TEST_THIRD_PARTY_INTEGRATIONS="true" | ||
| shift | ||
| ;; | ||
| --test-hami) | ||
| TEST_HAMI="true" | ||
| shift | ||
| ;; | ||
| --local-images-build) | ||
| LOCAL_IMAGES_BUILD="true" | ||
| shift | ||
|
|
@@ -62,8 +67,9 @@ while [[ $# -gt 0 ]]; do | |
| shift 2 | ||
| ;; | ||
| -h|--help) | ||
| echo "Usage: $0 [--test-third-party-integrations] [--local-images-build] [--install-vpa] [--skip-kai-install] [--feature-config <config>] [--kind-config <path>]" | ||
| echo "Usage: $0 [--test-third-party-integrations] [--test-hami] [--local-images-build] [--install-vpa] [--skip-kai-install] [--feature-config <config>] [--kind-config <path>]" | ||
| echo " --test-third-party-integrations: Install third party operators for compatibility testing" | ||
| echo " --test-hami: Enable HAMi/hamicore integration (binder hamicore plugin + kai-resource-isolator)" | ||
| echo " --local-images-build: Build and use local images instead of pulling from registry" | ||
| echo " --install-vpa: Install Vertical Pod Autoscaler and metrics-server" | ||
| echo " --skip-kai-install: Prepare the cluster (and images/chart with --local-images-build) without installing KAI (e.g. for gitops e2e tests)" | ||
|
|
@@ -79,6 +85,14 @@ while [[ $# -gt 0 ]]; do | |
| esac | ||
| done | ||
|
|
||
| # Extra helm --set flags for HAMi/hamicore when --test-hami is set. | ||
| HAMI_HELM_SETS=() | ||
| if [ "$TEST_HAMI" = "true" ]; then | ||
| HAMI_HELM_SETS+=( | ||
| --set "binder.plugins.hamicore.enabled=true" | ||
| ) | ||
| fi | ||
|
|
||
| if [[ -n "$KIND_CONFIG" && "$FEATURE_CONFIG" != "default" ]]; then | ||
| echo "--feature-config cannot be used together with --kind-config" | ||
| exit 1 | ||
|
|
@@ -204,7 +218,8 @@ if [ "$LOCAL_IMAGES_BUILD" = "true" ]; then | |
| else | ||
| helm upgrade -i kai-scheduler ./charts/kai-scheduler-$PACKAGE_VERSION.tgz -n kai-scheduler --create-namespace \ | ||
| --values ${REPO_ROOT}/hack/kai-scheduler-fake-npe-values.yaml \ | ||
| --set "global.gpuSharing=true" --set "global.registry=localhost:30100" --set "prometheus.enabled=true" --debug --wait | ||
| --set "global.gpuSharing=true" --set "global.registry=localhost:30100" --set "prometheus.enabled=true" \ | ||
| "${HAMI_HELM_SETS[@]}" --debug --wait | ||
| rm -rf ./charts/kai-scheduler-$PACKAGE_VERSION.tgz | ||
| fi | ||
| cd ${REPO_ROOT}/hack | ||
|
|
@@ -213,7 +228,8 @@ elif [ "$SKIP_KAI_INSTALL" = "true" ]; then | |
| else | ||
| helm upgrade -i kai-scheduler oci://ghcr.io/kai-scheduler/kai-scheduler/kai-scheduler -n kai-scheduler --create-namespace \ | ||
| --values ${REPO_ROOT}/hack/kai-scheduler-fake-npe-values.yaml \ | ||
| --set "global.gpuSharing=true" --set "prometheus.enabled=true" --wait --version "$PACKAGE_VERSION" | ||
| --set "global.gpuSharing=true" --set "prometheus.enabled=true" \ | ||
| "${HAMI_HELM_SETS[@]}" --wait --version "$PACKAGE_VERSION" | ||
| fi | ||
|
|
||
| if [ "$SKIP_KAI_INSTALL" != "true" ]; then | ||
|
|
@@ -222,4 +238,11 @@ if [ "$SKIP_KAI_INSTALL" != "true" ]; then | |
| kubectl create rolebinding fake-status-updater --clusterrole=pods-patcher --serviceaccount=gpu-operator:status-updater -n kai-resource-reservation | ||
| fi | ||
|
|
||
| # HAMi resource isolation (kai-resource-isolator). Deeper than third-party CRD | ||
| # operators: paired with binder hamicore helm values above. Soft-gated in | ||
| # hamicore e2e when the webhook / monitor are absent. | ||
| if [ "$TEST_HAMI" = "true" ]; then | ||
| ${REPO_ROOT}/hack/hami/deploy_isolator.sh | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. dont see --test-hami wired into ci yet. so hamicore e2e still skips in ci for now, right?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, I intentionally not wired into CI for now. Wiring them to CI will make the e2e failed because we are running against fake GPU, not real one |
||
| fi | ||
|
|
||
| echo "Cluster setup complete. Cluster name: $CLUSTER_NAME" | ||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
chart.yaml on main is still 0.1.0, not 1.1.0-chart. needs a bump after isolator pr 22 merges?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes you are right. PR 22 needs to be merged first. I will then update the chart number