From b0bdc0b8a67f27659eb3996301515e5805c0ded0 Mon Sep 17 00:00:00 2001 From: Yingchun Guo Date: Mon, 27 May 2024 01:56:50 -0700 Subject: [PATCH] Improve charts integration test ci Signed-off-by: Yingchun Guo --- .../scripts/chart-integration/chart-test.sh | 17 ++++------------- .../workflows/scripts/chart-integration/lib.sh | 10 +++++++--- 2 files changed, 11 insertions(+), 16 deletions(-) diff --git a/.github/workflows/scripts/chart-integration/chart-test.sh b/.github/workflows/scripts/chart-integration/chart-test.sh index f7173a942..f312ade30 100755 --- a/.github/workflows/scripts/chart-integration/chart-test.sh +++ b/.github/workflows/scripts/chart-integration/chart-test.sh @@ -28,22 +28,13 @@ echo "Testing chart $CHART_NAME, init environment done!" echo "Testing chart $CHART_NAME, installing chart with helm..." if helm install --create-namespace --namespace $NAMESPACE --wait --timeout "$ROLLOUT_TIMEOUT_SECONDS" $RELEASE_NAME .; then echo "Testing chart $CHART_NAME, installing chart with helm done!" + return_code=0 else echo "Failed to install chart $CHART_NAME!" - exit 1 + return_code=1 fi -# step 3 Wait for pod ready -# echo "Testing chart $CHART_NAME, waiting for pod ready..." -# if kubectl rollout status deployment --namespace "$NAMESPACE" --timeout "$ROLLOUT_TIMEOUT_SECONDS"; then -# echo "Testing chart $CHART_NAME, waiting for pod ready done!" -# return_code=0 -# else -# echo "Timeout waiting for pods in namespace $NAMESPACE to be ready!" -# return_code=1 -# fi - -# step 4 Validate +# step 3 Validate # if return_code is 0, then validate, call validate_${CHART_NAME} if [ $return_code -eq 0 ]; then echo "Testing chart $CHART_NAME, validating..." @@ -58,7 +49,7 @@ if [ $return_code -eq 0 ]; then fi fi -# step 5 Clean up +# step 4 Clean up echo "Testing chart $CHART_NAME, cleaning up..." helm uninstall $RELEASE_NAME --namespace $NAMESPACE if ! kubectl delete ns $NAMESPACE --timeout=$KUBECTL_TIMEOUT_SECONDS; then diff --git a/.github/workflows/scripts/chart-integration/lib.sh b/.github/workflows/scripts/chart-integration/lib.sh index 1a0dde413..5810fb2c5 100644 --- a/.github/workflows/scripts/chart-integration/lib.sh +++ b/.github/workflows/scripts/chart-integration/lib.sh @@ -11,6 +11,8 @@ function init_codegen() { MODELNAME=OpenCodeInterpreter-DS-6.7B MODELID=$MODELREPO/$MODELNAME MODELDOWNLOADID=models--$MODELREPO--$MODELNAME + # IMAGE_REPO is $OPEA_IMAGE_REPO, or else "" + IMAGE_REPO=${OPEA_IMAGE_REPO:-openvino} ### PREPARE MODEL # check if the model is already downloaded @@ -28,15 +30,17 @@ function init_codegen() { fi ### CONFIG VALUES.YAML - # set image name to the CI images, replace opea/gen-ai-comps with amr-registry.caas.intel.com/aiops/opea-ci - sed -i "s#opea/gen-ai-comps#amr-registry.caas.intel.com/aiops/opea-ci#g" values.yaml + # insert a prefix before opea/.*, the prefix is IMAGE_REPO + sed -i "s#repository: opea/*#repository: $IMAGE_REPO/opea/#g" values.yaml # set huggingface token sed -i "s#insert-your-huggingface-token-here#$(cat /home/$USER_ID/.cache/huggingface/token)#g" values.yaml # replace the mount dir "Volume: *" with "Volume: $CHART_MOUNT" sed -i "s#volume: .*#volume: $CHART_MOUNT#g" values.yaml # replace the model ID with local dir name "data/$MODELNAME" if [ "$USE_MODELDOWNLOADID" = "False" ]; then - sed -i "s#modelId: .*#modelId: /data/$MODELNAME#g" values.yaml + sed -i "s#LLM_MODEL_ID: .*#LLM_MODEL_ID: /data/$MODELNAME#g" values.yaml + else + sed -i "s#LLM_MODEL_ID: .*#LLM_MODEL_ID: $MODELID#g" values.yaml fi }