Skip to content

Commit 91021da

Browse files
committed
Move hami deploy_isolator.sh to hack/hami folder
Signed-off-by: dttung2905 <ttdao.2015@accountancy.smu.edu.sg>
1 parent ab2f2a7 commit 91021da

4 files changed

Lines changed: 42 additions & 10 deletions

File tree

hack/third_party_integrations/deploy_isolator.sh renamed to hack/hami/deploy_isolator.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
# Copyright 2026 NVIDIA CORPORATION
33
# SPDX-License-Identifier: Apache-2.0
44
#
5-
# Installs kai-resource-isolator with kai-vgpu-monitor enabled so hamicore e2e
6-
# can scrape hami_* per-container VRAM metrics on :9394.
5+
# Installs kai-resource-isolator with kai-vgpu-monitor enabled for HAMi/hamicore
6+
# e2e (see --test-hami in hack/setup-e2e-cluster.sh).
77
#
88
# Overrides (optional):
99
# ISOLATOR_CHART_REF OCI ref or local chart path

hack/run-e2e-kind.sh

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ GOBIN=${GOPATH}/bin
1111

1212
# Parse named parameters
1313
TEST_THIRD_PARTY_INTEGRATIONS="false"
14+
TEST_HAMI="false"
1415
LOCAL_IMAGES_BUILD="false"
1516
PRESERVE_CLUSTER="false"
1617

@@ -20,6 +21,10 @@ while [[ $# -gt 0 ]]; do
2021
TEST_THIRD_PARTY_INTEGRATIONS="true"
2122
shift
2223
;;
24+
--test-hami)
25+
TEST_HAMI="true"
26+
shift
27+
;;
2328
--local-images-build)
2429
LOCAL_IMAGES_BUILD="true"
2530
shift
@@ -29,8 +34,9 @@ while [[ $# -gt 0 ]]; do
2934
shift
3035
;;
3136
-h|--help)
32-
echo "Usage: $0 [--test-third-party-integrations] [--local-images-build] [--preserve-cluster]"
37+
echo "Usage: $0 [--test-third-party-integrations] [--test-hami] [--local-images-build] [--preserve-cluster]"
3338
echo " --test-third-party-integrations: Install third party operators for compatibility testing"
39+
echo " --test-hami: Enable HAMi/hamicore integration (binder hamicore plugin + kai-resource-isolator)"
3440
echo " --local-images-build: Build and use local images instead of pulling from registry"
3541
echo " --preserve-cluster: Keep the kind cluster after running the test suite"
3642
exit 0
@@ -48,6 +54,9 @@ SETUP_ARGS=""
4854
if [ "$TEST_THIRD_PARTY_INTEGRATIONS" = "true" ]; then
4955
SETUP_ARGS="$SETUP_ARGS --test-third-party-integrations"
5056
fi
57+
if [ "$TEST_HAMI" = "true" ]; then
58+
SETUP_ARGS="$SETUP_ARGS --test-hami"
59+
fi
5160
if [ "$LOCAL_IMAGES_BUILD" = "true" ]; then
5261
SETUP_ARGS="$SETUP_ARGS --local-images-build"
5362
fi

hack/setup-e2e-cluster.sh

Lines changed: 29 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ trap cleanup EXIT
3131

3232
# Parse named parameters
3333
TEST_THIRD_PARTY_INTEGRATIONS=${TEST_THIRD_PARTY_INTEGRATIONS:-"false"}
34+
TEST_HAMI=${TEST_HAMI:-"false"}
3435
LOCAL_IMAGES_BUILD=${LOCAL_IMAGES_BUILD:-"false"}
3536
INSTALL_VPA=${INSTALL_VPA:-"false"}
3637
SKIP_KAI_INSTALL=${SKIP_KAI_INSTALL:-"false"}
@@ -41,6 +42,10 @@ while [[ $# -gt 0 ]]; do
4142
TEST_THIRD_PARTY_INTEGRATIONS="true"
4243
shift
4344
;;
45+
--test-hami)
46+
TEST_HAMI="true"
47+
shift
48+
;;
4449
--local-images-build)
4550
LOCAL_IMAGES_BUILD="true"
4651
shift
@@ -62,8 +67,9 @@ while [[ $# -gt 0 ]]; do
6267
shift 2
6368
;;
6469
-h|--help)
65-
echo "Usage: $0 [--test-third-party-integrations] [--local-images-build] [--install-vpa] [--skip-kai-install] [--feature-config <config>] [--kind-config <path>]"
70+
echo "Usage: $0 [--test-third-party-integrations] [--test-hami] [--local-images-build] [--install-vpa] [--skip-kai-install] [--feature-config <config>] [--kind-config <path>]"
6671
echo " --test-third-party-integrations: Install third party operators for compatibility testing"
72+
echo " --test-hami: Enable HAMi/hamicore integration (binder hamicore plugin + kai-resource-isolator)"
6773
echo " --local-images-build: Build and use local images instead of pulling from registry"
6874
echo " --install-vpa: Install Vertical Pod Autoscaler and metrics-server"
6975
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,17 @@ while [[ $# -gt 0 ]]; do
7985
esac
8086
done
8187

88+
# Extra helm --set flags for HAMi/hamicore. Kind e2e has no nvidia RuntimeClass, so clear
89+
# the defaults that would otherwise reject GPU-fraction pods at admission.
90+
HAMI_HELM_SETS=()
91+
if [ "$TEST_HAMI" = "true" ]; then
92+
HAMI_HELM_SETS+=(
93+
--set "binder.plugins.hamicore.enabled=true"
94+
--set "binder.resourceReservation.runtimeClassName="
95+
--set "admission.gpuFractionRuntimeClassName="
96+
)
97+
fi
98+
8299
if [[ -n "$KIND_CONFIG" && "$FEATURE_CONFIG" != "default" ]]; then
83100
echo "--feature-config cannot be used together with --kind-config"
84101
exit 1
@@ -147,9 +164,6 @@ if [ "$TEST_THIRD_PARTY_INTEGRATIONS" = "true" ]; then
147164
${REPO_ROOT}/hack/third_party_integrations/deploy_knative.sh
148165
${REPO_ROOT}/hack/third_party_integrations/deploy_lws.sh
149166
${REPO_ROOT}/hack/third_party_integrations/deploy_jobset.sh
150-
# HAMi-core / GPU-sharing isolation + optional VRAM metrics (:9394).
151-
# Soft-gated in hamicore e2e when the webhook / monitor are absent.
152-
${REPO_ROOT}/hack/third_party_integrations/deploy_isolator.sh
153167
fi
154168

155169
# Build and install kai-scheduler
@@ -207,7 +221,8 @@ if [ "$LOCAL_IMAGES_BUILD" = "true" ]; then
207221
else
208222
helm upgrade -i kai-scheduler ./charts/kai-scheduler-$PACKAGE_VERSION.tgz -n kai-scheduler --create-namespace \
209223
--values ${REPO_ROOT}/hack/kai-scheduler-fake-npe-values.yaml \
210-
--set "global.gpuSharing=true" --set "global.registry=localhost:30100" --set "prometheus.enabled=true" --debug --wait
224+
--set "global.gpuSharing=true" --set "global.registry=localhost:30100" --set "prometheus.enabled=true" \
225+
"${HAMI_HELM_SETS[@]}" --debug --wait
211226
rm -rf ./charts/kai-scheduler-$PACKAGE_VERSION.tgz
212227
fi
213228
cd ${REPO_ROOT}/hack
@@ -216,7 +231,8 @@ elif [ "$SKIP_KAI_INSTALL" = "true" ]; then
216231
else
217232
helm upgrade -i kai-scheduler oci://ghcr.io/kai-scheduler/kai-scheduler/kai-scheduler -n kai-scheduler --create-namespace \
218233
--values ${REPO_ROOT}/hack/kai-scheduler-fake-npe-values.yaml \
219-
--set "global.gpuSharing=true" --set "prometheus.enabled=true" --wait --version "$PACKAGE_VERSION"
234+
--set "global.gpuSharing=true" --set "prometheus.enabled=true" \
235+
"${HAMI_HELM_SETS[@]}" --wait --version "$PACKAGE_VERSION"
220236
fi
221237

222238
if [ "$SKIP_KAI_INSTALL" != "true" ]; then
@@ -225,4 +241,11 @@ if [ "$SKIP_KAI_INSTALL" != "true" ]; then
225241
kubectl create rolebinding fake-status-updater --clusterrole=pods-patcher --serviceaccount=gpu-operator:status-updater -n kai-resource-reservation
226242
fi
227243

244+
# HAMi resource isolation (kai-resource-isolator). Deeper than third-party CRD
245+
# operators: paired with binder hamicore helm values above. Soft-gated in
246+
# hamicore e2e when the webhook / monitor are absent.
247+
if [ "$TEST_HAMI" = "true" ]; then
248+
${REPO_ROOT}/hack/hami/deploy_isolator.sh
249+
fi
250+
228251
echo "Cluster setup complete. Cluster name: $CLUSTER_NAME"

test/e2e/suites/integrations/third_party/hamicore/hamicore_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ var _ = Describe("HAMi-core resource isolation", Ordered, func() {
241241
if !isKaiVGPUMonitorInstalled(ctx, testCtx.KubeClientset) {
242242
Skip(fmt.Sprintf(
243243
"kai-vgpu-monitor DaemonSet %q not found in namespace %q; "+
244-
"install via hack/third_party_integrations/deploy_isolator.sh",
244+
"install via hack/hami/deploy_isolator.sh (--test-hami)",
245245
kaiVGPUMonitorDaemonSetName, kaiResourceIsolatorNamespace,
246246
))
247247
}

0 commit comments

Comments
 (0)