Skip to content

Commit

Permalink
Improve charts integration test ci
Browse files Browse the repository at this point in the history
Signed-off-by: Yingchun Guo <[email protected]>
  • Loading branch information
daisy-ycguo authored and jfding committed May 27, 2024
1 parent 7761677 commit ae24e81
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 16 deletions.
17 changes: 4 additions & 13 deletions .github/workflows/scripts/chart-integration/chart-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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..."
Expand All @@ -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
Expand Down
10 changes: 7 additions & 3 deletions .github/workflows/scripts/chart-integration/lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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:-amr-registry.caas.intel.com/aiops}

### PREPARE MODEL
# check if the model is already downloaded
Expand All @@ -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
}

Expand Down

0 comments on commit ae24e81

Please sign in to comment.