diff --git a/.github/workflows/scripts/e2e/chart_test.sh b/.github/workflows/scripts/e2e/chart_test.sh index 28268fe54..6a019c4ac 100755 --- a/.github/workflows/scripts/e2e/chart_test.sh +++ b/.github/workflows/scripts/e2e/chart_test.sh @@ -31,14 +31,18 @@ function validate_codegen() { ip_address=$(kubectl get svc $RELEASE_NAME -n $NAMESPACE -o jsonpath='{.spec.clusterIP}') port=$(kubectl get svc $RELEASE_NAME -n $NAMESPACE -o jsonpath='{.spec.ports[0].port}') # Curl the Mega Service - curl http://${ip_address}:${port}/v1/codegen -H "Content-Type: application/json" -d '{ - "model": "ise-uiuc/Magicoder-S-DS-6.7B", - "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 + curl http://${ip_address}:${port}/v1/codegen -H "Content-Type: application/json" \ + -d '{"messages": "def print_hello_world():"}' > $LOG_PATH/curl_codegen.log + exit_code=$? + if [ $exit_code -ne 0 ]; then + echo "Megaservice codegen failed, please check the logs in ${LOG_PATH}!" + exit 1 + fi echo "Checking response results, make sure the output is reasonable. " - local status=true - if [[ -f curl_megaservice.log ]] && \ - [[ $(grep -c "billion" curl_megaservice.log) != 0 ]]; then + local status=false + if [[ -f $LOG_PATH/curl_codegen.log ]] && \ + [[ $(grep -c "print" $LOG_PATH/curl_codegen.log) != 0 ]]; then status=true fi diff --git a/.github/workflows/scripts/e2e/manifest_test.sh b/.github/workflows/scripts/e2e/manifest_test.sh index 27d77ff52..d8df211d6 100755 --- a/.github/workflows/scripts/e2e/manifest_test.sh +++ b/.github/workflows/scripts/e2e/manifest_test.sh @@ -51,14 +51,18 @@ function validate_codegen() { port=$(kubectl get svc $SERVICE_NAME -n $NAMESPACE -o jsonpath='{.spec.ports[0].port}') echo "try to curl http://${ip_address}:${port}/v1/codegen..." # Curl the Mega Service - curl http://${ip_address}:${port}/v1/codegen -H "Content-Type: application/json" -d '{ - "model": "ise-uiuc/Magicoder-S-DS-6.7B", - "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 + curl http://${ip_address}:${port}/v1/codegen -H "Content-Type: application/json" \ + -d '{"messages": "def print_hello_world():"}' > $LOG_PATH/curl_codegen.log + exit_code=$? + if [ $exit_code -ne 0 ]; then + echo "Megaservice codegen failed, please check the logs in ${LOG_PATH}!" + exit 1 + fi echo "Checking response results, make sure the output is reasonable. " - local status=true - if [[ -f curl_megaservice.log ]] && \ - [[ $(grep -c "billion" curl_megaservice.log) != 0 ]]; then + local status=false + if [[ -f $LOG_PATH/curl_codegen.log ]] && \ + [[ $(grep -c "print" $LOG_PATH/curl_codegen.log) != 0 ]]; then status=true fi @@ -82,17 +86,17 @@ function validate_chatqna() { # Curl the Mega Service curl http://chaqna-xeon-backend-server-svc.$NAMESPACE:8888/v1/chatqna -H "Content-Type: application/json" \ - -d '{ "messages": "What is the revenue of Nike in 2023?" }' > $LOG_PATH/curl_megaservice.log + -d '{ "messages": "What is the revenue of Nike in 2023?" }' > $LOG_PATH/curl_chatqna.log exit_code=$? if [ $exit_code -ne 0 ]; then - echo "Megaservice failed, please check the logs in ${LOG_PATH}!" + echo "Megaservice chatqna 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/curl_megaservice.log ]] && \ - [[ $(grep -c "billion" $LOG_PATH/curl_megaservice.log) != 0 ]]; then + if [[ -f $LOG_PATH/curl_chatqna.log ]] && \ + [[ $(grep -c "billion" $LOG_PATH/curl_chatqna.log) != 0 ]]; then status=true fi diff --git a/helm-charts/codegen/README.md b/helm-charts/codegen/README.md index e1f867027..65c96e487 100644 --- a/helm-charts/codegen/README.md +++ b/helm-charts/codegen/README.md @@ -22,7 +22,7 @@ helm install codegen codegen --set llm-uservice.HUGGINGFACEHUB_API_TOKEN=${HFTOK | Key | Type | Default | Description | | ------------------------------------- | ------ | -------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | | image.repository | string | `"opea/codegen:latest"` | | -| service.port | string | `"6666"` | | +| service.port | string | `"7778"` | | | llm-uservice.HUGGINGFACEHUB_API_TOKEN | string | `""` | Your own Hugging Face API token | | llm-uservice.tgi.LLM_MODEL_ID | string | `"ise-uiuc/Magicoder-S-DS-6.7B"` | Models id from https://huggingface.co/, or predownloaded model directory | | llm-uservice.tgi.volume | string | `"/mnt"` | Cached models directory, tgi will not download if the model is cached here. The "volume" will be mounted to container as /data directory | diff --git a/helm-charts/codegen/gaudi-values.yaml b/helm-charts/codegen/gaudi-values.yaml index ca7401541..e860e703b 100644 --- a/helm-charts/codegen/gaudi-values.yaml +++ b/helm-charts/codegen/gaudi-values.yaml @@ -13,10 +13,10 @@ image: # Overrides the image tag whose default is the chart appVersion. # tag: "1.0" -port: 6666 +port: 7778 service: type: ClusterIP - port: 6666 + port: 7778 # To override values in subchart llm-uservice llm-uservice: diff --git a/helm-charts/codegen/values.yaml b/helm-charts/codegen/values.yaml index d84c889c6..8349bdeeb 100644 --- a/helm-charts/codegen/values.yaml +++ b/helm-charts/codegen/values.yaml @@ -13,10 +13,10 @@ image: # Overrides the image tag whose default is the chart appVersion. # tag: "1.0" -port: 6666 +port: 7778 service: type: ClusterIP - port: 6666 + port: 7778 # To override values in subchart llm-uservice llm-uservice: diff --git a/manifests/CodeGen/gaudi/README.md b/manifests/CodeGen/gaudi/README.md index 4fac99ceb..65842d94d 100644 --- a/manifests/CodeGen/gaudi/README.md +++ b/manifests/CodeGen/gaudi/README.md @@ -18,7 +18,7 @@ kubectl apply -f codegen.yaml Make sure all the pods are running, and restart the codegen-xxxx pod if necessary. ``` -curl http://codegen:6666/v1/codegen -H "Content-Type: application/json" -d '{ +curl http://codegen:7778/v1/codegen -H "Content-Type: application/json" -d '{ "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." }' ``` diff --git a/manifests/CodeGen/gaudi/codegen.yaml b/manifests/CodeGen/gaudi/codegen.yaml index 61e14d9d2..38fa762a6 100644 --- a/manifests/CodeGen/gaudi/codegen.yaml +++ b/manifests/CodeGen/gaudi/codegen.yaml @@ -66,8 +66,8 @@ metadata: spec: type: ClusterIP ports: - - port: 6666 - targetPort: 6666 + - port: 7778 + targetPort: 7778 protocol: TCP name: codegen selector: @@ -229,7 +229,7 @@ spec: imagePullPolicy: IfNotPresent ports: - name: codegen - containerPort: 6666 + containerPort: 7778 protocol: TCP resources: null diff --git a/manifests/CodeGen/xeon/README.md b/manifests/CodeGen/xeon/README.md index 708adc4db..698dc7007 100644 --- a/manifests/CodeGen/xeon/README.md +++ b/manifests/CodeGen/xeon/README.md @@ -18,7 +18,7 @@ kubectl apply -f codegen.yaml Make sure all the pods are running, and restart the codegen-xxxx pod if necessary. ``` -curl http://codegen:6666/v1/codegen -H "Content-Type: application/json" -d '{ +curl http://codegen:7778/v1/codegen -H "Content-Type: application/json" -d '{ "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." }' ``` diff --git a/manifests/CodeGen/xeon/codegen.yaml b/manifests/CodeGen/xeon/codegen.yaml index 32ca9ee89..97de9a0ae 100644 --- a/manifests/CodeGen/xeon/codegen.yaml +++ b/manifests/CodeGen/xeon/codegen.yaml @@ -66,8 +66,8 @@ metadata: spec: type: ClusterIP ports: - - port: 6666 - targetPort: 6666 + - port: 7778 + targetPort: 7778 protocol: TCP name: codegen selector: @@ -228,7 +228,7 @@ spec: imagePullPolicy: IfNotPresent ports: - name: codegen - containerPort: 6666 + containerPort: 7778 protocol: TCP resources: null