From 4ce917ee4446d0d97c7c18c0cd1b119b6380fb8b Mon Sep 17 00:00:00 2001
From: zhlsunshine <huailong.zhang@intel.com>
Date: Fri, 28 Jun 2024 08:59:10 +0800
Subject: [PATCH 1/5] add codetrans example for genaiexample. Signed-off-by:
 zhlsunshine <huailong.zhang@intel.com>

---
 CodeTrans/kubernetes/codetrans_gaudi.yaml |  33 +++++
 CodeTrans/kubernetes/codetrans_xeon.yaml  |  33 +++++
 CodeTrans/tests/test_gmc_on_gaudi.sh      | 167 ++++++++++++++++++++++
 CodeTrans/tests/test_gmc_on_xeon.sh       | 167 ++++++++++++++++++++++
 4 files changed, 400 insertions(+)
 create mode 100644 CodeTrans/kubernetes/codetrans_gaudi.yaml
 create mode 100644 CodeTrans/kubernetes/codetrans_xeon.yaml
 create mode 100755 CodeTrans/tests/test_gmc_on_gaudi.sh
 create mode 100755 CodeTrans/tests/test_gmc_on_xeon.sh

diff --git a/CodeTrans/kubernetes/codetrans_gaudi.yaml b/CodeTrans/kubernetes/codetrans_gaudi.yaml
new file mode 100644
index 0000000000..77ba131232
--- /dev/null
+++ b/CodeTrans/kubernetes/codetrans_gaudi.yaml
@@ -0,0 +1,33 @@
+# Copyright (C) 2024 Intel Corporation
+# SPDX-License-Identifier: Apache-2.0
+
+apiVersion: gmc.opea.io/v1alpha3
+kind: GMConnector
+metadata:
+  labels:
+    app.kubernetes.io/name: gmconnector
+    app.kubernetes.io/managed-by: kustomize
+    gmc/platform: gaudi
+  name: codetrans
+  namespace: codetrans
+spec:
+  routerConfig:
+    name: router
+    serviceName: router-service
+  nodes:
+    root:
+      routerType: Sequence
+      steps:
+      - name: Llm
+        data: $response
+        internalService:
+          serviceName: codetrans-service
+          config:
+            endpoint: /v1/chat/completions
+      - name: TgiGaudi
+        internalService:
+          serviceName: tgi-gaudi-svc
+          config:
+            LLM_MODEL_ID: HuggingFaceH4/mistral-7b-grok
+            endpoint: /generate
+          isDownstreamService: true
diff --git a/CodeTrans/kubernetes/codetrans_xeon.yaml b/CodeTrans/kubernetes/codetrans_xeon.yaml
new file mode 100644
index 0000000000..b94aa72ca0
--- /dev/null
+++ b/CodeTrans/kubernetes/codetrans_xeon.yaml
@@ -0,0 +1,33 @@
+# Copyright (C) 2024 Intel Corporation
+# SPDX-License-Identifier: Apache-2.0
+
+apiVersion: gmc.opea.io/v1alpha3
+kind: GMConnector
+metadata:
+  labels:
+    app.kubernetes.io/name: gmconnector
+    app.kubernetes.io/managed-by: kustomize
+    gmc/platform: xeon
+  name: codetrans
+  namespace: codetrans
+spec:
+  routerConfig:
+    name: router
+    serviceName: router-service
+  nodes:
+    root:
+      routerType: Sequence
+      steps:
+      - name: Llm
+        data: $response
+        internalService:
+          serviceName: codetrans-service
+          config:
+            endpoint: /v1/chat/completions
+      - name: Tgi
+        internalService:
+          serviceName: tgi-service
+          config:
+            LLM_MODEL_ID: HuggingFaceH4/mistral-7b-grok
+            endpoint: /generate
+          isDownstreamService: true
diff --git a/CodeTrans/tests/test_gmc_on_gaudi.sh b/CodeTrans/tests/test_gmc_on_gaudi.sh
new file mode 100755
index 0000000000..408461feb2
--- /dev/null
+++ b/CodeTrans/tests/test_gmc_on_gaudi.sh
@@ -0,0 +1,167 @@
+#!/bin/bash
+# Copyright (C) 2024 Intel Corporation
+# SPDX-License-Identifier: Apache-2.0
+
+set -xe
+USER_ID=$(whoami)
+LOG_PATH=/home/$(whoami)/logs
+MOUNT_DIR=/home/$USER_ID/.cache/huggingface/hub
+IMAGE_REPO=${IMAGE_REPO:-}
+
+function init_codetrans() {
+    wget https://raw.githubusercontent.com/opea-project/GenAIInfra/main/microservices-connector/config/crd/bases/gmc.opea.io_gmconnectors.yaml
+    wget https://raw.githubusercontent.com/opea-project/GenAIInfra/main/microservices-connector/config/rbac/gmc-manager-rbac.yaml
+    wget https://raw.githubusercontent.com/opea-project/GenAIInfra/main/microservices-connector/config/manager/gmc-manager.yaml
+    wget -O manifests/gmc-router.yaml https://raw.githubusercontent.com/opea-project/GenAIInfra/main/microservices-connector/config/gmcrouter/gmc-router.yaml
+
+    # replace namespace for gmc-router and gmc-manager
+    sed -i "s|namespace: system|namespace: $SYSTEM_NAMESPACE|g"  ./gmc-manager.yaml
+    sed -i "s|namespace: system|namespace: $SYSTEM_NAMESPACE|g"  ./gmc-manager-rbac.yaml
+    sed -i "s|name: system|name: $SYSTEM_NAMESPACE|g" ./gmc-manager-rbac.yaml
+    # replace the mount dir "path: /mnt/model" with "path: $CHART_MOUNT"
+    find . -name '*.yaml' -type f -exec sed -i "s#path: /mnt/models#path: $MOUNT_DIR#g" {} \;
+    # replace the repository "image: opea/*" with "image: ${IMAGE_REPO}opea/"
+    find . -name '*.yaml' -type f -exec sed -i "s#image: opea/*#image: ${IMAGE_REPO}opea/#g" {} \;
+    find . -name '*.yaml' -type f -exec sed -i "s#image: \"opea/*#image: ${IMAGE_REPO}opea\"/#g" {} \;
+    # set huggingface token
+    find . -name '*.yaml' -type f -exec sed -i "s#\${HUGGINGFACEHUB_API_TOKEN}#$(cat /home/$USER_ID/.cache/huggingface/token)#g" {} \;
+    # replace namespace "default" with real namespace
+    find . -name '*.yaml' -type f -exec sed -i "s#default.svc#$APP_NAMESPACE.svc#g" {} \;
+}
+
+function install_codetrans() {
+    # Make sure you have to use image tag $VERSION for microservice-connector installation
+    echo "install microservice-connector, using repo $DOCKER_REGISTRY and tag $VERSION"
+    echo "using namespace $SYSTEM_NAMESPACE and $APP_NAMESPACE"
+
+    kubectl apply -f ./gmc.opea.io_gmconnectors.yaml
+    kubectl apply -f ./gmc-manager-rbac.yaml
+    kubectl create configmap gmcyaml -n $SYSTEM_NAMESPACE --from-file $(pwd)/../kubernetes/manifests
+    kubectl apply -f ./gmc-manager.yaml
+
+    # Wait until the gmc controller pod is ready
+    wait_until_pod_ready "gmc-controller" $SYSTEM_NAMESPACE "gmc-controller"
+    kubectl get pods -n $SYSTEM_NAMESPACE
+    rm -f ./gmc.opea.io_gmconnectors.yaml ./gmc-manager-rbac.yaml ./gmc-manager.yaml manifests/gmc-router.yaml
+}
+
+function validate_codetrans() {
+    kubectl create ns $APP_NAMESPACE
+    sed -i "s|namespace: codetrans|namespace: $APP_NAMESPACE|g"  ./codetrans_gaudi.yaml
+    kubectl apply -f ./codetrans_gaudi.yaml
+
+    # Wait until the router service is ready
+    echo "Waiting for the codetrans router service to be ready..."
+    wait_until_pod_ready "codetrans router" $APP_NAMESPACE "router-service"
+    output=$(kubectl get pods -n $APP_NAMESPACE)
+    echo $output
+ 
+ 
+    # deploy client pod for testing
+    kubectl create deployment client-test -n $APP_NAMESPACE --image=python:3.8.13 -- sleep infinity
+ 
+    # wait for client pod ready
+    wait_until_pod_ready "client-test" $APP_NAMESPACE "client-test"
+    # giving time to populating data
+    sleep 60
+ 
+    kubectl get pods -n $APP_NAMESPACE
+    # send request to codetrans
+    export CLIENT_POD=$(kubectl get pod -n $APP_NAMESPACE -l app=client-test -o jsonpath={.items..metadata.name})
+    echo "$CLIENT_POD"
+    accessUrl=$(kubectl get gmc -n $APP_NAMESPACE -o jsonpath="{.items[?(@.metadata.name=='codetrans')].status.accessUrl}")
+    kubectl exec "$CLIENT_POD" -n $APP_NAMESPACE -- curl $accessUrl  -X POST  -d '{"language_from": "Golang","language_to": "Python","source_code": "package main\n\nimport \"fmt\"\nfunc main() {\n    fmt.Println(\"Hello, World!\");\n}"}' -H 'Content-Type: application/json' > $LOG_PATH/gmc_codetrans.log
+    exit_code=$?
+    if [ $exit_code -ne 0 ]; then
+        echo "codetrans failed, please check the logs in ${LOG_PATH}!"
+        exit 1
+    fi
+ 
+    echo "Checking response results, make sure the output is reasonable. "
+    local status=false
+    if [[ -f $LOG_PATH/gmc_codetrans.log ]] && \
+    [[ $(grep -c "import" $LOG_PATH/gmc_codetrans.log) != 0 ]]; then
+        status=true
+    fi
+    if [ $status == false ]; then
+        if [[ -f $LOG_PATH/gmc_codetrans.log ]]; then
+            cat $LOG_PATH/gmc_codetrans.log
+        fi
+        echo "Response check failed, please check the logs in artifacts!"
+        exit 1
+    else
+        echo "Response check succeed!"
+    fi
+}
+
+function wait_until_pod_ready() {
+    echo "Waiting for the $1 to be ready..."
+    max_retries=30
+    retry_count=0
+    while ! is_pod_ready $2 $3; do
+        if [ $retry_count -ge $max_retries ]; then
+            echo "$1 is not ready after waiting for a significant amount of time"
+            get_gmc_controller_logs
+            exit 1
+        fi
+        echo "$1 is not ready yet. Retrying in 10 seconds..."
+        sleep 10
+        output=$(kubectl get pods -n $2)
+        echo $output
+        retry_count=$((retry_count + 1))
+    done
+}
+
+function is_pod_ready() {
+    if [ "$2" == "gmc-controller" ]; then
+      pod_status=$(kubectl get pods -n $1 -o jsonpath='{.items[].status.conditions[?(@.type=="Ready")].status}')
+    else
+      pod_status=$(kubectl get pods -n $1 -l app=$2 -o jsonpath='{.items[].status.conditions[?(@.type=="Ready")].status}')
+    fi
+    if [ "$pod_status" == "True" ]; then
+        return 0
+    else
+        return 1
+    fi
+}
+
+function get_gmc_controller_logs() {
+    # Fetch the name of the pod with the app-name gmc-controller in the specified namespace
+    pod_name=$(kubectl get pods -n $SYSTEM_NAMESPACE -l control-plane=gmc-controller -o jsonpath='{.items[0].metadata.name}')
+
+    # Check if the pod name was found
+    if [ -z "$pod_name" ]; then
+        echo "No pod found with app-name gmc-controller in namespace $SYSTEM_NAMESPACE"
+        return 1
+    fi
+
+    # Get the logs of the found pod
+    echo "Fetching logs for pod $pod_name in namespace $SYSTEM_NAMESPACE..."
+    kubectl logs $pod_name -n $SYSTEM_NAMESPACE
+}
+
+if [ $# -eq 0 ]; then
+    echo "Usage: $0 <function_name>"
+    exit 1
+fi
+
+case "$1" in
+    init_CodeTrans)
+        pushd ChatQnA/kubernetes
+        init_codetrans
+        popd
+        ;;
+    install_CodeTrans)
+        pushd ChatQnA/kubernetes
+        install_codetrans
+        popd
+        ;;
+    validate_CodeTrans)
+        pushd codetrans/kubernetes
+        validate_codetrans
+        popd
+        ;;
+    *)
+        echo "Unknown function: $1"
+        ;;
+esac
diff --git a/CodeTrans/tests/test_gmc_on_xeon.sh b/CodeTrans/tests/test_gmc_on_xeon.sh
new file mode 100755
index 0000000000..130c9c3ad8
--- /dev/null
+++ b/CodeTrans/tests/test_gmc_on_xeon.sh
@@ -0,0 +1,167 @@
+#!/bin/bash
+# Copyright (C) 2024 Intel Corporation
+# SPDX-License-Identifier: Apache-2.0
+
+set -xe
+USER_ID=$(whoami)
+LOG_PATH=/home/$(whoami)/logs
+MOUNT_DIR=/home/$USER_ID/.cache/huggingface/hub
+IMAGE_REPO=${IMAGE_REPO:-}
+
+function init_codetrans() {
+    wget https://raw.githubusercontent.com/opea-project/GenAIInfra/main/microservices-connector/config/crd/bases/gmc.opea.io_gmconnectors.yaml
+    wget https://raw.githubusercontent.com/opea-project/GenAIInfra/main/microservices-connector/config/rbac/gmc-manager-rbac.yaml
+    wget https://raw.githubusercontent.com/opea-project/GenAIInfra/main/microservices-connector/config/manager/gmc-manager.yaml
+    wget -O manifests/gmc-router.yaml https://raw.githubusercontent.com/opea-project/GenAIInfra/main/microservices-connector/config/gmcrouter/gmc-router.yaml
+
+    # replace namespace for gmc-router and gmc-manager
+    sed -i "s|namespace: system|namespace: $SYSTEM_NAMESPACE|g"  ./gmc-manager.yaml
+    sed -i "s|namespace: system|namespace: $SYSTEM_NAMESPACE|g"  ./gmc-manager-rbac.yaml
+    sed -i "s|name: system|name: $SYSTEM_NAMESPACE|g" ./gmc-manager-rbac.yaml
+    # replace the mount dir "path: /mnt/model" with "path: $CHART_MOUNT"
+    find . -name '*.yaml' -type f -exec sed -i "s#path: /mnt/models#path: $MOUNT_DIR#g" {} \;
+    # replace the repository "image: opea/*" with "image: ${IMAGE_REPO}opea/"
+    find . -name '*.yaml' -type f -exec sed -i "s#image: opea/*#image: ${IMAGE_REPO}opea/#g" {} \;
+    find . -name '*.yaml' -type f -exec sed -i "s#image: \"opea/*#image: ${IMAGE_REPO}opea\"/#g" {} \;
+    # set huggingface token
+    find . -name '*.yaml' -type f -exec sed -i "s#\${HUGGINGFACEHUB_API_TOKEN}#$(cat /home/$USER_ID/.cache/huggingface/token)#g" {} \;
+    # replace namespace "default" with real namespace
+    find . -name '*.yaml' -type f -exec sed -i "s#default.svc#$APP_NAMESPACE.svc#g" {} \;
+}
+
+function install_codetrans() {
+    # Make sure you have to use image tag $VERSION for microservice-connector installation
+    echo "install microservice-connector, using repo $DOCKER_REGISTRY and tag $VERSION"
+    echo "using namespace $SYSTEM_NAMESPACE and $APP_NAMESPACE"
+
+    kubectl apply -f ./gmc.opea.io_gmconnectors.yaml
+    kubectl apply -f ./gmc-manager-rbac.yaml
+    kubectl create configmap gmcyaml -n $SYSTEM_NAMESPACE --from-file $(pwd)/../kubernetes/manifests
+    kubectl apply -f ./gmc-manager.yaml
+
+    # Wait until the gmc controller pod is ready
+    wait_until_pod_ready "gmc-controller" $SYSTEM_NAMESPACE "gmc-controller"
+    kubectl get pods -n $SYSTEM_NAMESPACE
+    rm -f ./gmc.opea.io_gmconnectors.yaml ./gmc-manager-rbac.yaml ./gmc-manager.yaml manifests/gmc-router.yaml
+}
+
+function validate_codetrans() {
+    kubectl create ns $APP_NAMESPACE
+    sed -i "s|namespace: codetrans|namespace: $APP_NAMESPACE|g"  ./codetrans_xeon.yaml
+    kubectl apply -f ./codetrans_xeon.yaml
+
+    # Wait until the router service is ready
+    echo "Waiting for the codetrans router service to be ready..."
+    wait_until_pod_ready "codetrans router" $APP_NAMESPACE "router-service"
+    output=$(kubectl get pods -n $APP_NAMESPACE)
+    echo $output
+ 
+ 
+    # deploy client pod for testing
+    kubectl create deployment client-test -n $APP_NAMESPACE --image=python:3.8.13 -- sleep infinity
+ 
+    # wait for client pod ready
+    wait_until_pod_ready "client-test" $APP_NAMESPACE "client-test"
+    # giving time to populating data
+    sleep 60
+ 
+    kubectl get pods -n $APP_NAMESPACE
+    # send request to codetrans
+    export CLIENT_POD=$(kubectl get pod -n $APP_NAMESPACE -l app=client-test -o jsonpath={.items..metadata.name})
+    echo "$CLIENT_POD"
+    accessUrl=$(kubectl get gmc -n $APP_NAMESPACE -o jsonpath="{.items[?(@.metadata.name=='codetrans')].status.accessUrl}")
+    kubectl exec "$CLIENT_POD" -n $APP_NAMESPACE -- curl $accessUrl  -X POST  -d '{"language_from": "Golang","language_to": "Python","source_code": "package main\n\nimport \"fmt\"\nfunc main() {\n    fmt.Println(\"Hello, World!\");\n}"}' -H 'Content-Type: application/json' > $LOG_PATH/gmc_codetrans.log
+    exit_code=$?
+    if [ $exit_code -ne 0 ]; then
+        echo "codetrans failed, please check the logs in ${LOG_PATH}!"
+        exit 1
+    fi
+ 
+    echo "Checking response results, make sure the output is reasonable. "
+    local status=false
+    if [[ -f $LOG_PATH/gmc_codetrans.log ]] && \
+    [[ $(grep -c "import" $LOG_PATH/gmc_codetrans.log) != 0 ]]; then
+        status=true
+    fi
+    if [ $status == false ]; then
+        if [[ -f $LOG_PATH/gmc_codetrans.log ]]; then
+            cat $LOG_PATH/gmc_codetrans.log
+        fi
+        echo "Response check failed, please check the logs in artifacts!"
+        exit 1
+    else
+        echo "Response check succeed!"
+    fi
+}
+
+function wait_until_pod_ready() {
+    echo "Waiting for the $1 to be ready..."
+    max_retries=30
+    retry_count=0
+    while ! is_pod_ready $2 $3; do
+        if [ $retry_count -ge $max_retries ]; then
+            echo "$1 is not ready after waiting for a significant amount of time"
+            get_gmc_controller_logs
+            exit 1
+        fi
+        echo "$1 is not ready yet. Retrying in 10 seconds..."
+        sleep 10
+        output=$(kubectl get pods -n $2)
+        echo $output
+        retry_count=$((retry_count + 1))
+    done
+}
+
+function is_pod_ready() {
+    if [ "$2" == "gmc-controller" ]; then
+      pod_status=$(kubectl get pods -n $1 -o jsonpath='{.items[].status.conditions[?(@.type=="Ready")].status}')
+    else
+      pod_status=$(kubectl get pods -n $1 -l app=$2 -o jsonpath='{.items[].status.conditions[?(@.type=="Ready")].status}')
+    fi
+    if [ "$pod_status" == "True" ]; then
+        return 0
+    else
+        return 1
+    fi
+}
+
+function get_gmc_controller_logs() {
+    # Fetch the name of the pod with the app-name gmc-controller in the specified namespace
+    pod_name=$(kubectl get pods -n $SYSTEM_NAMESPACE -l control-plane=gmc-controller -o jsonpath='{.items[0].metadata.name}')
+
+    # Check if the pod name was found
+    if [ -z "$pod_name" ]; then
+        echo "No pod found with app-name gmc-controller in namespace $SYSTEM_NAMESPACE"
+        return 1
+    fi
+
+    # Get the logs of the found pod
+    echo "Fetching logs for pod $pod_name in namespace $SYSTEM_NAMESPACE..."
+    kubectl logs $pod_name -n $SYSTEM_NAMESPACE
+}
+
+if [ $# -eq 0 ]; then
+    echo "Usage: $0 <function_name>"
+    exit 1
+fi
+
+case "$1" in
+    init_CodeTrans)
+        pushd ChatQnA/kubernetes
+        init_codetrans
+        popd
+        ;;
+    install_CodeTrans)
+        pushd ChatQnA/kubernetes
+        install_codetrans
+        popd
+        ;;
+    validate_CodeTrans)
+        pushd codetrans/kubernetes
+        validate_codetrans
+        popd
+        ;;
+    *)
+        echo "Unknown function: $1"
+        ;;
+esac

From 85ab2ef57b528d42401a3ada795ccdc6d36bfb09 Mon Sep 17 00:00:00 2001
From: zhlsunshine <huailong.zhang@intel.com>
Date: Fri, 28 Jun 2024 09:28:30 +0800
Subject: [PATCH 2/5] re-trigger the codetrans e2e test. Signed-off-by:
 zhlsunshine <huailong.zhang@intel.com>

---
 CodeTrans/tests/test_gmc_on_gaudi.sh | 1 -
 CodeTrans/tests/test_gmc_on_xeon.sh  | 1 -
 2 files changed, 2 deletions(-)

diff --git a/CodeTrans/tests/test_gmc_on_gaudi.sh b/CodeTrans/tests/test_gmc_on_gaudi.sh
index 408461feb2..98e1771426 100755
--- a/CodeTrans/tests/test_gmc_on_gaudi.sh
+++ b/CodeTrans/tests/test_gmc_on_gaudi.sh
@@ -56,7 +56,6 @@ function validate_codetrans() {
     output=$(kubectl get pods -n $APP_NAMESPACE)
     echo $output
  
- 
     # deploy client pod for testing
     kubectl create deployment client-test -n $APP_NAMESPACE --image=python:3.8.13 -- sleep infinity
  
diff --git a/CodeTrans/tests/test_gmc_on_xeon.sh b/CodeTrans/tests/test_gmc_on_xeon.sh
index 130c9c3ad8..256f35352b 100755
--- a/CodeTrans/tests/test_gmc_on_xeon.sh
+++ b/CodeTrans/tests/test_gmc_on_xeon.sh
@@ -56,7 +56,6 @@ function validate_codetrans() {
     output=$(kubectl get pods -n $APP_NAMESPACE)
     echo $output
  
- 
     # deploy client pod for testing
     kubectl create deployment client-test -n $APP_NAMESPACE --image=python:3.8.13 -- sleep infinity
  

From b18a281e0f624f4b87f356171851dd0f6da55097 Mon Sep 17 00:00:00 2001
From: zhlsunshine <huailong.zhang@intel.com>
Date: Fri, 28 Jun 2024 09:34:40 +0800
Subject: [PATCH 3/5] change the pushd folder. Signed-off-by: zhlsunshine
 <huailong.zhang@intel.com>

---
 CodeTrans/tests/test_gmc_on_gaudi.sh | 2 +-
 CodeTrans/tests/test_gmc_on_xeon.sh  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/CodeTrans/tests/test_gmc_on_gaudi.sh b/CodeTrans/tests/test_gmc_on_gaudi.sh
index 98e1771426..235338205a 100755
--- a/CodeTrans/tests/test_gmc_on_gaudi.sh
+++ b/CodeTrans/tests/test_gmc_on_gaudi.sh
@@ -156,7 +156,7 @@ case "$1" in
         popd
         ;;
     validate_CodeTrans)
-        pushd codetrans/kubernetes
+        pushd CodeTrans/kubernetes
         validate_codetrans
         popd
         ;;
diff --git a/CodeTrans/tests/test_gmc_on_xeon.sh b/CodeTrans/tests/test_gmc_on_xeon.sh
index 256f35352b..6d9a3c476b 100755
--- a/CodeTrans/tests/test_gmc_on_xeon.sh
+++ b/CodeTrans/tests/test_gmc_on_xeon.sh
@@ -156,7 +156,7 @@ case "$1" in
         popd
         ;;
     validate_CodeTrans)
-        pushd codetrans/kubernetes
+        pushd CodeTrans/kubernetes
         validate_codetrans
         popd
         ;;

From 4ec1d5fef32ec1909c2e59cfdf3dc944c11b6db8 Mon Sep 17 00:00:00 2001
From: "pre-commit-ci[bot]"
 <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Date: Fri, 28 Jun 2024 01:35:40 +0000
Subject: [PATCH 4/5] [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci
---
 CodeTrans/tests/test_gmc_on_gaudi.sh | 8 ++++----
 CodeTrans/tests/test_gmc_on_xeon.sh  | 8 ++++----
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/CodeTrans/tests/test_gmc_on_gaudi.sh b/CodeTrans/tests/test_gmc_on_gaudi.sh
index 235338205a..1c23cd47a1 100755
--- a/CodeTrans/tests/test_gmc_on_gaudi.sh
+++ b/CodeTrans/tests/test_gmc_on_gaudi.sh
@@ -55,15 +55,15 @@ function validate_codetrans() {
     wait_until_pod_ready "codetrans router" $APP_NAMESPACE "router-service"
     output=$(kubectl get pods -n $APP_NAMESPACE)
     echo $output
- 
+
     # deploy client pod for testing
     kubectl create deployment client-test -n $APP_NAMESPACE --image=python:3.8.13 -- sleep infinity
- 
+
     # wait for client pod ready
     wait_until_pod_ready "client-test" $APP_NAMESPACE "client-test"
     # giving time to populating data
     sleep 60
- 
+
     kubectl get pods -n $APP_NAMESPACE
     # send request to codetrans
     export CLIENT_POD=$(kubectl get pod -n $APP_NAMESPACE -l app=client-test -o jsonpath={.items..metadata.name})
@@ -75,7 +75,7 @@ function validate_codetrans() {
         echo "codetrans failed, please check the logs in ${LOG_PATH}!"
         exit 1
     fi
- 
+
     echo "Checking response results, make sure the output is reasonable. "
     local status=false
     if [[ -f $LOG_PATH/gmc_codetrans.log ]] && \
diff --git a/CodeTrans/tests/test_gmc_on_xeon.sh b/CodeTrans/tests/test_gmc_on_xeon.sh
index 6d9a3c476b..4847d53894 100755
--- a/CodeTrans/tests/test_gmc_on_xeon.sh
+++ b/CodeTrans/tests/test_gmc_on_xeon.sh
@@ -55,15 +55,15 @@ function validate_codetrans() {
     wait_until_pod_ready "codetrans router" $APP_NAMESPACE "router-service"
     output=$(kubectl get pods -n $APP_NAMESPACE)
     echo $output
- 
+
     # deploy client pod for testing
     kubectl create deployment client-test -n $APP_NAMESPACE --image=python:3.8.13 -- sleep infinity
- 
+
     # wait for client pod ready
     wait_until_pod_ready "client-test" $APP_NAMESPACE "client-test"
     # giving time to populating data
     sleep 60
- 
+
     kubectl get pods -n $APP_NAMESPACE
     # send request to codetrans
     export CLIENT_POD=$(kubectl get pod -n $APP_NAMESPACE -l app=client-test -o jsonpath={.items..metadata.name})
@@ -75,7 +75,7 @@ function validate_codetrans() {
         echo "codetrans failed, please check the logs in ${LOG_PATH}!"
         exit 1
     fi
- 
+
     echo "Checking response results, make sure the output is reasonable. "
     local status=false
     if [[ -f $LOG_PATH/gmc_codetrans.log ]] && \

From feb4833df23d0b5466cd2fcf399f9c539a3e570b Mon Sep 17 00:00:00 2001
From: zhlsunshine <huailong.zhang@intel.com>
Date: Fri, 28 Jun 2024 11:03:29 +0800
Subject: [PATCH 5/5] fix incorrect triggering. Signed-off-by: zhlsunshine
 <huailong.zhang@intel.com>

---
 .github/workflows/docker-compose-e2e.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.github/workflows/docker-compose-e2e.yml b/.github/workflows/docker-compose-e2e.yml
index 6c82fa8d0d..b22207b6ba 100644
--- a/.github/workflows/docker-compose-e2e.yml
+++ b/.github/workflows/docker-compose-e2e.yml
@@ -25,7 +25,7 @@ jobs:
   job1:
     uses: ./.github/workflows/reuse-get-test-matrix.yml
     with:
-      diff_excluded_files: '.github|README.md|*.txt|deprecate|kubernetes|manifest|assets'
+      diff_excluded_files: '.github|README.md|*.txt|deprecate|kubernetes|manifest|gmc|assets'
 
   mega-image-build:
     needs: job1
