Skip to content

Commit ae24e81

Browse files
daisy-ycguojfding
authored andcommitted
Improve charts integration test ci
Signed-off-by: Yingchun Guo <yingchun.guo@intel.com>
1 parent 7761677 commit ae24e81

File tree

2 files changed

+11
-16
lines changed

2 files changed

+11
-16
lines changed

.github/workflows/scripts/chart-integration/chart-test.sh

+4-13
Original file line numberDiff line numberDiff line change
@@ -28,22 +28,13 @@ echo "Testing chart $CHART_NAME, init environment done!"
2828
echo "Testing chart $CHART_NAME, installing chart with helm..."
2929
if helm install --create-namespace --namespace $NAMESPACE --wait --timeout "$ROLLOUT_TIMEOUT_SECONDS" $RELEASE_NAME .; then
3030
echo "Testing chart $CHART_NAME, installing chart with helm done!"
31+
return_code=0
3132
else
3233
echo "Failed to install chart $CHART_NAME!"
33-
exit 1
34+
return_code=1
3435
fi
3536

36-
# step 3 Wait for pod ready
37-
# echo "Testing chart $CHART_NAME, waiting for pod ready..."
38-
# if kubectl rollout status deployment --namespace "$NAMESPACE" --timeout "$ROLLOUT_TIMEOUT_SECONDS"; then
39-
# echo "Testing chart $CHART_NAME, waiting for pod ready done!"
40-
# return_code=0
41-
# else
42-
# echo "Timeout waiting for pods in namespace $NAMESPACE to be ready!"
43-
# return_code=1
44-
# fi
45-
46-
# step 4 Validate
37+
# step 3 Validate
4738
# if return_code is 0, then validate, call validate_${CHART_NAME}
4839
if [ $return_code -eq 0 ]; then
4940
echo "Testing chart $CHART_NAME, validating..."
@@ -58,7 +49,7 @@ if [ $return_code -eq 0 ]; then
5849
fi
5950
fi
6051

61-
# step 5 Clean up
52+
# step 4 Clean up
6253
echo "Testing chart $CHART_NAME, cleaning up..."
6354
helm uninstall $RELEASE_NAME --namespace $NAMESPACE
6455
if ! kubectl delete ns $NAMESPACE --timeout=$KUBECTL_TIMEOUT_SECONDS; then

.github/workflows/scripts/chart-integration/lib.sh

+7-3
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ function init_codegen() {
1111
MODELNAME=OpenCodeInterpreter-DS-6.7B
1212
MODELID=$MODELREPO/$MODELNAME
1313
MODELDOWNLOADID=models--$MODELREPO--$MODELNAME
14+
# IMAGE_REPO is $OPEA_IMAGE_REPO, or else ""
15+
IMAGE_REPO=${OPEA_IMAGE_REPO:-amr-registry.caas.intel.com/aiops}
1416

1517
### PREPARE MODEL
1618
# check if the model is already downloaded
@@ -28,15 +30,17 @@ function init_codegen() {
2830
fi
2931

3032
### CONFIG VALUES.YAML
31-
# set image name to the CI images, replace opea/gen-ai-comps with amr-registry.caas.intel.com/aiops/opea-ci
32-
sed -i "s#opea/gen-ai-comps#amr-registry.caas.intel.com/aiops/opea-ci#g" values.yaml
33+
# insert a prefix before opea/.*, the prefix is IMAGE_REPO
34+
sed -i "s#repository: opea/*#repository: $IMAGE_REPO/opea/#g" values.yaml
3335
# set huggingface token
3436
sed -i "s#insert-your-huggingface-token-here#$(cat /home/$USER_ID/.cache/huggingface/token)#g" values.yaml
3537
# replace the mount dir "Volume: *" with "Volume: $CHART_MOUNT"
3638
sed -i "s#volume: .*#volume: $CHART_MOUNT#g" values.yaml
3739
# replace the model ID with local dir name "data/$MODELNAME"
3840
if [ "$USE_MODELDOWNLOADID" = "False" ]; then
39-
sed -i "s#modelId: .*#modelId: /data/$MODELNAME#g" values.yaml
41+
sed -i "s#LLM_MODEL_ID: .*#LLM_MODEL_ID: /data/$MODELNAME#g" values.yaml
42+
else
43+
sed -i "s#LLM_MODEL_ID: .*#LLM_MODEL_ID: $MODELID#g" values.yaml
4044
fi
4145
}
4246

0 commit comments

Comments
 (0)