Skip to content

Commit 9d487a2

Browse files
authored
Merge pull request #126 from stackhpc/ci-stability-improvements
CI stability improvements
2 parents a580b2c + c5ce8a9 commit 9d487a2

File tree

8 files changed

+55
-25
lines changed

8 files changed

+55
-25
lines changed

.github/workflows/test-pr.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,17 @@ jobs:
6969
7070
- name: Run Gradio app tests
7171
run: |
72+
echo "Installing ollama..."
73+
curl -fsSL https://ollama.com/install.sh | sh
74+
75+
# Give ollama systemd unit time to start
76+
sleep 5
77+
78+
MODEL=smollm2:135m
79+
echo "Pulling model $MODEL..."
80+
ollama pull $MODEL
81+
82+
echo "Running Gradio test script"
7283
./test-images.sh $(git rev-parse --short ${{ github.sha }})
7384
working-directory: web-apps
7485

charts/azimuth-llm/ci/default-values.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ api:
1010
enabled: false
1111
# No GPUs in CI runners
1212
gpus: 0
13+
# Limit context length for efficiency
14+
modelMaxContextLength: 100
1315
ui:
1416
service:
1517
zenith:

web-apps/chat/Dockerfile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
FROM python:3.11-slim
1+
FROM ghcr.io/astral-sh/uv:python3.11-bookworm-slim
22

33
ARG DIR=chat
44

55
COPY $DIR/requirements.txt requirements.txt
6+
RUN sed -i s$../utils$./utils$ requirements.txt
67
COPY utils utils
7-
RUN pip install --no-cache-dir -r requirements.txt
8+
RUN uv pip install --system --no-cache-dir -r requirements.txt
89

910
COPY purge-google-fonts.sh purge-google-fonts.sh
1011
RUN bash purge-google-fonts.sh

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/chat/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
gradio<6
22
gradio_client
33
openai
4-
langchain
4+
langchain<1.0
55
langchain_openai
66
pydantic
77
structlog

web-apps/flux-image-gen/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM python:3.11
1+
FROM ghcr.io/astral-sh/uv:python3.11-bookworm
22

33
# https://stackoverflow.com/questions/55313610/importerror-libgl-so-1-cannot-open-shared-object-file-no-such-file-or-directo
44
RUN apt-get update && apt-get install ffmpeg libsm6 libxext6 -y
@@ -7,7 +7,7 @@ RUN apt-get update && apt-get install ffmpeg libsm6 libxext6 -y
77
ARG DIR=flux-image-gen
88

99
COPY $DIR/requirements.txt requirements.txt
10-
RUN pip install --no-cache-dir -r requirements.txt
10+
RUN uv pip install --system --no-cache-dir -r requirements.txt
1111

1212
COPY purge-google-fonts.sh .
1313
RUN bash purge-google-fonts.sh

web-apps/image-analysis/Dockerfile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
FROM python:3.11-slim
1+
FROM ghcr.io/astral-sh/uv:python3.11-bookworm-slim
22

33
ARG DIR=image-analysis
44

55
COPY $DIR/requirements.txt requirements.txt
6+
RUN sed -i s$../utils$./utils$ requirements.txt
67
COPY utils utils
7-
RUN pip install --no-cache-dir -r requirements.txt
8+
RUN uv pip install --system --no-cache-dir -r requirements.txt
89

910
COPY purge-google-fonts.sh purge-google-fonts.sh
1011
RUN bash purge-google-fonts.sh

web-apps/test-images.sh

Lines changed: 32 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
#!/bin/bash
22
set -e
33

4+
# NOTE(sd109): This script relies on docker host networking in order
5+
# to communicate from Gradio to ollama running on localhost. This means
6+
# it does not work on MacOS since docker host networking does not work.
7+
# It is intended to be run on a Linux machine and is primarily used in
8+
# GitHub runners as part of CI testing.
9+
410
IMAGE_TAG="${1:-latest}"
511
echo Testing image tag $IMAGE_TAG
612

@@ -41,10 +47,12 @@ test() {
4147

4248
if [[ -f $1/test.py ]]; then
4349

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
50+
DOCKER_NET_NAME=host
51+
52+
# DOCKER_NET_NAME=azimuth-llm-shared
53+
# if [[ ! $(docker network ls | grep $DOCKER_NET_NAME) ]]; then
54+
# docker network create $DOCKER_NET_NAME
55+
# fi
4856

4957
# Ensure app image is available
5058
IMAGE=$(image_name $1):$IMAGE_TAG
@@ -56,33 +64,41 @@ test() {
5664
fi
5765

5866
# 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
67+
if [[ $(curl -s localhost:11434) != "Ollama is running" ]]; then
68+
log "Ollama not running on localhost:11434 - aborting test"
69+
exit 1
70+
# log "Using existing ollama process running on localhost:11434"
71+
# else
72+
# log "Ollama process not running - starting containerised server"
73+
# docker run --rm --network $DOCKER_NET_NAME -d -v ollama:/root/.ollama -p 11434:11434 --name ollama ollama/ollama
74+
# sleep 3
75+
# docker exec ollama ollama pull smollm2:135m
6676
fi
6777

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

7181
# Give the app time to start
72-
sleep 3
82+
sleep 10
7383

7484
log "Running tests"
85+
# docker run --network $DOCKER_NET_NAME --rm \
86+
# --name $1-test-suite \
87+
# -e GRADIO_URL=http://$1-app:7860 --entrypoint python \
88+
# $IMAGE \
89+
# test.py
7590
docker run --network $DOCKER_NET_NAME --rm \
7691
--name $1-test-suite \
77-
-e GRADIO_URL=http://$1-app:7860 --entrypoint python \
92+
--entrypoint python \
7893
$IMAGE \
7994
test.py
8095

8196
log "Removing containers:"
82-
docker rm -f ollama $1-app
97+
# docker rm -f ollama $1-app
98+
docker rm -f $1-app
8399

84-
log "Removing docker network:"
85-
docker network rm $DOCKER_NET_NAME
100+
# log "Removing docker network:"
101+
# docker network rm $DOCKER_NET_NAME
86102

87103
echo
88104
echo "----- Tests succeed -----"

0 commit comments

Comments
 (0)