Skip to content

Commit 78ab285

Browse files
committed
better CI & add chat-ui and mongo
Signed-off-by: JaredforReal <[email protected]>
1 parent 28d1620 commit 78ab285

File tree

12 files changed

+663
-43
lines changed

12 files changed

+663
-43
lines changed

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

Lines changed: 65 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,16 @@ name: Kubernetes Integration Test
88
# ✅ Service connectivity (gRPC, metrics, API ports)
99
# ✅ Security scanning (Trivy, Checkov)
1010
# ✅ Basic syntax validation for observability and ai-gateway configs
11+
# ✅ kind cluster integration with CI-optimized configuration
1112
#
1213
# Out of Scope (planned for follow-up PRs):
1314
# 🔄 Observability stack deployment (Prometheus + Grafana)
1415
# 🔄 AI Gateway end-to-end testing (Envoy Gateway + InferencePool)
16+
#
17+
# CI Optimizations:
18+
# - Uses CI-specific kind configuration (single node, reduced resources)
19+
# - Generates kind-config.yaml dynamically (no models mount needed)
20+
# - Optimized for GitHub Actions runner constraints
1521

1622
on:
1723
pull_request:
@@ -117,12 +123,51 @@ jobs:
117123
- name: Set up Docker Buildx
118124
uses: docker/setup-buildx-action@v3
119125

126+
- name: Generate kind configuration for CI
127+
run: |
128+
echo "Creating CI-optimized kind configuration..."
129+
# Create a simplified kind config for CI that doesn't require models mount
130+
cat > tools/kind/kind-config.yaml << 'EOF'
131+
# kind cluster configuration for CI testing
132+
kind: Cluster
133+
apiVersion: kind.x-k8s.io/v1alpha4
134+
name: semantic-router-cluster
135+
nodes:
136+
- role: control-plane
137+
# Optimized for CI environment with limited resources
138+
extraPortMappings:
139+
- containerPort: 30080
140+
hostPort: 30080
141+
protocol: TCP
142+
kubeadmConfigPatches:
143+
- |
144+
kind: InitConfiguration
145+
nodeRegistration:
146+
kubeletExtraArgs:
147+
# Reduced resource limits for CI
148+
system-reserved: memory=512Mi,cpu=250m
149+
kube-reserved: memory=512Mi,cpu=250m
150+
eviction-hard: memory.available<512Mi,nodefs.available<10%
151+
- |
152+
kind: ClusterConfiguration
153+
apiServer:
154+
extraArgs:
155+
max-requests-inflight: "200"
156+
max-mutating-requests-inflight: "100"
157+
etcd:
158+
local:
159+
extraArgs:
160+
quota-backend-bytes: "4294967296" # 4GB (reduced from 8GB)
161+
EOF
162+
echo "Generated CI-optimized kind-config.yaml:"
163+
cat tools/kind/kind-config.yaml
164+
120165
- name: Create kind cluster
121166
uses: helm/[email protected]
122167
with:
123168
version: ${{ env.KIND_VERSION }}
124169
config: tools/kind/kind-config.yaml
125-
cluster_name: semantic-router-test
170+
cluster_name: semantic-router-cluster
126171
wait: 120s
127172

128173
- name: Build semantic-router image
@@ -138,7 +183,7 @@ jobs:
138183
- name: Load image into kind cluster
139184
run: |
140185
echo "Loading image into kind cluster..."
141-
kind load docker-image ghcr.io/vllm-project/semantic-router/extproc:test --name semantic-router-test
186+
kind load docker-image ghcr.io/vllm-project/semantic-router/extproc:test --name semantic-router-cluster
142187
echo "Image loaded successfully!"
143188
144189
- name: Clean up after image build
@@ -157,10 +202,18 @@ jobs:
157202
158203
- name: Verify cluster
159204
run: |
205+
echo "=== Verifying kind cluster ==="
160206
kubectl cluster-info
161-
kubectl get nodes
207+
kubectl get nodes -o wide
162208
kubectl version
163209
210+
# Verify cluster is ready
211+
kubectl wait --for=condition=Ready nodes --all --timeout=120s
212+
213+
# Check available resources
214+
echo "=== Node resources ==="
215+
kubectl describe nodes
216+
164217
- name: Setup Kustomize
165218
run: |
166219
curl -s "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh" | bash
@@ -469,6 +522,10 @@ jobs:
469522
echo "=== Exporting cluster information for debugging ==="
470523
mkdir -p /tmp/k8s-logs
471524
525+
# Export kind cluster logs
526+
echo "=== Kind cluster logs ==="
527+
docker logs semantic-router-cluster-control-plane > /tmp/k8s-logs/kind-control-plane.log || true
528+
472529
# Export pod descriptions
473530
kubectl describe pods -n vllm-semantic-router-system > /tmp/k8s-logs/pod-descriptions.txt || true
474531
@@ -485,6 +542,9 @@ jobs:
485542
# Export resource status
486543
kubectl get all -n vllm-semantic-router-system -o yaml > /tmp/k8s-logs/all-resources.yaml || true
487544
545+
# Export kind cluster info
546+
kind get kubeconfig --name semantic-router-cluster > /tmp/k8s-logs/kind-kubeconfig.yaml || true
547+
488548
- name: Upload cluster logs
489549
if: failure()
490550
uses: actions/upload-artifact@v4
@@ -498,6 +558,8 @@ jobs:
498558
run: |
499559
echo "Cleaning up resources..."
500560
kubectl delete namespace vllm-semantic-router-system --timeout=60s || true
561+
echo "Cleaning up kind cluster..."
562+
kind delete cluster --name semantic-router-cluster || true
501563
502564
test-with-custom-config:
503565
name: Test with Custom Configuration

deploy/kubernetes/README.md

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Semantic Router Kubernetes Deployment
22

3-
Kustomize manifests for deploying the Semantic Router and its observability stack (Prometheus, Grafana, Dashboard, optional Open WebUI + Pipelines) on Kubernetes.
3+
Kustomize manifests for deploying the Semantic Router and its observability stack (Prometheus, Grafana, Dashboard, optional Open WebUI, Chat UI + Pipelines) on Kubernetes.
44

55
## Architecture
66

@@ -14,7 +14,7 @@ The deployment consists of:
1414
- **Services**:
1515
- Main service exposing gRPC (50051), Classification API (8080), and metrics (9190)
1616
- Separate metrics service for monitoring (`semantic-router-metrics`)
17-
- Observability services (Grafana, Prometheus, Dashboard, optional Open WebUI)
17+
- Observability services (Grafana, Prometheus, Dashboard, optional Open WebUI, Chat UI)
1818

1919
## Ports
2020

@@ -26,7 +26,7 @@ The deployment consists of:
2626

2727
### Deploy Core (Router)
2828

29-
```bash
29+
````bash
3030
kubectl apply -k deploy/kubernetes/
3131

3232
# Check deployment status
@@ -40,7 +40,7 @@ kubectl logs -l app=semantic-router -n vllm-semantic-router-system -f
4040

4141
```bash
4242
kubectl apply -k deploy/kubernetes/observability/
43-
```
43+
````
4444
4545
Port-forward to UIs (local dev):
4646
@@ -49,6 +49,7 @@ kubectl port-forward -n vllm-semantic-router-system svc/prometheus 9090:9090
4949
kubectl port-forward -n vllm-semantic-router-system svc/grafana 3000:3000
5050
kubectl port-forward -n vllm-semantic-router-system svc/semantic-router-dashboard 8700:80
5151
kubectl port-forward -n vllm-semantic-router-system svc/openwebui 3001:8080
52+
kubectl port-forward -n vllm-semantic-router-system svc/chat-ui 3002:3000
5253
```
5354

5455
Then open:
@@ -57,8 +58,9 @@ Then open:
5758
- Grafana → http://localhost:3000
5859
- Dashboard → http://localhost:8700
5960
- Open WebUI (Playground) → http://localhost:3001
61+
- Chat UI (HuggingChat) → http://localhost:3002
6062

61-
```
63+
````
6264

6365
### Kind (Kubernetes in Docker) Deployment
6466

@@ -81,7 +83,7 @@ make setup
8183
# Or step by step:
8284
make create-cluster
8385
make deploy
84-
```
86+
````
8587

8688
The setup process will:
8789

@@ -160,6 +162,7 @@ make port-forward-metrics
160162
kubectl port-forward -n vllm-semantic-router-system svc/semantic-router-dashboard 8700:80
161163
kubectl port-forward -n vllm-semantic-router-system svc/grafana 3000:3000
162164
kubectl port-forward -n vllm-semantic-router-system svc/openwebui 3001:8080
165+
kubectl port-forward -n vllm-semantic-router-system svc/chat-ui 3002:3000
163166
```
164167

165168
Or using kubectl directly:
@@ -179,6 +182,7 @@ kubectl port-forward -n vllm-semantic-router-system svc/prometheus 9090:9090
179182
kubectl port-forward -n vllm-semantic-router-system svc/grafana 3000:3000
180183
kubectl port-forward -n vllm-semantic-router-system svc/semantic-router-dashboard 8700:80
181184
kubectl port-forward -n vllm-semantic-router-system svc/openwebui 3001:8080
185+
kubectl port-forward -n vllm-semantic-router-system svc/chat-ui 3002:3000
182186
```
183187

184188
#### Testing the Deployment
@@ -350,6 +354,7 @@ Edit the `resources` section in `deployment.yaml` accordingly.
350354
- `tools_db.json` - Tools database for semantic routing
351355
- `kustomization.yaml` - Kustomize configuration for core deployment
352356
- `observability/` - Prometheus, Grafana, Dashboard, optional Open WebUI + Pipelines (with its own `kustomization.yaml`)
357+
(also includes optional Chat UI)
353358

354359
For detailed observability setup and screenshots, see `deploy/kubernetes/observability/README.md`.
355360

0 commit comments

Comments
 (0)