@@ -10,11 +10,33 @@ KIND_CONFIG=${REPO_ROOT}/hack/e2e-kind-config.yaml
1010GOPATH=${HOME} /go
1111GOBIN=${GOPATH} /bin
1212
13- TEST_THIRD_PARTY_INTEGRATIONS=${1}
14- if [ -z " $TEST_THIRD_PARTY_INTEGRATIONS " ]; then
15- echo " TEST_THIRD_PARTY_INTEGRATIONS argument isn't provided, defaulting to false"
16- TEST_THIRD_PARTY_INTEGRATIONS=" false"
17- fi
13+ # Parse named parameters
14+ TEST_THIRD_PARTY_INTEGRATIONS=" false"
15+ LOCAL_IMAGES_BUILD=" false"
16+
17+ while [[ $# -gt 0 ]]; do
18+ case $1 in
19+ --test-third-party-integrations)
20+ TEST_THIRD_PARTY_INTEGRATIONS=" true"
21+ shift
22+ ;;
23+ --local-images-build)
24+ LOCAL_IMAGES_BUILD=" true"
25+ shift
26+ ;;
27+ -h|--help)
28+ echo " Usage: $0 [--test-third-party-integrations] [--local-images-build]"
29+ echo " --test-third-party-integrations: Install third party operators for compatibility testing"
30+ echo " --local-images-build: Build and use local images instead of pulling from registry"
31+ exit 0
32+ ;;
33+ * )
34+ echo " Unknown option $1 "
35+ echo " Use --help for usage information"
36+ exit 1
37+ ;;
38+ esac
39+ done
1840
1941kind create cluster --config ${KIND_CONFIG} --name $CLUSTER_NAME
2042
@@ -28,8 +50,21 @@ if [ "$TEST_THIRD_PARTY_INTEGRATIONS" = "true" ]; then
2850 ${REPO_ROOT} /hack/third_party_integrations/deploy_knative.sh
2951fi
3052
31- PACKAGE_VERSION=0.0.0-$( git rev-parse --short origin/main)
32- helm upgrade -i kai-scheduler oci://ghcr.io/nvidia/kai-scheduler/kai-scheduler -n kai-scheduler --create-namespace --set " global.gpuSharing=true" --version " $PACKAGE_VERSION "
53+ if [ " $LOCAL_IMAGES_BUILD " = " true" ]; then
54+ cd ${REPO_ROOT}
55+ PACKAGE_VERSION=0.0.0-$( git rev-parse --short HEAD)
56+ make build VERSION=$PACKAGE_VERSION
57+ for image in $( docker images --format ' {{.Repository}}:{{.Tag}}' | grep $PACKAGE_VERSION ) ; do
58+ kind load docker-image $image --name $CLUSTER_NAME
59+ done
60+ helm package ./deployments/kai-scheduler -d ./charts --app-version $PACKAGE_VERSION --version $PACKAGE_VERSION
61+ helm upgrade -i kai-scheduler ./charts/kai-scheduler-$PACKAGE_VERSION .tgz -n kai-scheduler --create-namespace --set " global.gpuSharing=true" --wait
62+ rm -rf ./charts/kai-scheduler-$PACKAGE_VERSION .tgz
63+ cd ${REPO_ROOT} /hack
64+ else
65+ PACKAGE_VERSION=0.0.0-$( git rev-parse --short origin/main)
66+ helm upgrade -i kai-scheduler oci://ghcr.io/nvidia/kai-scheduler/kai-scheduler -n kai-scheduler --create-namespace --set " global.gpuSharing=true" --version " $PACKAGE_VERSION "
67+ fi
3368
3469# Allow all the pods in the fake-gpu-operator and kai-scheduler to start
3570sleep 30
0 commit comments