Skip to content

Commit 26d6ea4

Browse files
authored
Enable new CI runner and improve manifest e2e test scripts (#263)
Signed-off-by: Yingchun Guo <[email protected]>
1 parent 4250048 commit 26d6ea4

File tree

4 files changed

+35
-28
lines changed

4 files changed

+35
-28
lines changed

.github/workflows/E2E_test_with_compose.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ jobs:
3939
run: |
4040
set -xe
4141
merged_commit=$(git log -1 --format='%H')
42-
changed_files=$(git diff --name-only ${{ github.event.pull_request.base.sha }} ${merged_commit} | \
43-
grep -vE '.github|README.md|*.txt|deprecate|kubernetes|manifest')
42+
changed_files="$(git diff --name-only ${{ github.event.pull_request.base.sha }} ${merged_commit} | \
43+
grep -vE '.github|README.md|*.txt|deprecate|kubernetes|manifest')" || true
4444
examples=$(printf '%s\n' "${changed_files[@]}" | grep '/' | cut -d'/' -f1 | sort -u)
4545
run_matrix="{\"include\":["
4646
for example in ${examples}; do

.github/workflows/manifest-e2e.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
run: |
3737
set -xe
3838
changed_files="$(git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }} | \
39-
grep "/kubernetes/manifests/" | \
39+
grep -E "/kubernetes/manifests/|test_manifest" | \
4040
grep -vE '.github|deprecated|docker')" || true
4141
examples=$(printf '%s\n' "${changed_files[@]}" | grep '/' | cut -d'/' -f1 | sort -u)
4242
run_matrix="{\"include\":["
@@ -50,7 +50,7 @@ jobs:
5050
continue # skip gaudi for K8s test temporarily
5151
else
5252
#lower_example=$(echo "${example}" | tr '[:upper:]' '[:lower:]')
53-
run_matrix="${run_matrix}{\"example\":\"${example}\",\"hardware\":\"inspur-icx-1\"},"
53+
run_matrix="${run_matrix}{\"example\":\"${example}\",\"hardware\":\"k8s\"},"
5454
fi
5555
done
5656
done

ChatQnA/tests/test_manifest_on_xeon.sh

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@ function init_chatqna() {
1616
# replace the repository "image: opea/*" with "image: $IMAGE_REPO/opea/"
1717
find . -name '*.yaml' -type f -exec sed -i "s#image: opea/*#image: $IMAGE_REPO/opea/#g" {} \;
1818
# set huggingface token
19-
find . -name '*.yaml' -type f -exec sed -i "s#insert-your-huggingface-token-here#$(cat /home/$USER_ID/.cache/huggingface/token)#g" {} \;
19+
find . -name '*.yaml' -type f -exec sed -i "s#\${HUGGINGFACEHUB_API_TOKEN}#$(cat /home/$USER_ID/.cache/huggingface/token)#g" {} \;
2020
}
2121

2222
function install_chatqna {
2323
# replace namespace "default" with real namespace
24-
find . -name '*.yaml' -type f -exec sed -i "s#svc.default#svc.$NAMESPACE#g" {} \;
24+
find . -name '*.yaml' -type f -exec sed -i "s#default.svc#$NAMESPACE.svc#g" {} \;
2525
# for very yaml file in yaml_files, apply it to the k8s cluster
2626
yaml_files=("qna_configmap_xeon" "redis-vector-db" "tei_embedding_service" "tei_reranking_service" "tgi_service" "retriever" "embedding" "reranking" "llm")
2727
for yaml_file in ${yaml_files[@]}; do
@@ -43,28 +43,28 @@ function validate_chatqna() {
4343
-H 'Content-Type: application/json'; do sleep 10; done
4444

4545
# check megaservice works
46+
# generate a random logfile name to avoid conflict among multiple runners
47+
LOGFILE=$LOG_PATH/curlmega_$NAMESPACE.log
4648
curl http://chaqna-xeon-backend-server-svc.$NAMESPACE:8888/v1/chatqna -H "Content-Type: application/json" -d '{
47-
"messages": "What is the revenue of Nike in 2023?"}' > ${LOG_PATH}/curl_megaservice.log
49+
"messages": "What is the revenue of Nike in 2023?"}' > $LOGFILE
4850
exit_code=$?
4951
if [ $exit_code -ne 0 ]; then
50-
echo "Megaservice failed, please check the logs in ${LOG_PATH}!"
52+
echo "Megaservice failed, please check the logs in $LOGFILE!"
5153
exit 1
5254
fi
53-
echo "Response check succeed!"
5455

55-
# Temporarily disable response check
56-
# echo "Checking response results, make sure the output is reasonable. "
57-
# local status=false
58-
# if [[ -f $LOG_PATH/curl_megaservice.log ]] &&
59-
# [[ $(grep -c "algorithms" $LOG_PATH/curl_megaservice.log) != 0 ]]; then
60-
# status=true
61-
# fi
62-
# if [ $status == false ]; then
63-
# echo "Response check failed, please check the logs in artifacts!"
64-
# exit 1
65-
# else
66-
# echo "Response check succeed!"
67-
# fi
56+
echo "Checking response results, make sure the output is reasonable. "
57+
local status=false
58+
if [[ -f $LOGFILE ]] &&
59+
[[ $(grep -c "billion" $LOGFILE) != 0 ]]; then
60+
status=true
61+
fi
62+
if [ $status == false ]; then
63+
echo "Response check failed, please check the logs in artifacts!"
64+
exit 1
65+
else
66+
echo "Response check succeed!"
67+
fi
6868
}
6969

7070
if [ $# -eq 0 ]; then

CodeGen/tests/test_manifest_on_xeon.sh

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,22 @@ function validate_codegen() {
2828
ip_address=$(kubectl get svc $SERVICE_NAME -n $NAMESPACE -o jsonpath='{.spec.clusterIP}')
2929
port=$(kubectl get svc $SERVICE_NAME -n $NAMESPACE -o jsonpath='{.spec.ports[0].port}')
3030
echo "try to curl http://${ip_address}:${port}/v1/codegen..."
31+
32+
# generate a random logfile name to avoid conflict among multiple runners
33+
LOGFILE=$LOG_PATH/curlmega_$NAMESPACE.log
3134
# Curl the Mega Service
32-
curl http://${ip_address}:${port}/v1/codegen -H "Content-Type: application/json" -d '{
33-
"model": "ise-uiuc/Magicoder-S-DS-6.7B",
34-
"messages": "Implement a high-level API for a TODO list application. The API takes as input an operation request and updates the TODO list in place. If the request is invalid, raise an exception."}' > curl_megaservice.log
35+
curl http://${ip_address}:${port}/v1/codegen -H "Content-Type: application/json" \
36+
-d '{"messages": "def print_hello_world():"}' > $LOGFILE
37+
exit_code=$?
38+
if [ $exit_code -ne 0 ]; then
39+
echo "Megaservice codegen failed, please check the logs in $LOGFILE!"
40+
exit 1
41+
fi
3542

3643
echo "Checking response results, make sure the output is reasonable. "
37-
local status=true
38-
if [[ -f curl_megaservice.log ]] && \
39-
[[ $(grep -c "billion" curl_megaservice.log) != 0 ]]; then
44+
local status=false
45+
if [[ -f $LOGFILE ]] && \
46+
[[ $(grep -c "print" $LOGFILE) != 0 ]]; then
4047
status=true
4148
fi
4249

0 commit comments

Comments
 (0)