Skip to content

Commit

Permalink
Fix CHART_MOUNT and HFTOKEN for CI
Browse files Browse the repository at this point in the history
Signed-off-by: Dolpher Du <[email protected]>
  • Loading branch information
yongfengdu authored and leslieluyu committed Jul 19, 2024
1 parent f6354b9 commit 10b908a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/chart-e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,14 @@ jobs:
run: |
# .github/workflows/scripts/e2e/chart_test.sh init_value
# Replace values for CI test environment
USER_ID=$(whoami)
CHART_MOUNT=/home/$USER_ID/.cache/huggingface/hub
HFTOKEN=$(cat /home/$USER_ID/.cache/huggingface/token)
pushd helm-charts
# insert a prefix before opea/.*, the prefix is OPEA_IMAGE_REPO
find . -name '*values.yaml' -type f -exec sed -i "s#repository: opea/*#repository: ${OPEA_IMAGE_REPO}opea/#g" {} \;
# set huggingface token
find . -name '*values.yaml' -type f -exec sed -i "s#insert-your-huggingface-token-here#$(cat /home/$USER_ID/.cache/huggingface/token)#g" {} \;
find . -name '*values.yaml' -type f -exec sed -i "s#insert-your-huggingface-token-here#${HFTOKEN}#g" {} \;
# replace the mount dir "Volume: *" with "Volume: $CHART_MOUNT"
find . -name '*values.yaml' -type f -exec sed -i "s#modelUseHostPath: .*#modelUseHostPath: $CHART_MOUNT#g" {} \;
# replace the pull policy "IfNotPresent" with "Always"
Expand Down Expand Up @@ -142,7 +145,7 @@ jobs:
# .github/workflows/scripts/e2e/chart_test.sh validate_${{ matrix.example }} $RELEASE_NAME $NAMESPACE
LOG_PATH=/home/$(whoami)/logs
chart=${{ matrix.example }}
helm test -n $NAMESPACE $RELEASE_NAME --logs > ${LOG_PATH}/charts-${chart}.log
helm test -n $NAMESPACE $RELEASE_NAME --logs |tee ${LOG_PATH}/charts-${chart}.log
exit_code=$?
if [ $exit_code -ne 0 ]; then
echo "Chart ${chart} test failed, please check the logs in ${LOG_PATH}!"
Expand Down

0 comments on commit 10b908a

Please sign in to comment.