Skip to content

Commit 56ad272

Browse files
committed
add cpu xeon test
Signed-off-by: Mustafa <[email protected]>
1 parent 251991a commit 56ad272

File tree

3 files changed

+44
-15
lines changed

3 files changed

+44
-15
lines changed

CodeGen/docker_compose/intel/cpu/xeon/compose.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ services:
111111
- MEGA_SERVICE_PORT=${MEGA_SERVICE_PORT}
112112
- host_ip=${host_ip}
113113
- DATAPREP_ENDPOINT=${DATAPREP_ENDPOINT}
114+
- DATAPREP_REDIS_PORT=${DATAPREP_REDIS_PORT}
114115
ipc: host
115116
restart: always
116117
redis-vector-db:

CodeGen/tests/test_compose_on_xeon.sh

Lines changed: 43 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ function build_docker_images() {
2929
fi
3030

3131
cd $WORKPATH/docker_image_build
32-
git clone --depth 1 --branch ${opea_branch} https://github.com/opea-project/GenAIComps.git
32+
# git clone --depth 1 --branch ${opea_branch} https://github.com/opea-project/GenAIComps.git
3333

3434
git clone https://github.com/vllm-project/vllm.git && cd vllm
3535
VLLM_VER="$(git describe --tags "$(git rev-list --tags --max-count=1)" )"
@@ -82,23 +82,35 @@ function validate_services() {
8282
local DOCKER_NAME="$4"
8383
local INPUT_DATA="$5"
8484

85-
local HTTP_STATUS=$(curl -s -o /dev/null -w "%{http_code}" -X POST -d "$INPUT_DATA" -H 'Content-Type: application/json' "$URL")
86-
if [ "$HTTP_STATUS" -eq 200 ]; then
87-
echo "[ $SERVICE_NAME ] HTTP status is 200. Checking content..."
85+
if [[ "$SERVICE_NAME" == "ingest" ]]; then
86+
local HTTP_STATUS=$(curl -s -o /dev/null -w "%{http_code}" -X POST -F "$INPUT_DATA" -F index_name=test_redis -H 'Content-Type: multipart/form-data' "$URL")
8887

89-
local CONTENT=$(curl -s -X POST -d "$INPUT_DATA" -H 'Content-Type: application/json' "$URL" | tee ${LOG_PATH}/${SERVICE_NAME}.log)
88+
if [ "$HTTP_STATUS" -eq 200 ]; then
89+
echo "[ $SERVICE_NAME ] HTTP status is 200. Data preparation succeeded..."
90+
else
91+
echo "[ $SERVICE_NAME ] Data preparation failed..."
92+
fi
93+
94+
else
95+
96+
local HTTP_STATUS=$(curl -s -o /dev/null -w "%{http_code}" -X POST -d "$INPUT_DATA" -H 'Content-Type: application/json' "$URL")
97+
if [ "$HTTP_STATUS" -eq 200 ]; then
98+
echo "[ $SERVICE_NAME ] HTTP status is 200. Checking content..."
9099

91-
if echo "$CONTENT" | grep -q "$EXPECTED_RESULT"; then
92-
echo "[ $SERVICE_NAME ] Content is as expected."
100+
local CONTENT=$(curl -s -X POST -d "$INPUT_DATA" -H 'Content-Type: application/json' "$URL" | tee ${LOG_PATH}/${SERVICE_NAME}.log)
101+
102+
if echo "$CONTENT" | grep -q "$EXPECTED_RESULT"; then
103+
echo "[ $SERVICE_NAME ] Content is as expected."
104+
else
105+
echo "[ $SERVICE_NAME ] Content does not match the expected result: $CONTENT"
106+
docker logs ${DOCKER_NAME} >> ${LOG_PATH}/${SERVICE_NAME}.log
107+
exit 1
108+
fi
93109
else
94-
echo "[ $SERVICE_NAME ] Content does not match the expected result: $CONTENT"
110+
echo "[ $SERVICE_NAME ] HTTP status is not 200. Received status was $HTTP_STATUS"
95111
docker logs ${DOCKER_NAME} >> ${LOG_PATH}/${SERVICE_NAME}.log
96112
exit 1
97113
fi
98-
else
99-
echo "[ $SERVICE_NAME ] HTTP status is not 200. Received status was $HTTP_STATUS"
100-
docker logs ${DOCKER_NAME} >> ${LOG_PATH}/${SERVICE_NAME}.log
101-
exit 1
102114
fi
103115
sleep 5s
104116
}
@@ -122,6 +134,14 @@ function validate_microservices() {
122134
"llm-textgen-server" \
123135
'{"query":"def print_hello_world():", "max_tokens": 256}'
124136

137+
# Data ingest microservice
138+
validate_services \
139+
"${ip_address}:6007/v1/dataprep/ingest" \
140+
"Data preparation succeeded" \
141+
"ingest" \
142+
"dataprep-redis-server" \
143+
'link_list=["https://www.ces.tech/", "https://modin.readthedocs.io/en/latest/index.html"]'
144+
125145
}
126146

127147
function validate_megaservice() {
@@ -133,6 +153,14 @@ function validate_megaservice() {
133153
"codegen-xeon-backend-server" \
134154
'{"messages": "def print_hello_world():", "max_tokens": 256}'
135155

156+
# Curl the Mega Service with index_name and agents_flag
157+
validate_services \
158+
"${ip_address}:7778/v1/codegen" \
159+
"print" \
160+
"mega-codegen" \
161+
"codegen-xeon-backend-server" \
162+
'{ "index_name": "test_redis", "agents_flag": "True", "messages": "def print_hello_world():", "max_tokens": 256}'
163+
136164
}
137165

138166
function validate_frontend() {
@@ -191,7 +219,7 @@ function main() {
191219
stop_docker "${docker_compose_profiles[${i}]}"
192220
done
193221

194-
# build docker images
222+
# # build docker images
195223
if [[ "$IMAGE_REPO" == "opea" ]]; then build_docker_images; fi
196224

197225
# loop all profiles
@@ -202,7 +230,7 @@ function main() {
202230

203231
validate_microservices "${docker_llm_container_names[${i}]}"
204232
validate_megaservice
205-
validate_frontend
233+
# validate_frontend
206234

207235
stop_docker "${docker_compose_profiles[${i}]}"
208236
sleep 5s
@@ -212,3 +240,4 @@ function main() {
212240
}
213241

214242
main
243+

CodeGen/ui/gradio/codegen_ui_gradio.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
import os
1010
from pathlib import Path
1111
import gradio as gr
12-
from gradio_pdf import PDF
1312
import requests
1413
import pandas as pd
1514
import os

0 commit comments

Comments
 (0)