Skip to content

Commit

Permalink
enable new CI runner
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 yongfengdu committed Jun 5, 2024
1 parent 20dce6b commit cff4ab2
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 50 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/chart-e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
if: always() && ${{ needs.job1.outputs.run_matrix.chart.length }} > 0
strategy:
matrix: ${{ fromJSON(needs.job1.outputs.run_matrix) }}
runs-on: inspur-icx-1
runs-on: k8s
continue-on-error: true
outputs:
should_cleanup: ${{ steps.set_boolean.outputs.should_cleanup }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/manifest-e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
continue # skip gaudi for K8s test temporarily
else
lower_example=$(echo "${example}" | tr '[:upper:]' '[:lower:]')
run_matrix="${run_matrix}{\"example\":\"${lower_example}\",\"hardware\":\"inspur-icx-1\"},"
run_matrix="${run_matrix}{\"example\":\"${lower_example}\",\"hardware\":\"k8s\"},"
fi
done
done
Expand Down
35 changes: 3 additions & 32 deletions .github/workflows/scripts/e2e/chart_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,47 +3,18 @@
# SPDX-License-Identifier: Apache-2.0

LOG_PATH=.

USER_ID=$(whoami)
CHART_MOUNT=/home/$USER_ID/charts-mnt
IMAGE_REPO=${OPEA_IMAGE_REPO:-amr-registry.caas.intel.com/aiops}
function init_codegen() {
# executed under path helm-charts/codegen
# init var
MODELREPO=m-a-p
MODELNAME=OpenCodeInterpreter-DS-6.7B
MODELID=$MODELREPO/$MODELNAME
MODELDOWNLOADID=models--$MODELREPO--$MODELNAME
# IMAGE_REPO is $OPEA_IMAGE_REPO, or else ""

### PREPARE MODEL
# check if the model is already downloaded
if [ -d "$CHART_MOUNT/$MODELDOWNLOADID" ]; then
echo "Model $MODELID already downloaded!"
USE_MODELDOWNLOADID=True
else
echo "Downloading model $MODELID..."
MODELDIR=$CHART_MOUNT/$MODELNAME
if [ ! -d "$MODELDIR" ]; then
mkdir -p $MODELDIR
fi
huggingface-cli download $MODELID --local-dir $MODELDIR --local-dir-use-symlinks False
USE_MODELDOWNLOADID=False
fi
# IMAGE_REPO is $OPEA_IMAGE_REPO, or else ""
IMAGE_REPO=${OPEA_IMAGE_REPO:-docker.io}

### CONFIG VALUES.YAML
function init_codegen() {
# 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#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
}

function init_chatqna() {
Expand Down
30 changes: 14 additions & 16 deletions .github/workflows/scripts/e2e/manifest_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ USER_ID=$(whoami)
LOG_PATH=/home/$(whoami)/logs
MOUNT_DIR=/home/$USER_ID/charts-mnt
# IMAGE_REPO is $OPEA_IMAGE_REPO, or else ""
IMAGE_REPO=${OPEA_IMAGE_REPO:-amr-registry.caas.intel.com/aiops}
IMAGE_REPO=${OPEA_IMAGE_REPO:-docker.io}

function init_codegen() {
# executed under path manifest/codegen/xeon
Expand Down Expand Up @@ -36,7 +36,7 @@ function init_chatqna() {

function install_chatqna {
# replace namespace "default" with real namespace
find . -name '*.yaml' -type f -exec sed -i "s#svc.default#svc.$NAMESPACE#g" {} \;
find . -name '*.yaml' -type f -exec sed -i "s#default.svc#$NAMESPACE.svc#g" {} \;
# for very yaml file in yaml_files, apply it to the k8s cluster
yaml_files=("qna_configmap_xeon" "redis-vector-db" "tei_embedding_service" "tei_reranking_service" "tgi_service" "retriever" "embedding" "reranking" "llm")
for yaml_file in ${yaml_files[@]}; do
Expand Down Expand Up @@ -88,22 +88,20 @@ function validate_chatqna() {
echo "Megaservice failed, please check the logs in ${LOG_PATH}!"
exit 1
fi
echo "Response check succeed!"

# Temporarily disable response check
# echo "Checking response results, make sure the output is reasonable. "
# local status=false
# if [[ -f $LOG_PATH/curl_megaservice.log ]] && \
# [[ $(grep -c "billion" $LOG_PATH/curl_megaservice.log) != 0 ]]; then
# status=true
# fi
echo "Checking response results, make sure the output is reasonable. "
local status=false
if [[ -f $LOG_PATH/curl_megaservice.log ]] && \
[[ $(grep -c "billion" $LOG_PATH/curl_megaservice.log) != 0 ]]; then
status=true
fi

# if [ $status == false ]; then
# echo "Response check failed, please check the logs in artifacts!"
# exit 1
# else
# echo "Response check succeed!"
# fi
if [ $status == false ]; then
echo "Response check failed, please check the logs in artifacts!"
exit 1
else
echo "Response check succeed!"
fi
}

if [ $# -eq 0 ]; then
Expand Down

0 comments on commit cff4ab2

Please sign in to comment.