Skip to content

Commit e99bd5a

Browse files
committed
feat: implement decision-based routing with plugin architecture
Signed-off-by: bitliu <[email protected]>
1 parent 6a4ebf4 commit e99bd5a

File tree

145 files changed

+16650
-7655
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

145 files changed

+16650
-7655
lines changed

.crd-ref-docs.yaml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
processor:
2+
# Ignore fields that are common to all Kubernetes resources
3+
ignoreFields:
4+
- "TypeMeta"
5+
- "ObjectMeta"
6+
- "ListMeta"
7+
8+
# Ignore types that are not relevant for documentation
9+
ignoreTypes:
10+
- "metav1.Time"
11+
- "metav1.Duration"
12+
- "metav1.ObjectMeta"
13+
- "metav1.TypeMeta"
14+
- "metav1.ListMeta"
15+
16+
# Source path for Go API types
17+
sourcePath: "./src/semantic-router/pkg/apis/vllm.ai/v1alpha1"
18+
19+
render:
20+
# Enable Kubebuilder markers rendering
21+
kubebuilderMarkers: true
22+
23+
# Group resources by Kind
24+
groupByKind: true
25+
26+
# Include table of contents
27+
includeTableOfContents: true
28+
29+
# Custom templates (optional)
30+
# templatesDir: "./docs/crd-templates"
31+
32+
# Output format: markdown, asciidoc, or html
33+
format: markdown
34+
35+
# Custom configuration for your CRDs
36+
groups:
37+
- name: vllm.ai
38+
displayName: "vLLM Semantic Router"
39+
description: |
40+
Custom Resource Definitions for vLLM Semantic Router.
41+
These CRDs enable declarative configuration of intelligent routing and model pools.
42+
43+
kinds:
44+
- name: IntelligentRoute
45+
displayName: "Intelligent Route"
46+
description: |
47+
IntelligentRoute defines intelligent routing rules and decisions for LLM requests.
48+
It supports decision-based routing with rule combinations, model references, and plugins.
49+
50+
- name: IntelligentPool
51+
displayName: "Intelligent Pool"
52+
description: |
53+
IntelligentPool defines a pool of LLM models with their configurations.
54+
It manages model endpoints, reasoning families, and model-specific settings.
55+
56+
# Markdown rendering options
57+
markdown:
58+
# Header level for the main title
59+
headerLevel: 1
60+
61+
# Include examples in the documentation
62+
includeExamples: true
63+
64+
# Include status subresource documentation
65+
includeStatus: true
66+
67+
# Code block language for YAML examples
68+
codeBlockLanguage: yaml

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

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
name: Integration Test [Docker Compose]
22

33
on:
4-
pull_request:
5-
branches:
6-
- main
74
workflow_dispatch: # Allow manual triggering
85

96
jobs:
Lines changed: 166 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,166 @@
1+
name: Integration Test [Dynamic Config]
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
push:
8+
branches:
9+
- main
10+
workflow_dispatch: # Allow manual triggering
11+
12+
jobs:
13+
integration-test:
14+
runs-on: ubuntu-latest
15+
timeout-minutes: 60
16+
17+
steps:
18+
- name: Check out the repo
19+
uses: actions/checkout@v4
20+
21+
- name: Set up Go
22+
uses: actions/setup-go@v5
23+
with:
24+
go-version: '1.24'
25+
26+
- name: Set up Rust
27+
uses: actions-rust-lang/setup-rust-toolchain@v1
28+
with:
29+
toolchain: 1.90
30+
31+
- name: Install system dependencies
32+
run: |
33+
sudo apt-get update
34+
sudo apt-get install -y \
35+
make \
36+
curl \
37+
build-essential \
38+
pkg-config
39+
40+
- name: Install Kind
41+
run: |
42+
curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.22.0/kind-linux-amd64
43+
chmod +x ./kind
44+
sudo mv ./kind /usr/local/bin/kind
45+
46+
- name: Install kubectl
47+
run: |
48+
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
49+
chmod +x kubectl
50+
sudo mv kubectl /usr/local/bin/kubectl
51+
52+
- name: Install Helm
53+
run: |
54+
curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash
55+
56+
- name: Download E2E test dependencies
57+
run: |
58+
cd e2e && go mod download
59+
60+
- name: Build E2E test binary
61+
run: |
62+
make build-e2e
63+
64+
- name: Run Dynamic Config E2E tests
65+
id: e2e-test
66+
run: |
67+
set +e # Don't exit on error, we want to capture the result
68+
make e2e-test E2E_PROFILE=dynamic-config E2E_VERBOSE=true E2E_KEEP_CLUSTER=false
69+
TEST_EXIT_CODE=$?
70+
echo "test_exit_code=${TEST_EXIT_CODE}" >> $GITHUB_OUTPUT
71+
exit ${TEST_EXIT_CODE}
72+
73+
- name: Upload test reports
74+
if: always()
75+
uses: actions/upload-artifact@v4
76+
with:
77+
name: test-reports-dynamic-config
78+
path: |
79+
test-report.json
80+
test-report.md
81+
semantic-router-logs.txt
82+
retention-days: 30
83+
84+
- name: Create test summary from report
85+
if: always()
86+
run: |
87+
if [ -f "test-report.md" ]; then
88+
echo "=== Reading test report from test-report.md ==="
89+
cat test-report.md >> $GITHUB_STEP_SUMMARY
90+
91+
# Add semantic-router logs section if available
92+
if [ -f "semantic-router-logs.txt" ]; then
93+
cat >> $GITHUB_STEP_SUMMARY << 'EOF'
94+
95+
---
96+
97+
### 📝 Semantic Router Logs
98+
99+
<details>
100+
<summary>Click to view semantic-router logs</summary>
101+
102+
```
103+
EOF
104+
# Add first 500 lines of logs to summary (to avoid exceeding GitHub limits)
105+
head -n 500 semantic-router-logs.txt >> $GITHUB_STEP_SUMMARY
106+
107+
# Check if there are more lines
108+
TOTAL_LINES=$(wc -l < semantic-router-logs.txt)
109+
if [ "$TOTAL_LINES" -gt 500 ]; then
110+
cat >> $GITHUB_STEP_SUMMARY << EOF
111+
112+
... (showing first 500 lines of $TOTAL_LINES total lines)
113+
114+
📦 Full logs are available in the workflow artifacts: semantic-router-logs.txt
115+
EOF
116+
fi
117+
118+
cat >> $GITHUB_STEP_SUMMARY << 'EOF'
119+
```
120+
121+
</details>
122+
EOF
123+
fi
124+
125+
# Add additional context
126+
cat >> $GITHUB_STEP_SUMMARY << 'EOF'
127+
128+
---
129+
130+
### 📚 Additional Resources
131+
132+
- **Trigger:** ${{ github.event_name }}
133+
- **Branch:** `${{ github.ref_name }}`
134+
- **Commit:** `${{ github.sha }}`
135+
- **Workflow Run:** [${{ github.run_id }}](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})
136+
- [E2E Test Framework Documentation](https://github.com/${{ github.repository }}/tree/main/e2e)
137+
- [Dynamic Config Profile](https://github.com/${{ github.repository }}/tree/main/e2e/profiles/dynamic-config)
138+
139+
### 📦 Artifacts
140+
141+
- **test-report.json** - Detailed test results in JSON format
142+
- **test-report.md** - Human-readable test report
143+
- **semantic-router-logs.txt** - Complete semantic-router pod logs
144+
- All artifacts are retained for 30 days
145+
146+
### 🔧 Dynamic Config Profile
147+
148+
This test validates the Kubernetes CRD-based dynamic configuration feature:
149+
- IntelligentPool CRD for model configuration
150+
- IntelligentRoute CRD for routing decisions
151+
- Controller-runtime based reconciliation
152+
- Automatic configuration updates on CRD changes
153+
EOF
154+
else
155+
echo "⚠️ Test report file not found!" >> $GITHUB_STEP_SUMMARY
156+
echo "" >> $GITHUB_STEP_SUMMARY
157+
echo "The E2E test framework did not generate a report file." >> $GITHUB_STEP_SUMMARY
158+
echo "This might indicate that the test failed before report generation." >> $GITHUB_STEP_SUMMARY
159+
fi
160+
161+
- name: Clean up
162+
if: always()
163+
run: |
164+
make e2e-cleanup || true
165+
166+

0 commit comments

Comments
 (0)