Skip to content

Commit

Permalink
tests: use docker image for model conversion
Browse files Browse the repository at this point in the history
by using the newly build docker image, we avoid creating a fairly
large (~5GB) venv
  • Loading branch information
dtrifiro committed Oct 24, 2023
1 parent fef220d commit c9ba3f3
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
2 changes: 1 addition & 1 deletion test/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
services:
caikit:
# image: quay.io/opendatahub/caikit:latest
image: quay.io/opendatahub/caikit-tgis-serving:dev
build: ..
volumes:
- ./caikit_config:/caikit/config
Expand Down
22 changes: 13 additions & 9 deletions test/smoke-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,29 @@ function command_required() {
fi
}

command_required python3
command_required docker-compose
command_required git-lfs

if [[ ! -d .venv ]]; then
python -m venv .venv || (echo "Failed to create venv. Quitting." >&2 && exit 1)
fi
source .venv/bin/activate || (echo "Could not source venv. Quitting" >&2 && exit 1)

pip install git+https://github.com/caikit/caikit-nlp
if [[ ! -d flan-t5-small ]]; then
git clone https://huggingface.co/google/flan-t5-small
fi

mkdir -p models/
../utils/convert.py --model-path flan-t5-small --model-save-path models/flan-t5-small-caikit/

docker-compose build

# use the container's environment to convert the model to caikit format
docker run --user root \
-v $PWD/caikit_config:/caikit/config/ \
-v $PWD/flan-t5-small:/mnt/flan-t5-small \
-v $PWD/../utils:/utils \
-v $PWD/models/:/models quay.io/opendatahub/caikit-tgis-serving:dev \
/utils/convert.py --model-path /mnt/flan-t5-small --model-save-path /mnt/models/flan-t5-small-caikit0w/
echo "Saved caikit model to ./models/"

if [[ -n $CI ]]; then # Free up some space on CI
rm -rf flan-t5-small
fi

docker-compose up -d

max_retries=10
Expand Down

0 comments on commit c9ba3f3

Please sign in to comment.