Skip to content

Commit 22ec867

Browse files
committed
build vllm only once
Signed-off-by: zhihang <[email protected]>
1 parent baf0d49 commit 22ec867

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

tests/llms/test_llms_doc-summarization_vllm.sh

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,24 @@ host_ip=$(hostname -I | awk '{print $1}')
1919
LOG_PATH="$WORKPATH/tests"
2020
service_name="docsum-vllm"
2121

22+
2223
function build_docker_images() {
2324
cd $WORKPATH
24-
source $(git rev-parse --show-toplevel)/.github/env/_vllm_versions.sh
25-
git clone --depth 1 -b ${VLLM_VER} --single-branch https://github.com/vllm-project/vllm.git && cd vllm
26-
docker build --no-cache -f docker/Dockerfile.cpu -t ${REGISTRY:-opea}/vllm:${TAG:-latest} --shm-size=128g .
27-
if [ $? -ne 0 ]; then
28-
echo "opea/vllm built fail"
29-
exit 1
25+
if [[ -z "$(docker images -q ${REGISTRY:-opea}/vllm:${TAG:-latest})" ]]; then
26+
source $(git rev-parse --show-toplevel)/.github/env/_vllm_versions.sh
27+
git clone --depth 1 -b ${VLLM_VER} --single-branch https://github.com/vllm-project/vllm.git && cd vllm
28+
docker build --no-cache -f docker/Dockerfile.cpu -t ${REGISTRY:-opea}/vllm:${TAG:-latest} --shm-size=128g .
29+
if [ $? -ne 0 ]; then
30+
echo "opea/vllm built fail"
31+
exit 1
32+
else
33+
echo "opea/vllm built successful"
34+
fi
3035
else
31-
echo "opea/vllm built successful"
36+
echo "opea/vllm:${TAG:-latest} already exists, skip building."
3237
fi
33-
3438
cd $WORKPATH
39+
3540
dockerfile_name="comps/llms/src/doc-summarization/$1"
3641
docker build --no-cache -t ${REGISTRY:-opea}/llm-docsum:${TAG:-latest} --build-arg https_proxy=$https_proxy --build-arg http_proxy=$http_proxy -f "$dockerfile_name" .
3742
if [ $? -ne 0 ]; then

0 commit comments

Comments
 (0)