Skip to content

Commit ad2617b

Browse files
committed
Switch to non-containerised ollama in CI tests
1 parent 1542953 commit ad2617b

File tree

3 files changed

+27
-17
lines changed

3 files changed

+27
-17
lines changed

.github/workflows/test-pr.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ jobs:
6969
7070
- name: Run Gradio app tests
7171
run: |
72+
curl -fsSL https://ollama.com/install.sh | sh
7273
./test-images.sh $(git rev-parse --short ${{ github.sha }})
7374
working-directory: web-apps
7475

web-apps/chat/defaults.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11

22
# Default target is a local ollama instance
3-
# running inside the same docker network
43
model_name: smollm2:135m
5-
backend_url: http://ollama:11434
4+
backend_url: http://localhost:11434
65

76
host_address: 0.0.0.0
87

web-apps/test-images.sh

Lines changed: 25 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,12 @@ test() {
4141

4242
if [[ -f $1/test.py ]]; then
4343

44-
DOCKER_NET_NAME=azimuth-llm-shared
45-
if [[ ! $(docker network ls | grep $DOCKER_NET_NAME) ]]; then
46-
docker network create $DOCKER_NET_NAME
47-
fi
44+
DOCKER_NET_NAME=host
45+
46+
# DOCKER_NET_NAME=azimuth-llm-shared
47+
# if [[ ! $(docker network ls | grep $DOCKER_NET_NAME) ]]; then
48+
# docker network create $DOCKER_NET_NAME
49+
# fi
4850

4951
# Ensure app image is available
5052
IMAGE=$(image_name $1):$IMAGE_TAG
@@ -56,13 +58,15 @@ test() {
5658
fi
5759

5860
# Ensure Ollama instance is available
59-
if [[ $(curl -s localhost:11434) == "Ollama is running" ]]; then
60-
log "Using existing ollama process running on localhost:11434"
61-
else
62-
log "Ollama process not running - starting containerised server"
63-
docker run --rm --network $DOCKER_NET_NAME -d -v ollama:/root/.ollama -p 11434:11434 --name ollama ollama/ollama
64-
sleep 3
65-
docker exec ollama ollama pull smollm2:135m
61+
if [[ $(curl -s localhost:11434) != "Ollama is running" ]]; then
62+
log "Ollama not running on localhost:11434 - aborting test"
63+
exit 1
64+
# log "Using existing ollama process running on localhost:11434"
65+
# else
66+
# log "Ollama process not running - starting containerised server"
67+
# docker run --rm --network $DOCKER_NET_NAME -d -v ollama:/root/.ollama -p 11434:11434 --name ollama ollama/ollama
68+
# sleep 3
69+
# docker exec ollama ollama pull smollm2:135m
6670
fi
6771

6872
log "Starting Gradio app container"
@@ -72,17 +76,23 @@ test() {
7276
sleep 10
7377

7478
log "Running tests"
79+
# docker run --network $DOCKER_NET_NAME --rm \
80+
# --name $1-test-suite \
81+
# -e GRADIO_URL=http://$1-app:7860 --entrypoint python \
82+
# $IMAGE \
83+
# test.py
7584
docker run --network $DOCKER_NET_NAME --rm \
7685
--name $1-test-suite \
77-
-e GRADIO_URL=http://$1-app:7860 --entrypoint python \
86+
--entrypoint python \
7887
$IMAGE \
7988
test.py
8089

8190
log "Removing containers:"
82-
docker rm -f ollama $1-app
91+
# docker rm -f ollama $1-app
92+
docker rm -f $1-app
8393

84-
log "Removing docker network:"
85-
docker network rm $DOCKER_NET_NAME
94+
# log "Removing docker network:"
95+
# docker network rm $DOCKER_NET_NAME
8696

8797
echo
8898
echo "----- Tests succeed -----"

0 commit comments

Comments
 (0)