Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/github_actions/github-actions-533…
Browse files Browse the repository at this point in the history
…f70582a
  • Loading branch information
sd109 authored Nov 14, 2024
2 parents 711617e + 8c7404d commit 44b64a4
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions web-apps/test-images.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,12 @@ test() {
if [[ -f $1/test.py ]]; then

# Ensure app image is available
IMAGE_NAME=$(image_name $1)
IMAGE=$(image_name $1):$IMAGE_TAG
if [[ $IMAGE_TAG == "latest" ]]; then
build $1
else
log "Pulling image $IMAGE_NAME:$IMAGE_TAG"
docker pull $IMAGE_NAME:$IMAGE_TAG
log "Pulling image $IMAGE"
docker pull $IMAGE
fi

# Ensure Ollama instance is available
Expand All @@ -66,13 +66,17 @@ test() {
fi

log "Starting Gradio app container"
docker run --network $DOCKER_NET_NAME -d --name $1-app $IMAGE_NAME
docker run --network $DOCKER_NET_NAME -d --name $1-app $IMAGE

# Give the app time to start
sleep 3

log "Running tests"
docker run --network $DOCKER_NET_NAME --rm --name $1-test-suite -e GRADIO_URL=http://$1-app:7860 --entrypoint python $IMAGE_NAME test.py
docker run --network $DOCKER_NET_NAME --rm \
--name $1-test-suite \
-e GRADIO_URL=http://$1-app:7860 --entrypoint python \
$IMAGE \
test.py

log "Removing containers:"
docker rm -f ollama $1-app
Expand Down

0 comments on commit 44b64a4

Please sign in to comment.