Modify UI Port for CodeGen to avoid unsafe_port issue (#249)

Signed-off-by: zehao-intel <zehao.huang@intel.com>
This commit is contained in:
zehao-intel
2024-05-31 20:55:28 +08:00
committed by GitHub
parent ecb273216b
commit b160010ad3
10 changed files with 18 additions and 18 deletions

View File

@@ -7,7 +7,7 @@ import os
from comps import CodeGenGateway, MicroService, ServiceOrchestrator, ServiceType
MEGA_SERVICE_HOST_IP = os.getenv("MEGA_SERVICE_HOST_IP", "0.0.0.0")
MEGA_SERVICE_PORT = os.getenv("MEGA_SERVICE_PORT", 6666)
MEGA_SERVICE_PORT = os.getenv("MEGA_SERVICE_PORT", 7778)
LLM_SERVICE_HOST_IP = os.getenv("LLM_SERVICE_HOST_IP", "0.0.0.0")
LLM_SERVICE_PORT = os.getenv("LLM_SERVICE_PORT", 9000)

View File

@@ -58,7 +58,7 @@ export TGI_LLM_ENDPOINT="http://${host_ip}:8028"
export HUGGINGFACEHUB_API_TOKEN=${your_hf_api_token}
export MEGA_SERVICE_HOST_IP=${host_ip}
export LLM_SERVICE_HOST_IP=${host_ip}
export BACKEND_SERVICE_ENDPOINT="http://${host_ip}:6666/v1/codegen"
export BACKEND_SERVICE_ENDPOINT="http://${host_ip}:7778/v1/codegen"
```
> [!NOTE]
@@ -94,7 +94,7 @@ curl http://${host_ip}:9000/v1/chat/completions\
3. MegaService
```bash
curl http://${host_ip}:6666/v1/codegen -H "Content-Type: application/json" -d '{
curl http://${host_ip}: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."
}'
```

View File

@@ -46,7 +46,7 @@ services:
depends_on:
- llm
ports:
- "6666:6666"
- "7778:7778"
environment:
- https_proxy=${https_proxy}
- http_proxy=${http_proxy}

View File

@@ -66,7 +66,7 @@ export TGI_LLM_ENDPOINT="http://${host_ip}:8028"
export HUGGINGFACEHUB_API_TOKEN=${your_hf_api_token}
export MEGA_SERVICE_HOST_IP=${host_ip}
export LLM_SERVICE_HOST_IP=${host_ip}
export BACKEND_SERVICE_ENDPOINT="http://${host_ip}:6666/v1/codegen"
export BACKEND_SERVICE_ENDPOINT="http://${host_ip}:7778/v1/codegen"
```
Note: Please replace the `host_ip` with you external IP address, do not use `localhost`.
@@ -101,7 +101,7 @@ curl http://${host_ip}:9000/v1/chat/completions\
3. MegaService
```bash
curl http://${host_ip}:6666/v1/codegen -H "Content-Type: application/json" -d '{
curl http://${host_ip}: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."
}'
```

View File

@@ -41,7 +41,7 @@ services:
depends_on:
- llm
ports:
- "6666:6666"
- "7778:7778"
environment:
- https_proxy=${https_proxy}
- http_proxy=${http_proxy}

View File

@@ -29,7 +29,7 @@ Make sure all the pods are running, and restart the codegen-xxxx pod if necessar
```
kubectl get pods
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."
}'
```

View File

@@ -58,8 +58,8 @@ metadata:
spec:
type: ClusterIP
ports:
- port: 6666
targetPort: 6666
- port: 7778
targetPort: 7778
protocol: TCP
name: codegen
selector:
@@ -202,6 +202,6 @@ spec:
imagePullPolicy: IfNotPresent
ports:
- name: codegen
containerPort: 6666
containerPort: 7778
protocol: TCP
resources: null

View File

@@ -58,8 +58,8 @@ metadata:
spec:
type: ClusterIP
ports:
- port: 6666
targetPort: 6666
- port: 7778
targetPort: 7778
protocol: TCP
name: codegen
selector:
@@ -200,6 +200,6 @@ spec:
imagePullPolicy: IfNotPresent
ports:
- name: codegen
containerPort: 6666
containerPort: 7778
protocol: TCP
resources: null

View File

@@ -34,7 +34,7 @@ function start_services() {
export HUGGINGFACEHUB_API_TOKEN=${HUGGINGFACEHUB_API_TOKEN}
export MEGA_SERVICE_HOST_IP=${ip_address}
export LLM_SERVICE_HOST_IP=${ip_address}
export BACKEND_SERVICE_ENDPOINT="http://${ip_address}:6666/v1/codegen"
export BACKEND_SERVICE_ENDPOINT="http://${ip_address}:7778/v1/codegen"
# Start Docker Containers
# TODO: Replace the container name with a test-specific name
@@ -93,7 +93,7 @@ function validate_microservices() {
function validate_megaservice() {
# Curl the Mega Service
validate_services \
"${ip_address}:6666/v1/codegen" \
"${ip_address}:7778/v1/codegen" \
"print" \
"mega-codegen" \
"codegen-gaudi-backend-server" \

View File

@@ -32,7 +32,7 @@ function start_services() {
export HUGGINGFACEHUB_API_TOKEN=${HUGGINGFACEHUB_API_TOKEN}
export MEGA_SERVICE_HOST_IP=${ip_address}
export LLM_SERVICE_HOST_IP=${ip_address}
export BACKEND_SERVICE_ENDPOINT="http://${ip_address}:6666/v1/codegen"
export BACKEND_SERVICE_ENDPOINT="http://${ip_address}:7778/v1/codegen"
# Start Docker Containers
# TODO: Replace the container name with a test-specific name
@@ -91,7 +91,7 @@ function validate_microservices() {
function validate_megaservice() {
# Curl the Mega Service
validate_services \
"${ip_address}:6666/v1/codegen" \
"${ip_address}:7778/v1/codegen" \
"print" \
"mega-codegen" \
"codegen-xeon-backend-server" \