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:
@@ -7,7 +7,7 @@ import os
|
|||||||
from comps import CodeGenGateway, MicroService, ServiceOrchestrator, ServiceType
|
from comps import CodeGenGateway, MicroService, ServiceOrchestrator, ServiceType
|
||||||
|
|
||||||
MEGA_SERVICE_HOST_IP = os.getenv("MEGA_SERVICE_HOST_IP", "0.0.0.0")
|
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_HOST_IP = os.getenv("LLM_SERVICE_HOST_IP", "0.0.0.0")
|
||||||
LLM_SERVICE_PORT = os.getenv("LLM_SERVICE_PORT", 9000)
|
LLM_SERVICE_PORT = os.getenv("LLM_SERVICE_PORT", 9000)
|
||||||
|
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ export TGI_LLM_ENDPOINT="http://${host_ip}:8028"
|
|||||||
export HUGGINGFACEHUB_API_TOKEN=${your_hf_api_token}
|
export HUGGINGFACEHUB_API_TOKEN=${your_hf_api_token}
|
||||||
export MEGA_SERVICE_HOST_IP=${host_ip}
|
export MEGA_SERVICE_HOST_IP=${host_ip}
|
||||||
export LLM_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]
|
> [!NOTE]
|
||||||
@@ -94,7 +94,7 @@ curl http://${host_ip}:9000/v1/chat/completions\
|
|||||||
3. MegaService
|
3. MegaService
|
||||||
|
|
||||||
```bash
|
```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."
|
"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."
|
||||||
}'
|
}'
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ services:
|
|||||||
depends_on:
|
depends_on:
|
||||||
- llm
|
- llm
|
||||||
ports:
|
ports:
|
||||||
- "6666:6666"
|
- "7778:7778"
|
||||||
environment:
|
environment:
|
||||||
- https_proxy=${https_proxy}
|
- https_proxy=${https_proxy}
|
||||||
- http_proxy=${http_proxy}
|
- http_proxy=${http_proxy}
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ export TGI_LLM_ENDPOINT="http://${host_ip}:8028"
|
|||||||
export HUGGINGFACEHUB_API_TOKEN=${your_hf_api_token}
|
export HUGGINGFACEHUB_API_TOKEN=${your_hf_api_token}
|
||||||
export MEGA_SERVICE_HOST_IP=${host_ip}
|
export MEGA_SERVICE_HOST_IP=${host_ip}
|
||||||
export LLM_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`.
|
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
|
3. MegaService
|
||||||
|
|
||||||
```bash
|
```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."
|
"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."
|
||||||
}'
|
}'
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ services:
|
|||||||
depends_on:
|
depends_on:
|
||||||
- llm
|
- llm
|
||||||
ports:
|
ports:
|
||||||
- "6666:6666"
|
- "7778:7778"
|
||||||
environment:
|
environment:
|
||||||
- https_proxy=${https_proxy}
|
- https_proxy=${https_proxy}
|
||||||
- http_proxy=${http_proxy}
|
- http_proxy=${http_proxy}
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ Make sure all the pods are running, and restart the codegen-xxxx pod if necessar
|
|||||||
|
|
||||||
```
|
```
|
||||||
kubectl get pods
|
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."
|
"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."
|
||||||
}'
|
}'
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -58,8 +58,8 @@ metadata:
|
|||||||
spec:
|
spec:
|
||||||
type: ClusterIP
|
type: ClusterIP
|
||||||
ports:
|
ports:
|
||||||
- port: 6666
|
- port: 7778
|
||||||
targetPort: 6666
|
targetPort: 7778
|
||||||
protocol: TCP
|
protocol: TCP
|
||||||
name: codegen
|
name: codegen
|
||||||
selector:
|
selector:
|
||||||
@@ -202,6 +202,6 @@ spec:
|
|||||||
imagePullPolicy: IfNotPresent
|
imagePullPolicy: IfNotPresent
|
||||||
ports:
|
ports:
|
||||||
- name: codegen
|
- name: codegen
|
||||||
containerPort: 6666
|
containerPort: 7778
|
||||||
protocol: TCP
|
protocol: TCP
|
||||||
resources: null
|
resources: null
|
||||||
|
|||||||
@@ -58,8 +58,8 @@ metadata:
|
|||||||
spec:
|
spec:
|
||||||
type: ClusterIP
|
type: ClusterIP
|
||||||
ports:
|
ports:
|
||||||
- port: 6666
|
- port: 7778
|
||||||
targetPort: 6666
|
targetPort: 7778
|
||||||
protocol: TCP
|
protocol: TCP
|
||||||
name: codegen
|
name: codegen
|
||||||
selector:
|
selector:
|
||||||
@@ -200,6 +200,6 @@ spec:
|
|||||||
imagePullPolicy: IfNotPresent
|
imagePullPolicy: IfNotPresent
|
||||||
ports:
|
ports:
|
||||||
- name: codegen
|
- name: codegen
|
||||||
containerPort: 6666
|
containerPort: 7778
|
||||||
protocol: TCP
|
protocol: TCP
|
||||||
resources: null
|
resources: null
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ function start_services() {
|
|||||||
export HUGGINGFACEHUB_API_TOKEN=${HUGGINGFACEHUB_API_TOKEN}
|
export HUGGINGFACEHUB_API_TOKEN=${HUGGINGFACEHUB_API_TOKEN}
|
||||||
export MEGA_SERVICE_HOST_IP=${ip_address}
|
export MEGA_SERVICE_HOST_IP=${ip_address}
|
||||||
export LLM_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
|
# Start Docker Containers
|
||||||
# TODO: Replace the container name with a test-specific name
|
# TODO: Replace the container name with a test-specific name
|
||||||
@@ -93,7 +93,7 @@ function validate_microservices() {
|
|||||||
function validate_megaservice() {
|
function validate_megaservice() {
|
||||||
# Curl the Mega Service
|
# Curl the Mega Service
|
||||||
validate_services \
|
validate_services \
|
||||||
"${ip_address}:6666/v1/codegen" \
|
"${ip_address}:7778/v1/codegen" \
|
||||||
"print" \
|
"print" \
|
||||||
"mega-codegen" \
|
"mega-codegen" \
|
||||||
"codegen-gaudi-backend-server" \
|
"codegen-gaudi-backend-server" \
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ function start_services() {
|
|||||||
export HUGGINGFACEHUB_API_TOKEN=${HUGGINGFACEHUB_API_TOKEN}
|
export HUGGINGFACEHUB_API_TOKEN=${HUGGINGFACEHUB_API_TOKEN}
|
||||||
export MEGA_SERVICE_HOST_IP=${ip_address}
|
export MEGA_SERVICE_HOST_IP=${ip_address}
|
||||||
export LLM_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
|
# Start Docker Containers
|
||||||
# TODO: Replace the container name with a test-specific name
|
# TODO: Replace the container name with a test-specific name
|
||||||
@@ -91,7 +91,7 @@ function validate_microservices() {
|
|||||||
function validate_megaservice() {
|
function validate_megaservice() {
|
||||||
# Curl the Mega Service
|
# Curl the Mega Service
|
||||||
validate_services \
|
validate_services \
|
||||||
"${ip_address}:6666/v1/codegen" \
|
"${ip_address}:7778/v1/codegen" \
|
||||||
"print" \
|
"print" \
|
||||||
"mega-codegen" \
|
"mega-codegen" \
|
||||||
"codegen-xeon-backend-server" \
|
"codegen-xeon-backend-server" \
|
||||||
|
|||||||
Reference in New Issue
Block a user