Skip to content

Commit

Permalink
restructure the directory of config sample and update the e2e test. (#…
Browse files Browse the repository at this point in the history
…351)

Signed-off-by: zhlsunshine <huailong.zhang@intel.com>
  • Loading branch information
zhlsunshine authored Aug 26, 2024
1 parent 182183e commit 326a637
Show file tree
Hide file tree
Showing 22 changed files with 65 additions and 65 deletions.
64 changes: 32 additions & 32 deletions .github/workflows/scripts/e2e/gmc_gaudi_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ function validate_gmc() {
function validate_webhook() {
kubectl create ns $WEBHOOK_NAMESPACE || echo "namespace $WEBHOOK_NAMESPACE is created."
# validate root node existence
yq ".spec.nodes.node123 = .spec.nodes.root | del(.spec.nodes.root)" config/samples/chatQnA_xeon.yaml > /tmp/webhook-case1.yaml
yq ".spec.nodes.node123 = .spec.nodes.root | del(.spec.nodes.root)" config/samples/ChatQnA/chatQnA_xeon.yaml > /tmp/webhook-case1.yaml
sed -i "s|namespace: chatqa|namespace: $WEBHOOK_NAMESPACE|g" /tmp/webhook-case1.yaml
output=$(! kubectl apply -f /tmp/webhook-case1.yaml 2>&1)
if ! (echo $output | grep -q "a root node is required"); then
Expand All @@ -65,7 +65,7 @@ function validate_webhook() {
fi

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Expand All @@ -460,7 +460,7 @@ function validate_modify_config() {
fi

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

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

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

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

sleep 10
check_pod_terminated $DELETE_STEP_NAMESPACE
Expand All @@ -507,7 +507,7 @@ function validate_remove_step() {
fi

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

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

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

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

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

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

# Wait until the router service is ready
echo "Waiting for the docsum router service to be ready..."
Expand Down
Loading

0 comments on commit 326a637

Please sign in to comment.