Enable nginx for VisualQnA (#754)
Signed-off-by: lvliang-intel <liang1.lv@intel.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
@@ -19,7 +19,7 @@ function build_docker_images() {
|
||||
git clone https://github.com/opea-project/GenAIComps.git
|
||||
|
||||
echo "Build all the images with --no-cache, check docker_image_build.log for details..."
|
||||
service_list="visualqna visualqna-ui llm-visualqna-tgi"
|
||||
service_list="visualqna visualqna-ui llm-visualqna-tgi nginx"
|
||||
docker compose -f docker_build_compose.yaml build ${service_list} --no-cache > ${LOG_PATH}/docker_image_build.log
|
||||
|
||||
docker pull ghcr.io/huggingface/tgi-gaudi:2.0.4
|
||||
@@ -36,6 +36,12 @@ function start_services() {
|
||||
export MEGA_SERVICE_HOST_IP=${ip_address}
|
||||
export LVM_SERVICE_HOST_IP=${ip_address}
|
||||
export BACKEND_SERVICE_ENDPOINT="http://${ip_address}:8888/v1/visualqna"
|
||||
export FRONTEND_SERVICE_IP=${ip_address}
|
||||
export FRONTEND_SERVICE_PORT=5173
|
||||
export BACKEND_SERVICE_NAME=visualqna
|
||||
export BACKEND_SERVICE_IP=${ip_address}
|
||||
export BACKEND_SERVICE_PORT=8888
|
||||
export NGINX_PORT=80
|
||||
|
||||
sed -i "s/backend_address/$ip_address/g" $WORKPATH/docker/ui/svelte/.env
|
||||
|
||||
@@ -120,6 +126,33 @@ function validate_megaservice() {
|
||||
],
|
||||
"max_tokens": 300
|
||||
}'
|
||||
|
||||
# test the megeservice via nginx
|
||||
validate_services \
|
||||
"${ip_address}:80/v1/visualqna" \
|
||||
"The image" \
|
||||
"visualqna-gaudi-nginx-server" \
|
||||
"visualqna-gaudi-nginx-server" \
|
||||
'{
|
||||
"messages": [
|
||||
{
|
||||
"role": "user",
|
||||
"content": [
|
||||
{
|
||||
"type": "text",
|
||||
"text": "What'\''s in this image?"
|
||||
},
|
||||
{
|
||||
"type": "image_url",
|
||||
"image_url": {
|
||||
"url": "https://www.ilankelman.org/stopsigns/australia.jpg"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"max_tokens": 300
|
||||
}'
|
||||
}
|
||||
|
||||
function validate_frontend() {
|
||||
|
||||
@@ -19,7 +19,7 @@ function build_docker_images() {
|
||||
git clone https://github.com/opea-project/GenAIComps.git
|
||||
|
||||
echo "Build all the images with --no-cache, check docker_image_build.log for details..."
|
||||
service_list="visualqna visualqna-ui llm-visualqna-tgi"
|
||||
service_list="visualqna visualqna-ui llm-visualqna-tgi nginx"
|
||||
docker compose -f docker_build_compose.yaml build ${service_list} --no-cache > ${LOG_PATH}/docker_image_build.log
|
||||
|
||||
docker pull ghcr.io/huggingface/text-generation-inference:2.2.0
|
||||
@@ -36,6 +36,12 @@ function start_services() {
|
||||
export MEGA_SERVICE_HOST_IP=${ip_address}
|
||||
export LVM_SERVICE_HOST_IP=${ip_address}
|
||||
export BACKEND_SERVICE_ENDPOINT="http://${ip_address}:8888/v1/visualqna"
|
||||
export FRONTEND_SERVICE_IP=${ip_address}
|
||||
export FRONTEND_SERVICE_PORT=5173
|
||||
export BACKEND_SERVICE_NAME=visualqna
|
||||
export BACKEND_SERVICE_IP=${ip_address}
|
||||
export BACKEND_SERVICE_PORT=8888
|
||||
export NGINX_PORT=80
|
||||
|
||||
sed -i "s/backend_address/$ip_address/g" $WORKPATH/docker/ui/svelte/.env
|
||||
|
||||
@@ -120,6 +126,33 @@ function validate_megaservice() {
|
||||
],
|
||||
"max_tokens": 300
|
||||
}'
|
||||
|
||||
# test the megeservice via nginx
|
||||
validate_services \
|
||||
"${ip_address}:80/v1/visualqna" \
|
||||
"The image" \
|
||||
"visualqna-xeon-nginx-server" \
|
||||
"visualqna-xeon-nginx-server" \
|
||||
'{
|
||||
"messages": [
|
||||
{
|
||||
"role": "user",
|
||||
"content": [
|
||||
{
|
||||
"type": "text",
|
||||
"text": "What'\''s in this image?"
|
||||
},
|
||||
{
|
||||
"type": "image_url",
|
||||
"image_url": {
|
||||
"url": "https://www.ilankelman.org/stopsigns/australia.jpg"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"max_tokens": 300
|
||||
}'
|
||||
}
|
||||
|
||||
function validate_frontend() {
|
||||
|
||||
Reference in New Issue
Block a user