-
Notifications
You must be signed in to change notification settings - Fork 338
add test script #2199
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add test script #2199
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,184 @@ | ||||||||||||||
| #!/bin/bash | ||||||||||||||
| # Copyright (C) 2024 Intel Corporation | ||||||||||||||
| # SPDX-License-Identifier: Apache-2.0 | ||||||||||||||
|
|
||||||||||||||
| set -xe | ||||||||||||||
| IMAGE_REPO=${IMAGE_REPO:-"opea"} | ||||||||||||||
| IMAGE_TAG=${IMAGE_TAG:-"latest"} | ||||||||||||||
| echo "REGISTRY=IMAGE_REPO=${IMAGE_REPO}" | ||||||||||||||
| echo "TAG=IMAGE_TAG=${IMAGE_TAG}" | ||||||||||||||
| export REGISTRY=${IMAGE_REPO} | ||||||||||||||
| export TAG=${IMAGE_TAG} | ||||||||||||||
| export MODEL_CACHE=${model_cache:-"./data"} | ||||||||||||||
|
|
||||||||||||||
| WORKPATH=$(dirname "$PWD") | ||||||||||||||
| LOG_PATH="$WORKPATH/tests" | ||||||||||||||
| ip_address=$(hostname -I | awk '{print $1}') | ||||||||||||||
|
|
||||||||||||||
| function build_docker_images() { | ||||||||||||||
| opea_branch=${opea_branch:-"main"} | ||||||||||||||
| cd $WORKPATH/docker_image_build | ||||||||||||||
| git clone --depth 1 --branch ${opea_branch} https://github.com/opea-project/GenAIComps.git | ||||||||||||||
| pushd GenAIComps | ||||||||||||||
| echo "GenAIComps test commit is $(git rev-parse HEAD)" | ||||||||||||||
| docker build --no-cache -t ${REGISTRY}/comps-base:${TAG} --build-arg https_proxy=$https_proxy --build-arg http_proxy=$http_proxy -f Dockerfile . | ||||||||||||||
| popd && sleep 1s | ||||||||||||||
|
|
||||||||||||||
| echo "Build all the images with --no-cache, check docker_image_build.log for details..." | ||||||||||||||
| service_list="chatqna chatqna-ui dataprep retriever nginx" | ||||||||||||||
| docker compose -f build.yaml build ${service_list} --no-cache > ${LOG_PATH}/docker_image_build.log | ||||||||||||||
| docker run --env "VLLM_SKIP_WARMUP=true" -p 8000:8000 --ipc=host public.ecr.aws/q9t5s3a7/vllm-cpu-release-repo:v0.9.2 --model TinyLlama/TinyLlama-1.1B-Chat-v1.0 --api-key $TEST_KEY | ||||||||||||||
srinarayan-srikanthan marked this conversation as resolved.
Show resolved
Hide resolved
srinarayan-srikanthan marked this conversation as resolved.
Show resolved
Hide resolved
srinarayan-srikanthan marked this conversation as resolved.
Show resolved
Hide resolved
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why this docker run command inside docker build function? you could move it to start services and do sleep in between. |
||||||||||||||
| docker images && sleep 1s | ||||||||||||||
|
||||||||||||||
| docker images && sleep 1s | |
| VLLM_CONTAINER_ID=$(docker run -d --env "VLLM_SKIP_WARMUP=true" -p 8000:8000 --ipc=host public.ecr.aws/q9t5s3a7/vllm-cpu-release-repo:v0.9.2 --model TinyLlama/TinyLlama-1.1B-Chat-v1.0 --api-key $TEST_KEY) | |
| docker images && sleep 1s | |
| # Stop and remove the container after use | |
| docker stop $VLLM_CONTAINER_ID | |
| docker rm $VLLM_CONTAINER_ID |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add logic to wait for the longest docker container to spin up, usually the backend service. example: https://github.com/opea-project/GenAIExamples/blob/main/ChatQnA/tests/test_compose_on_xeon.sh#L47
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add a line to stop the vllm-cpu docker container
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The echo statements are displaying variable names instead of values. Should be
echo "REGISTRY=${IMAGE_REPO}"andecho "TAG=${IMAGE_TAG}"