Skip to content

Commit 326a637

Browse files
authored
restructure the directory of config sample and update the e2e test. (#351)
Signed-off-by: zhlsunshine <[email protected]>
1 parent 182183e commit 326a637

22 files changed

+65
-65
lines changed

.github/workflows/scripts/e2e/gmc_gaudi_test.sh

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ function validate_gmc() {
5555
function validate_webhook() {
5656
kubectl create ns $WEBHOOK_NAMESPACE || echo "namespace $WEBHOOK_NAMESPACE is created."
5757
# validate root node existence
58-
yq ".spec.nodes.node123 = .spec.nodes.root | del(.spec.nodes.root)" config/samples/chatQnA_xeon.yaml > /tmp/webhook-case1.yaml
58+
yq ".spec.nodes.node123 = .spec.nodes.root | del(.spec.nodes.root)" config/samples/ChatQnA/chatQnA_xeon.yaml > /tmp/webhook-case1.yaml
5959
sed -i "s|namespace: chatqa|namespace: $WEBHOOK_NAMESPACE|g" /tmp/webhook-case1.yaml
6060
output=$(! kubectl apply -f /tmp/webhook-case1.yaml 2>&1)
6161
if ! (echo $output | grep -q "a root node is required"); then
@@ -65,7 +65,7 @@ function validate_webhook() {
6565
fi
6666

6767
# StepName validation
68-
yq '(.spec.nodes.root.steps[] | select ( .name == "Llm")).name = "xyz"' config/samples/chatQnA_gaudi.yaml > /tmp/webhook-case2.yaml
68+
yq '(.spec.nodes.root.steps[] | select ( .name == "Llm")).name = "xyz"' config/samples/ChatQnA/chatQnA_gaudi.yaml > /tmp/webhook-case2.yaml
6969
sed -i "s|namespace: chatqa|namespace: $WEBHOOK_NAMESPACE|g" /tmp/webhook-case2.yaml
7070
output=$(! kubectl apply -f /tmp/webhook-case2.yaml 2>&1)
7171
if ! (echo $output | grep -q "invalid step name"); then
@@ -75,7 +75,7 @@ function validate_webhook() {
7575
fi
7676

7777
# nodeName existence
78-
yq '(.spec.nodes.root.steps[] | select ( .name == "Embedding")).nodeName = "node123"' config/samples/chatQnA_switch_xeon.yaml > /tmp/webhook-case3.yaml
78+
yq '(.spec.nodes.root.steps[] | select ( .name == "Embedding")).nodeName = "node123"' config/samples/ChatQnA/chatQnA_switch_xeon.yaml > /tmp/webhook-case3.yaml
7979
sed -i "s|namespace: switch|namespace: $WEBHOOK_NAMESPACE|g" /tmp/webhook-case3.yaml
8080
output=$(! kubectl apply -f /tmp/webhook-case3.yaml 2>&1)
8181
if ! (echo $output | grep -q "node name: node123 in step Embedding does not exist"); then
@@ -85,7 +85,7 @@ function validate_webhook() {
8585
fi
8686

8787
# serviceName uniqueness
88-
yq '(.spec.nodes.node1.steps[] | select ( .name == "Embedding")).internalService.serviceName = "tei-embedding-svc-bge15"' config/samples/chatQnA_switch_xeon.yaml > /tmp/webhook-case4.yaml
88+
yq '(.spec.nodes.node1.steps[] | select ( .name == "Embedding")).internalService.serviceName = "tei-embedding-svc-bge15"' config/samples/ChatQnA/chatQnA_switch_xeon.yaml > /tmp/webhook-case4.yaml
8989
sed -i "s|namespace: switch|namespace: $WEBHOOK_NAMESPACE|g" /tmp/webhook-case4.yaml
9090
output=$(! kubectl apply -f /tmp/webhook-case4.yaml 2>&1)
9191
if ! (echo $output | grep -q "service name: tei-embedding-svc-bge15 in node node1 already exists"); then
@@ -114,8 +114,8 @@ function cleanup_apps() {
114114

115115
function validate_audioqa() {
116116
kubectl create ns $AUDIOQA_NAMESPACE
117-
sed -i "s|namespace: audioqa|namespace: $AUDIOQA_NAMESPACE|g" $(pwd)/config/samples/audioQnA_gaudi.yaml
118-
kubectl apply -f $(pwd)/config/samples/audioQnA_gaudi.yaml
117+
sed -i "s|namespace: audioqa|namespace: $AUDIOQA_NAMESPACE|g" $(pwd)/config/samples/AudioQnA/audioQnA_gaudi.yaml
118+
kubectl apply -f $(pwd)/config/samples/AudioQnA/audioQnA_gaudi.yaml
119119

120120
# Wait until the router service is ready
121121
echo "Waiting for the audioqa router service to be ready..."
@@ -165,8 +165,8 @@ function validate_audioqa() {
165165

166166
function validate_chatqna() {
167167
kubectl create ns $CHATQNA_NAMESPACE
168-
sed -i "s|namespace: chatqa|namespace: $CHATQNA_NAMESPACE|g" $(pwd)/config/samples/chatQnA_gaudi.yaml
169-
kubectl apply -f $(pwd)/config/samples/chatQnA_gaudi.yaml
168+
sed -i "s|namespace: chatqa|namespace: $CHATQNA_NAMESPACE|g" $(pwd)/config/samples/ChatQnA/chatQnA_gaudi.yaml
169+
kubectl apply -f $(pwd)/config/samples/ChatQnA/chatQnA_gaudi.yaml
170170

171171
# Wait until the router service is ready
172172
echo "Waiting for the chatqa router service to be ready..."
@@ -233,10 +233,10 @@ function validate_chatqna() {
233233

234234
function validate_chatqna_with_dataprep() {
235235
kubectl create ns $CHATQNA_DATAPREP_NAMESPACE
236-
sed -i "s|namespace: chatqa|namespace: $CHATQNA_DATAPREP_NAMESPACE|g" $(pwd)/config/samples/chatQnA_dataprep_gaudi.yaml
236+
sed -i "s|namespace: chatqa|namespace: $CHATQNA_DATAPREP_NAMESPACE|g" $(pwd)/config/samples/ChatQnA/chatQnA_dataprep_gaudi.yaml
237237
# workaround for issue #268
238-
yq -i '(.spec.nodes.root.steps[] | select ( .name == "Tgi")).internalService.config.MODEL_ID = "bigscience/bloom-560m"' $(pwd)/config/samples/chatQnA_dataprep_gaudi.yaml
239-
kubectl apply -f $(pwd)/config/samples/chatQnA_dataprep_gaudi.yaml
238+
yq -i '(.spec.nodes.root.steps[] | select ( .name == "Tgi")).internalService.config.MODEL_ID = "bigscience/bloom-560m"' $(pwd)/config/samples/ChatQnA/chatQnA_dataprep_gaudi.yaml
239+
kubectl apply -f $(pwd)/config/samples/ChatQnA/chatQnA_dataprep_gaudi.yaml
240240

241241
# Wait until the router service is ready
242242
echo "Waiting for the chatqa router service to be ready..."
@@ -326,10 +326,10 @@ function validate_chatqna_with_dataprep() {
326326

327327
function validate_chatqna_in_switch() {
328328
kubectl create ns $CHATQNA_SWITCH_NAMESPACE
329-
sed -i "s|namespace: switch|namespace: $CHATQNA_SWITCH_NAMESPACE|g" $(pwd)/config/samples/chatQnA_switch_gaudi.yaml
329+
sed -i "s|namespace: switch|namespace: $CHATQNA_SWITCH_NAMESPACE|g" $(pwd)/config/samples/ChatQnA/chatQnA_switch_gaudi.yaml
330330
# workaround for issue #268
331-
yq -i '(.spec.nodes.root.steps[] | select ( .name == "Tgi")).internalService.config.MODEL_ID = "bigscience/bloom-560m"' $(pwd)/config/samples/chatQnA_switch_gaudi.yaml
332-
kubectl apply -f $(pwd)/config/samples/chatQnA_switch_gaudi.yaml
331+
yq -i '(.spec.nodes.root.steps[] | select ( .name == "Tgi")).internalService.config.MODEL_ID = "bigscience/bloom-560m"' $(pwd)/config/samples/ChatQnA/chatQnA_switch_gaudi.yaml
332+
kubectl apply -f $(pwd)/config/samples/ChatQnA/chatQnA_switch_gaudi.yaml
333333

334334
# Wait until the router service is ready
335335
echo "Waiting for the chatqa router service to be ready..."
@@ -422,9 +422,9 @@ function validate_chatqna_in_switch() {
422422

423423
function validate_modify_config() {
424424
kubectl create ns $MODIFY_STEP_NAMESPACE
425-
cp $(pwd)/config/samples/codegen_xeon.yaml $(pwd)/config/samples/codegen_xeon_mod.yaml
426-
sed -i "s|namespace: codegen|namespace: $MODIFY_STEP_NAMESPACE|g" $(pwd)/config/samples/codegen_xeon_mod.yaml
427-
kubectl apply -f $(pwd)/config/samples/codegen_xeon_mod.yaml
425+
cp $(pwd)/config/samples/CodeGen/codegen_xeon.yaml $(pwd)/config/samples/CodeGen/codegen_xeon_mod.yaml
426+
sed -i "s|namespace: codegen|namespace: $MODIFY_STEP_NAMESPACE|g" $(pwd)/config/samples/CodeGen/codegen_xeon_mod.yaml
427+
kubectl apply -f $(pwd)/config/samples/CodeGen/codegen_xeon_mod.yaml
428428

429429
# Wait until the router service is ready
430430
echo "Waiting for the router service to be ready..."
@@ -447,8 +447,8 @@ function validate_modify_config() {
447447
fi
448448

449449
#change the model id of the step named "Tgi" in the codegen_xeon_mod.yaml
450-
yq -i '(.spec.nodes.root.steps[] | select ( .name == "Tgi")).internalService.config.MODEL_ID = "bigscience/bloom-560m"' $(pwd)/config/samples/codegen_xeon_mod.yaml
451-
kubectl apply -f $(pwd)/config/samples/codegen_xeon_mod.yaml
450+
yq -i '(.spec.nodes.root.steps[] | select ( .name == "Tgi")).internalService.config.MODEL_ID = "bigscience/bloom-560m"' $(pwd)/config/samples/CodeGen/codegen_xeon_mod.yaml
451+
kubectl apply -f $(pwd)/config/samples/CodeGen/codegen_xeon_mod.yaml
452452
#you are supposed to see an error, it's a known issue, but it does not affect the tests
453453
#https://github.com/opea-project/GenAIInfra/issues/314
454454

@@ -460,7 +460,7 @@ function validate_modify_config() {
460460
fi
461461

462462
#revert the codegen yaml
463-
sed -i "s|namespace: $MODIFY_STEP_NAMESPACE|namespace: codegen|g" $(pwd)/config/samples/codegen_xeon_mod.yaml
463+
sed -i "s|namespace: $MODIFY_STEP_NAMESPACE|namespace: codegen|g" $(pwd)/config/samples/CodeGen/codegen_xeon_mod.yaml
464464
kubectl delete gmc -n $MODIFY_STEP_NAMESPACE 'codegen'
465465
echo "sleep 10s for cleaning up"
466466
sleep 10
@@ -469,9 +469,9 @@ function validate_modify_config() {
469469

470470
function validate_remove_step() {
471471
kubectl create ns $DELETE_STEP_NAMESPACE
472-
cp $(pwd)/config/samples/codegen_xeon.yaml $(pwd)/config/samples/codegen_xeon_del.yaml
473-
sed -i "s|namespace: codegen|namespace: $DELETE_STEP_NAMESPACE|g" $(pwd)/config/samples/codegen_xeon_del.yaml
474-
kubectl apply -f $(pwd)/config/samples/codegen_xeon_del.yaml
472+
cp $(pwd)/config/samples/CodeGen/codegen_xeon.yaml $(pwd)/config/samples/CodeGen/codegen_xeon_del.yaml
473+
sed -i "s|namespace: codegen|namespace: $DELETE_STEP_NAMESPACE|g" $(pwd)/config/samples/CodeGen/codegen_xeon_del.yaml
474+
kubectl apply -f $(pwd)/config/samples/CodeGen/codegen_xeon_del.yaml
475475

476476
# Wait until the router service is ready
477477
echo "Waiting for the router service to be ready..."
@@ -494,8 +494,8 @@ function validate_remove_step() {
494494
fi
495495

496496
# remove the step named "llm" in the codegen_xeon.yaml
497-
yq -i 'del(.spec.nodes.root.steps[] | select ( .name == "Llm"))' $(pwd)/config/samples/codegen_xeon_del.yaml
498-
kubectl apply -f $(pwd)/config/samples/codegen_xeon_del.yaml
497+
yq -i 'del(.spec.nodes.root.steps[] | select ( .name == "Llm"))' $(pwd)/config/samples/CodeGen/codegen_xeon_del.yaml
498+
kubectl apply -f $(pwd)/config/samples/CodeGen/codegen_xeon_del.yaml
499499

500500
sleep 10
501501
check_pod_terminated $DELETE_STEP_NAMESPACE
@@ -507,7 +507,7 @@ function validate_remove_step() {
507507
fi
508508

509509
#revert the codegen yaml
510-
sed -i "s|namespace: $DELETE_STEP_NAMESPACE|namespace: codegen|g" $(pwd)/config/samples/codegen_xeon_del.yaml
510+
sed -i "s|namespace: $DELETE_STEP_NAMESPACE|namespace: codegen|g" $(pwd)/config/samples/CodeGen/codegen_xeon_del.yaml
511511
kubectl delete gmc -n $DELETE_STEP_NAMESPACE 'codegen'
512512
echo "sleep 10s for cleaning up"
513513
sleep 10
@@ -516,8 +516,8 @@ function validate_remove_step() {
516516

517517
function validate_codegen() {
518518
kubectl create ns $CODEGEN_NAMESPACE
519-
sed -i "s|namespace: codegen|namespace: $CODEGEN_NAMESPACE|g" $(pwd)/config/samples/codegen_gaudi.yaml
520-
kubectl apply -f $(pwd)/config/samples/codegen_gaudi.yaml
519+
sed -i "s|namespace: codegen|namespace: $CODEGEN_NAMESPACE|g" $(pwd)/config/samples/CodeGen/codegen_gaudi.yaml
520+
kubectl apply -f $(pwd)/config/samples/CodeGen/codegen_gaudi.yaml
521521

522522
# Wait until the router service is ready
523523
echo "Waiting for the codegen router service to be ready..."
@@ -566,8 +566,8 @@ function validate_codegen() {
566566

567567
function validate_codetrans() {
568568
kubectl create ns $CODETRANS_NAMESPACE
569-
sed -i "s|namespace: codetrans|namespace: $CODETRANS_NAMESPACE|g" $(pwd)/config/samples/codetrans_gaudi.yaml
570-
kubectl apply -f $(pwd)/config/samples/codetrans_gaudi.yaml
569+
sed -i "s|namespace: codetrans|namespace: $CODETRANS_NAMESPACE|g" $(pwd)/config/samples/CodeTrans/codetrans_gaudi.yaml
570+
kubectl apply -f $(pwd)/config/samples/CodeTrans/codetrans_gaudi.yaml
571571

572572
# Wait until the router service is ready
573573
echo "Waiting for the codetrans router service to be ready..."
@@ -615,8 +615,8 @@ function validate_codetrans() {
615615

616616
function validate_docsum() {
617617
kubectl create ns $DOCSUM_NAMESPACE
618-
sed -i "s|namespace: docsum|namespace: $DOCSUM_NAMESPACE|g" $(pwd)/config/samples/docsum_gaudi.yaml
619-
kubectl apply -f $(pwd)/config/samples/docsum_gaudi.yaml
618+
sed -i "s|namespace: docsum|namespace: $DOCSUM_NAMESPACE|g" $(pwd)/config/samples/DocSum/docsum_gaudi.yaml
619+
kubectl apply -f $(pwd)/config/samples/DocSum/docsum_gaudi.yaml
620620

621621
# Wait until the router service is ready
622622
echo "Waiting for the docsum router service to be ready..."

0 commit comments

Comments
 (0)