@@ -47,16 +47,34 @@ jobs:
4747 cut -d'/' -f3 | sort -u )
4848 run_matrix="{\"include\":["
4949 for chart in ${e2e_charts}; do
50- if [ -f $CHARTS_DIR/$chart/gaudi-values.yaml ]; then
51- run_matrix="${run_matrix}{\"example\":\"${chart}\",\"hardware\":\"gaudi\"},"
52- fi
53- run_matrix="${run_matrix}{\"example\":\"${chart}\",\"hardware\":\"xeon\"},"
50+ for file in "$CHARTS_DIR/$chart"/*values.yaml; do
51+ if [ -f "$file" ]; then
52+ if [[ "$file" == *"nv-values.yaml" ]]; then
53+ continue
54+ fi
55+ filename=$(basename "$file" .yaml)
56+ if [[ "$filename" == *"gaudi"* ]]; then
57+ run_matrix="${run_matrix}{\"example\":\"${chart}\",\"hardware\":\"gaudi\", \"valuefile\":\"${filename}\"},"
58+ else
59+ run_matrix="${run_matrix}{\"example\":\"${chart}\",\"hardware\":\"xeon\", \"valuefile\":\"${filename}\"},"
60+ fi
61+ fi
62+ done
5463 done
5564 for chart in ${common_charts}; do
56- if [ -f $CHARTS_DIR/common/$chart/gaudi-values.yaml ]; then
57- run_matrix="${run_matrix}{\"example\":\"${chart}\",\"hardware\":\"gaudi\",\"directory\":\"common\"},"
58- fi
59- run_matrix="${run_matrix}{\"example\":\"${chart}\",\"hardware\":\"xeon\",\"directory\":\"common\"},"
65+ for file in "$CHARTS_DIR/common/$chart"/*values.yaml; do
66+ if [ -f "$file" ]; then
67+ if [[ "$file" == *"nv-values.yaml" ]]; then
68+ continue
69+ fi
70+ filename=$(basename "$file" .yaml)
71+ if [[ "$filename" == *"gaudi"* ]]; then
72+ run_matrix="${run_matrix}{\"example\":\"${chart}\",\"hardware\":\"gaudi\", \"valuefile\":\"${filename}\",\"directory\":\"common\"},"
73+ else
74+ run_matrix="${run_matrix}{\"example\":\"${chart}\",\"hardware\":\"xeon\", \"valuefile\":\"${filename}\",\"directory\":\"common\"},"
75+ fi
76+ fi
77+ done
6078 done
6179 run_matrix=$run_matrix"]}"
6280 echo "run_matrix=${run_matrix}"
@@ -71,134 +89,5 @@ jobs:
7189 with :
7290 workload : ${{ matrix.directory }}/${{ matrix.example }}
7391 hardware : ${{ matrix.hardware }}
74- # tag: ${{ needs.image-build.outputs.image_tag }}
75- # opea-branch: "main"
92+ valuefile : ${{ matrix.valuefile }}
7693 secrets : inherit
77-
78- # needs: job1
79- # if: always() && ${{ needs.job1.outputs.run_matrix.example.length }} > 0
80- # strategy:
81- # matrix: ${{ fromJSON(needs.job1.outputs.run_matrix) }}
82- # runs-on: ${{ matrix.hardware }}
83- # continue-on-error: true
84- # outputs:
85- # should_cleanup: ${{ steps.set_boolean.outputs.should_cleanup }}
86- # steps:
87- # - name: E2e test chart
88- # run: |
89- # echo "Matrix - chart: ${{ matrix.example }}"
90-
91- # - name: Clean Up Working Directory
92- # run: sudo rm -rf ${{github.workspace}}/*
93-
94- # - name: Checkout out Repo
95- # uses: actions/checkout@v4
96- # with:
97- # ref: "refs/pull/${{ github.event.number }}/merge"
98-
99- # - name: Set variables
100- # run: |
101- # echo "RELEASE_NAME=${{ matrix.example }}$(date +%Y%m%d%H%M%S)" >> $GITHUB_ENV
102- # echo "NAMESPACE=${{ matrix.example }}-$(date +%Y%m%d%H%M%S)" >> $GITHUB_ENV
103- # echo "ROLLOUT_TIMEOUT_SECONDS=600s" >> $GITHUB_ENV
104- # echo "KUBECTL_TIMEOUT_SECONDS=60s" >> $GITHUB_ENV
105- # echo "should_cleanup=false" >> $GITHUB_ENV
106- # echo "skip_validate=false" >> $GITHUB_ENV
107- # echo "RELEASENAME=$RELEASE_NAME"
108- # echo "NAMESPACE=$NAMESPACE"
109- # if [ -n "${{ matrix.directory }}" ]; then
110- # echo "CHART_FOLDER=$CHARTS_DIR/${{ matrix.directory }}/${{ matrix.example }}" >> $GITHUB_ENV
111- # else
112- # echo "CHART_FOLDER=$CHARTS_DIR/${{ matrix.example }}" >> $GITHUB_ENV
113- # fi
114-
115- # - name: Initialize chart testing
116- # run: |
117- # # Replace values for CI test environment
118- # USER_ID=$(whoami)
119- # CHART_MOUNT=/home/$USER_ID/.cache/huggingface/hub
120- # HFTOKEN=$(cat /home/$USER_ID/.cache/huggingface/token)
121- # pushd helm-charts
122- # # insert a prefix before opea/.*, the prefix is OPEA_IMAGE_REPO
123- # find . -name '*values.yaml' -type f -exec sed -i "s#repository: opea/*#repository: ${OPEA_IMAGE_REPO}opea/#g" {} \;
124- # # set OPEA image tag to latest
125- # find . -name '*values.yaml' -type f -exec sed -i 's#tag: ""#tag: latest#g' {} \;
126- # # set huggingface token
127- # find . -name '*values.yaml' -type f -exec sed -i "s#insert-your-huggingface-token-here#${HFTOKEN}#g" {} \;
128- # # replace the mount dir "Volume: *" with "Volume: $CHART_MOUNT"
129- # find . -name '*values.yaml' -type f -exec sed -i "s#modelUseHostPath: .*#modelUseHostPath: $CHART_MOUNT#g" {} \;
130- # # replace the pull policy "IfNotPresent" with "Always"
131- # find . -name '*values.yaml' -type f -exec sed -i "s#pullPolicy: IfNotPresent#pullPolicy: Always#g" {} \;
132- # popd
133-
134- # - name: Helm install
135- # id: install
136- # env:
137- # GOOGLE_CSE_ID: ${{ secrets.GOOGLE_CSE_ID }}
138- # GOOGLE_API_KEY: ${{ secrets.GOOGLE_API_KEY }}
139- # run: |
140- # set -xe
141- # echo "should_cleanup=true" >> $GITHUB_ENV
142- # helm-charts/update_dependency.sh && helm dependency update ${{ env.CHART_FOLDER}}
143- # value_file="values.yaml"
144- # if [ "${{ matrix.hardware }}" == "gaudi" ]; then
145- # value_file="gaudi-values.yaml"
146- # fi
147- # if ! helm install --create-namespace --namespace $NAMESPACE --wait \
148- # --timeout "$ROLLOUT_TIMEOUT_SECONDS" \
149- # --set autodependency.enabled=true \
150- # --set GOOGLE_API_KEY=${{ env.GOOGLE_API_KEY}} \
151- # --set GOOGLE_CSE_ID=${{ env.GOOGLE_CSE_ID}} \
152- # --values ${{ env.CHART_FOLDER}}/${value_file} \
153- # $RELEASE_NAME ${{ env.CHART_FOLDER}} ; then
154- # echo "Failed to install chart ${{ matrix.example }}"
155- # echo "skip_validate=true" >> $GITHUB_ENV
156- # .github/workflows/scripts/e2e/chart_test.sh dump_pods_status $NAMESPACE
157- # exit 1
158- # fi
159-
160- # - name: Validate e2e test
161- # if: always()
162- # run: |
163- # set -xe
164- # if $skip_validate; then
165- # echo "Skip validate"
166- # else
167- # LOG_PATH=/home/$(whoami)/logs
168- # chart=${{ matrix.example }}
169- # helm test -n $NAMESPACE $RELEASE_NAME --logs |tee ${LOG_PATH}/charts-${chart}.log
170- # exit_code=$?
171- # if [ $exit_code -ne 0 ]; then
172- # echo "Chart ${chart} test failed, please check the logs in ${LOG_PATH}!"
173- # exit 1
174- # fi
175-
176- # echo "Checking response results, make sure the output is reasonable. "
177- # teststatus=false
178- # if [[ -f $LOG_PATH/charts-${chart}.log ]] && \
179- # [[ $(grep -c "^Phase:.*Failed" $LOG_PATH/charts-${chart}.log) != 0 ]]; then
180- # teststatus=false
181- # .github/workflows/scripts/e2e/chart_test.sh dump_all_pod_logs $NAMESPACE
182- # else
183- # teststatus=true
184- # fi
185-
186- # if [ $teststatus == false ]; then
187- # echo "Response check failed, please check the logs in artifacts!"
188- # exit 1
189- # else
190- # echo "Response check succeed!"
191- # exit 0
192- # fi
193- # fi
194-
195- # - name: Helm uninstall
196- # if: always()
197- # run: |
198- # if $should_cleanup; then
199- # helm uninstall $RELEASE_NAME --namespace $NAMESPACE
200- # if ! kubectl delete ns $NAMESPACE --timeout=$KUBECTL_TIMEOUT_SECONDS; then
201- # kubectl delete pods --namespace $NAMESPACE --force --grace-period=0 --all
202- # kubectl delete ns $NAMESPACE --force --grace-period=0 --timeout=$KUBECTL_TIMEOUT_SECONDS
203- # fi
204- # fi
0 commit comments