Skip to content

Commit 929a118

Browse files
author
Noa Limoy
committed
ci: optimize docker integration tests with minimal compose
Replace heavy quickstart.sh full-stack deployment with lightweight CI-specific docker-compose configuration. Changes: - Add docker-compose.ci.yml with only 3 essential services (semantic-router, envoy, llm-katan) instead of 11+ services - Remove UI services (grafana, openwebui, chat-ui, prometheus, jaeger, dashboard, mongo, pipelines) - not needed for CI testing - Replace UI-based validation with simple curl health checks - Add make targets: docker-compose-{up,down,logs,ps}-ci - Reduce CI timeout from 30 to 20 minutes This fixes frequent CI timeouts caused by pulling many heavy container images from multiple registries on GitHub-hosted runners which have no persistent Docker cache. Fixes: #777 Signed-off-by: Noa Limoy <[email protected]>
1 parent 69ee0b3 commit 929a118

File tree

3 files changed

+212
-26
lines changed

3 files changed

+212
-26
lines changed

.github/workflows/integration-test-docker.yml

Lines changed: 93 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ concurrency:
2121
cancel-in-progress: true
2222

2323
jobs:
24-
test-quickstart:
24+
test-ci-compose:
2525
if: github.repository == 'vllm-project/semantic-router' && !github.event.pull_request.draft
2626
runs-on: ubuntu-latest
27-
timeout-minutes: 30
27+
timeout-minutes: 20 # Reduced from 30 - CI compose is faster
2828

2929
steps:
3030
- name: Check out the repo
@@ -46,33 +46,93 @@ jobs:
4646
with:
4747
python-version: '3.11'
4848

49-
- name: Install system dependencies
49+
- name: Install dependencies
5050
run: |
5151
sudo apt-get update
52-
sudo apt-get install -y \
53-
make \
54-
curl \
55-
docker-compose
52+
sudo apt-get install -y make curl
53+
pip install huggingface_hub[cli]
5654
57-
- name: Run quickstart script
58-
id: quickstart
55+
- name: Download models
5956
run: |
60-
timeout 1200 bash scripts/quickstart.sh || {
61-
exit_code=$?
62-
if [ $exit_code -eq 124 ]; then
63-
echo "::error::Quickstart script timed out after 20 minutes"
64-
else
65-
echo "::error::Quickstart script failed with exit code $exit_code"
66-
fi
67-
exit $exit_code
68-
}
57+
echo "Downloading minimal models for CI..."
58+
make download-models
6959
env:
7060
CI: true
7161
CI_MINIMAL_MODELS: true
72-
TERM: xterm
7362
HF_HUB_ENABLE_HF_TRANSFER: 1
7463
HF_HUB_DISABLE_TELEMETRY: 1
7564

65+
- name: Start CI services
66+
run: |
67+
echo "Starting minimal CI services (semantic-router, envoy, llm-katan)..."
68+
make docker-compose-up-ci
69+
env:
70+
CI: true
71+
72+
- name: Wait for services to be healthy
73+
run: |
74+
echo "Waiting for services to be healthy..."
75+
max_attempts=60
76+
attempt=1
77+
78+
while [ $attempt -le $max_attempts ]; do
79+
echo "Attempt $attempt/$max_attempts: Checking service health..."
80+
81+
# Check semantic-router health
82+
if docker ps --filter "name=semantic-router" --filter "health=healthy" --format "{{.Names}}" | grep -q "semantic-router"; then
83+
echo "✅ semantic-router is healthy"
84+
85+
# Check envoy health
86+
if docker ps --filter "name=envoy-proxy" --filter "health=healthy" --format "{{.Names}}" | grep -q "envoy-proxy"; then
87+
echo "✅ envoy-proxy is healthy"
88+
89+
# Check llm-katan health
90+
if docker ps --filter "name=llm-katan" --filter "health=healthy" --format "{{.Names}}" | grep -q "llm-katan"; then
91+
echo "✅ llm-katan is healthy"
92+
echo "🎉 All services are healthy!"
93+
exit 0
94+
fi
95+
fi
96+
fi
97+
98+
# Show current status
99+
docker ps --format "table {{.Names}}\t{{.Status}}" | grep -E "NAMES|semantic-router|envoy|llm-katan" || true
100+
101+
sleep 5
102+
((attempt++))
103+
done
104+
105+
echo "❌ Timeout waiting for services to be healthy"
106+
docker ps -a
107+
exit 1
108+
109+
- name: Test semantic router health endpoint
110+
run: |
111+
echo "Testing semantic router health..."
112+
curl -f http://localhost:8080/health || {
113+
echo "❌ Health check failed"
114+
exit 1
115+
}
116+
echo "✅ Health check passed"
117+
118+
- name: Test envoy proxy endpoint
119+
run: |
120+
echo "Testing envoy proxy..."
121+
curl -f http://localhost:19000/ready || {
122+
echo "❌ Envoy ready check failed"
123+
exit 1
124+
}
125+
echo "✅ Envoy is ready"
126+
127+
- name: Test llm-katan endpoint
128+
run: |
129+
echo "Testing llm-katan..."
130+
curl -f http://localhost:8002/health || {
131+
echo "❌ LLM-Katan health check failed"
132+
exit 1
133+
}
134+
echo "✅ LLM-Katan is healthy"
135+
76136
- name: Test semantic routing functionality
77137
run: |
78138
echo "Testing semantic router with a sample query..."
@@ -85,24 +145,31 @@ jobs:
85145
"temperature": 0.7
86146
}')
87147
88-
echo "Full response: $response"
148+
echo "Response: $response"
149+
150+
# Verify we got a response
151+
if echo "$response" | grep -q "choices"; then
152+
echo "✅ Chat completions test passed"
153+
else
154+
echo "⚠️ Response may not contain expected fields, but request succeeded"
155+
fi
89156
90157
- name: Show service logs on failure
91158
if: failure()
92159
run: |
93160
echo "=== Docker Compose Logs ==="
94-
docker compose -f deploy/docker-compose/docker-compose.yml logs
161+
make docker-compose-logs-ci || docker compose -f deploy/docker-compose/docker-compose.ci.yml logs
95162
echo "=== Container Status ==="
96163
docker ps -a
97164
echo "=== Semantic Router Logs ==="
98-
docker logs semantic-router || true
165+
docker logs semantic-router 2>&1 | tail -100 || true
99166
echo "=== Envoy Logs ==="
100-
docker logs envoy-proxy || true
101-
echo "=== Dashboard Logs ==="
102-
docker logs semantic-router-dashboard || true
167+
docker logs envoy-proxy 2>&1 | tail -100 || true
168+
echo "=== LLM-Katan Logs ==="
169+
docker logs llm-katan 2>&1 | tail -100 || true
103170
104171
- name: Clean up
105172
if: always()
106173
run: |
107-
make docker-compose-down || true
174+
make docker-compose-down-ci || true
108175
docker system prune -af --volumes || true
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
# Minimal Docker Compose for CI testing
2+
# This file contains only essential services needed for integration testing.
3+
# Excludes: grafana, prometheus, jaeger, openwebui, chat-ui, pipelines, mongo, dashboard
4+
#
5+
# Usage:
6+
# make docker-compose-up-ci
7+
# # or directly:
8+
# docker compose -f deploy/docker-compose/docker-compose.ci.yml up -d
9+
10+
services:
11+
12+
# Semantic Router External Processor Service
13+
semantic-router:
14+
image: ghcr.io/vllm-project/semantic-router/extproc:latest
15+
container_name: semantic-router
16+
ports:
17+
- "50051:50051" # gRPC for ExtProc
18+
- "8080:8080" # HTTP API (health, classify, metrics)
19+
volumes:
20+
- ../../config:/app/config:ro,z
21+
- ../../models:/app/models:ro,z
22+
- ~/.cache/huggingface:/root/.cache/huggingface:z
23+
environment:
24+
- LD_LIBRARY_PATH=/app/lib
25+
- CONFIG_FILE=${CONFIG_FILE:-/app/config/config.yaml}
26+
- HUGGINGFACE_HUB_CACHE=/root/.cache/huggingface
27+
- HF_HUB_ENABLE_HF_TRANSFER=1
28+
networks:
29+
- semantic-network
30+
healthcheck:
31+
test: ["CMD", "curl", "-f", "localhost:8080/health"]
32+
interval: 10s
33+
timeout: 5s
34+
retries: 5
35+
start_period: 30s
36+
37+
# Envoy Proxy Service
38+
envoy:
39+
image: envoyproxy/envoy:v1.31.7
40+
container_name: envoy-proxy
41+
security_opt:
42+
- label=disable
43+
ports:
44+
- "8801:8801" # Main proxy port
45+
- "19000:19000" # Admin interface
46+
volumes:
47+
- ./addons/envoy.yaml:/etc/envoy/envoy.yaml:ro,z
48+
command: ["/usr/local/bin/envoy", "-c", "/etc/envoy/envoy.yaml", "--component-log-level", "ext_proc:debug,router:debug"]
49+
depends_on:
50+
semantic-router:
51+
condition: service_healthy
52+
networks:
53+
- semantic-network
54+
healthcheck:
55+
test: ["CMD", "bash", "-c", "(echo -e 'GET /ready HTTP/1.1\\r\\nHost: localhost\\r\\n\\r\\n' >&3; timeout 2 cat <&3) 3<>/dev/tcp/localhost/19000 | grep -q LIVE"]
56+
interval: 10s
57+
timeout: 5s
58+
retries: 5
59+
start_period: 10s
60+
61+
# LLM Katan service - lightweight mock LLM for testing
62+
llm-katan:
63+
image: ghcr.io/vllm-project/semantic-router/llm-katan:latest
64+
container_name: llm-katan
65+
ports:
66+
- "8002:8002"
67+
environment:
68+
- HF_HUB_ENABLE_HF_TRANSFER=1
69+
volumes:
70+
- ../../models:/app/models:ro,z
71+
- hf-cache:/home/llmkatan/.cache/huggingface
72+
networks:
73+
semantic-network:
74+
ipv4_address: 172.28.0.20
75+
command: ["llm-katan", "--model", "/app/models/Qwen/Qwen3-0.6B", "--served-model-name", "qwen3", "--host", "0.0.0.0", "--port", "8002"]
76+
healthcheck:
77+
test: ["CMD", "curl", "-fsS", "http://localhost:8002/health"]
78+
interval: 10s
79+
timeout: 5s
80+
retries: 5
81+
start_period: 10s
82+
83+
networks:
84+
semantic-network:
85+
driver: bridge
86+
ipam:
87+
config:
88+
- subnet: 172.28.0.0/16
89+
90+
volumes:
91+
hf-cache:
92+

tools/make/docker.mk

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,33 @@ docker-compose-down-llm-katan:
179179
@echo "Stopping services with $(COMPOSE_CMD) (llm-katan profile)..."
180180
@$(COMPOSE_CMD) --profile llm-katan down
181181

182+
##@ CI Docker Compose (minimal services for CI testing)
183+
184+
# CI compose file path
185+
CI_COMPOSE_FILE ?= deploy/docker-compose/docker-compose.ci.yml
186+
187+
docker-compose-up-ci: ## Start minimal CI services (semantic-router, envoy, llm-katan)
188+
docker-compose-up-ci:
189+
@$(LOG_TARGET)
190+
@echo "Starting CI services with $(COMPOSE_CMD) (minimal for CI)..."
191+
@$(COMPOSE_CMD) -f $(CI_COMPOSE_FILE) up -d
192+
193+
docker-compose-down-ci: ## Stop CI services
194+
docker-compose-down-ci:
195+
@$(LOG_TARGET)
196+
@echo "Stopping CI services with $(COMPOSE_CMD)..."
197+
@$(COMPOSE_CMD) -f $(CI_COMPOSE_FILE) down
198+
199+
docker-compose-logs-ci: ## Show logs for CI services
200+
docker-compose-logs-ci:
201+
@$(LOG_TARGET)
202+
@$(COMPOSE_CMD) -f $(CI_COMPOSE_FILE) logs
203+
204+
docker-compose-ps-ci: ## Show status of CI services
205+
docker-compose-ps-ci:
206+
@$(LOG_TARGET)
207+
@$(COMPOSE_CMD) -f $(CI_COMPOSE_FILE) ps
208+
182209
# Help target for Docker commands
183210
docker-help:
184211
docker-help: ## Show help for Docker-related make targets and environment variables

0 commit comments

Comments
 (0)