Skip to content

Commit f3b42c7

Browse files
committed
Merge remote-tracking branch 'upstream/main' into rhoai-3.5
2 parents 7934bfe + b7e48c3 commit f3b42c7

122 files changed

Lines changed: 10312 additions & 888 deletions

File tree

Some content is hidden

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

.github/CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
# Code owners are automatically requested for review when someone opens a pull request that modifies code that they own.
44

55
# Default owners for everything in the repo
6-
* @lioraron @yizhaodev @j-mok-dev @acardace
6+
* @lioraron @yizhaodev @j-mok-dev @vishbhat

.github/workflows/ci-dco-signoff.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
permissions:
1414
contents: read
1515
steps:
16-
- uses: actions/checkout@v6
16+
- uses: actions/checkout@v7
1717
with:
1818
fetch-depth: 0
1919

.github/workflows/ci-integration-tests.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ permissions:
1919

2020
jobs:
2121
integration-tests:
22-
name: Integration Tests (${{ matrix.file_client_type }}, ${{ matrix.db_client_type }}, ${{ matrix.exchange_client_type }}${{ matrix.enable_gie == 'true' && ', gie' || '' }})
22+
name: Integration Tests (${{ matrix.file_client_type }}, ${{ matrix.db_client_type }}, ${{ matrix.exchange_client_type }}${{ matrix.enable_gie == 'true' && ', gie' || '' }}${{ matrix.enable_dispatcher == 'true' && ', dispatcher' || '' }})
2323
runs-on: ubuntu-latest
2424
timeout-minutes: 30
2525
strategy:
@@ -45,8 +45,12 @@ jobs:
4545
db_client_type: postgresql
4646
exchange_client_type: redis
4747
enable_gie: "true"
48+
- file_client_type: s3
49+
db_client_type: postgresql
50+
exchange_client_type: redis
51+
enable_dispatcher: "true"
4852
steps:
49-
- uses: actions/checkout@v6
53+
- uses: actions/checkout@v7
5054

5155
- uses: actions/setup-go@v6
5256
with:
@@ -65,6 +69,7 @@ jobs:
6569
DB_CLIENT_TYPE: ${{ matrix.db_client_type }}
6670
EXCHANGE_CLIENT_TYPE: ${{ matrix.exchange_client_type }}
6771
ENABLE_GIE: ${{ matrix.enable_gie || 'false' }}
72+
ENABLE_DISPATCHER: ${{ matrix.enable_dispatcher || 'false' }}
6873

6974
- name: Run integration tests
7075
run: make test-e2e

.github/workflows/ci-release.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222

2323
steps:
2424
- name: Checkout repository
25-
uses: actions/checkout@v6
25+
uses: actions/checkout@v7
2626

2727
- name: Set up QEMU
2828
uses: docker/setup-qemu-action@v4

.github/workflows/create-release.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
runs-on: ubuntu-latest
2020
steps:
2121
- name: Checkout
22-
uses: actions/checkout@v6
22+
uses: actions/checkout@v7
2323
with:
2424
fetch-depth: 0
2525

@@ -65,7 +65,7 @@ jobs:
6565
runs-on: ubuntu-latest
6666
steps:
6767
- name: Checkout
68-
uses: actions/checkout@v6
68+
uses: actions/checkout@v7
6969

7070
- name: Set up Go
7171
uses: actions/setup-go@v6
@@ -89,7 +89,7 @@ jobs:
8989
runs-on: ubuntu-latest
9090
steps:
9191
- name: Checkout
92-
uses: actions/checkout@v6
92+
uses: actions/checkout@v7
9393
with:
9494
fetch-depth: 0
9595

.github/workflows/pre-commit.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
2121

2222
steps:
23-
- uses: actions/checkout@v6
23+
- uses: actions/checkout@v7
2424

2525
- name: Set up Go
2626
uses: actions/setup-go@v6
@@ -42,5 +42,12 @@ jobs:
4242
- name: Run pre-commit hooks
4343
uses: pre-commit/action@v3.0.1
4444

45+
- name: Run integration tests
46+
run: make test-integration
47+
4548
- name: Lint Helm chart
46-
run: helm lint charts/batch-gateway
49+
run: |
50+
helm lint charts/batch-gateway
51+
for f in charts/batch-gateway/ci/values-*.yaml; do
52+
helm lint charts/batch-gateway -f "$f"
53+
done

.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
bin/
2+
.build/
23
.vscode/
34
.claude/
45
.cursor/
56
.codegraph/
7+
.venv/
8+
__pycache__/
9+
*.pyc
10+
benchmarks/results/*
11+
!benchmarks/results/.gitkeep
12+
.dispatcher-port-forward.pid
13+
.dispatcher-sim-port-forward.pid

CLAUDE.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,5 +33,6 @@ OpenAI-compatible batch API gateway for llm-d. Three binaries: apiserver, batch-
3333
## Local Testing
3434

3535
- Unit tests: `make test`
36-
- Integration tests: `make test-integration` (or `make test-all` for unit + integration)
36+
- Regression tests: `make test-regression` (API schema compatibility + past-bug guards)
37+
- Integration tests: `make test-integration` (or `make test-all` for unit + regression + integration)
3738
- E2E: `make dev-deploy` to deploy to a local Kind cluster, then `make test-e2e`

CONTRIBUTING.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -80,13 +80,14 @@ For changes that fix broken code or add small changes within a component:
8080

8181
## Testing Requirements
8282

83-
We use three tiers of testing:
83+
We use four tiers of testing:
8484

85-
1. **Unit tests**: Fast verification of code parts, testing different arguments
86-
2. **Integration tests**: Testing protocols between components and built artifacts
87-
3. **End-to-end (e2e) tests**: Whole system testing including benchmarking
85+
1. **Unit tests**: Fast verification of code parts, testing different arguments (`make test`)
86+
2. **Regression tests**: API schema compatibility (golden-file round-trips) and serialization guards (`make test-regression`)
87+
3. **Integration tests**: Feature-level validation through the real HTTP stack with in-memory backends, plus component integration with external services — tests that require external services skip gracefully when unavailable (`make test-integration`)
88+
4. **End-to-end (e2e) tests**: Whole system testing including benchmarking against a live deployment (`make test-e2e`)
8889

89-
Strong e2e coverage is required for deployed systems to prevent performance regression. Appropriate test coverage is an important part of code review.
90+
Integration tests run in CI on every PR alongside unit tests. Tests that require external infrastructure (Docker, S3) skip gracefully when those services are unavailable. Strong e2e coverage is required for deployed systems to prevent performance regression. Appropriate test coverage is an important part of code review.
9091

9192
## Security
9293

Makefile

Lines changed: 51 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.PHONY: help build build-apiserver build-processor build-gc run-apiserver run-processor run-gc run-apiserver-dev run-processor-dev run-gc-dev build-release package-release publish-helm-chart generate-release test test-coverage test-coverage-func clean lint fmt vet tidy install-tools deps-get deps-verify bench check check-container-tool ci image-build image-build-apiserver image-build-processor image-build-gc test-integration test-all test-e2e test-helm dev-deploy dev-clean dev-rm-cluster pre-commit
1+
.PHONY: help build build-apiserver build-processor build-gc run-apiserver run-processor run-gc run-apiserver-dev run-processor-dev run-gc-dev build-release package-release publish-helm-chart generate-release test test-coverage test-coverage-func clean lint fmt vet tidy install-tools deps-get deps-verify bench check check-container-tool ci image-build image-build-apiserver image-build-processor image-build-gc test-regression test-integration test-all test-e2e test-helm dev-deploy dev-clean dev-rm-cluster pre-commit benchmark-local benchmark-local-teardown
22

33
SHELL := /usr/bin/env bash
44

@@ -218,6 +218,12 @@ tidy:
218218
@echo "Tidying go modules..."
219219
$(GO) mod tidy
220220

221+
## update-deps: Upgrade all dependencies to latest and tidy
222+
update-deps:
223+
@echo "Upgrading all dependencies..."
224+
$(GO) get -u ./...
225+
$(GO) mod tidy
226+
221227
## clean: Remove build artifacts and coverage files
222228
clean:
223229
@echo "Cleaning..."
@@ -310,15 +316,22 @@ deps-verify:
310316
@echo "Verifying dependencies..."
311317
$(GO) mod verify
312318

313-
## test-integration: Run integration tests (each test spawns its own mock server)
319+
## test-regression: Run regression tests (API schema compat, past-bug guards)
320+
test-regression:
321+
@echo "Running regression tests..."
322+
@$(GO) test $(TEST_FLAGS) -v -count=1 ./test/regression/... || \
323+
(echo "\n❌ Regression tests failed" && exit 1)
324+
@echo "\n✅ Regression tests passed!"
325+
326+
## test-integration: Run integration tests (in-process server with mock backends and external service integration, no cluster needed)
314327
test-integration:
315328
@echo "Running integration tests..."
316329
@$(GO) test -v -tags=integration ./... || \
317330
(echo "\n❌ Integration tests failed" && exit 1)
318331
@echo "\n✅ Integration tests passed!"
319332

320-
## test-all: Run all tests (unit + integration)
321-
test-all: test test-integration
333+
## test-all: Run all tests (unit + regression + integration)
334+
test-all: test test-regression test-integration
322335

323336
KIND_CLUSTER_NAME ?= batch-gateway-dev
324337

@@ -340,12 +353,45 @@ dev-rm-cluster:
340353
@kind delete cluster --name batch-gateway-dev || echo "Cluster not found or already deleted"
341354
@echo "✅ Kind cluster deleted"
342355

356+
BENCHMARK_CONTEXT ?= kind-$(KIND_CLUSTER_NAME)
357+
BENCHMARK_SCENARIO ?= 3
358+
BENCHMARK_RESULTS_DIR ?= benchmarks/results/local-run
359+
360+
## benchmark-local: Run benchmark e2e on local Kind cluster with inference-sim (no GPU required)
361+
## Set BENCHMARK_KEEP_CLUSTER=1 to skip teardown for inspection.
362+
benchmark-local:
363+
@kind get clusters 2>/dev/null | grep -q $(KIND_CLUSTER_NAME) || \
364+
{ echo "ERROR: Kind cluster '$(KIND_CLUSTER_NAME)' not found. Run 'make dev-deploy' first."; exit 1; }
365+
@$(CONTAINER_TOOL) exec $(KIND_CLUSTER_NAME)-control-plane crictl images 2>/dev/null | grep -q batch-gateway-apiserver || \
366+
{ echo "ERROR: batch-gateway images not loaded in Kind. Run 'make dev-deploy' first."; exit 1; }
367+
@echo "=== Benchmark local e2e (MODE=sim, scenario $(BENCHMARK_SCENARIO)) ==="
368+
@echo "Step 1/4: Setting up infrastructure..."
369+
@MODE=sim KUBE_CONTEXT=$(BENCHMARK_CONTEXT) SCENARIO=$(BENCHMARK_SCENARIO) BG_IMAGE_TAG=0.0.1 BG_PULL_POLICY=IfNotPresent bash benchmarks/setup.sh
370+
@echo "Step 2/4: Generating prompts..."
371+
@python3 benchmarks/generate_prompts.py --num-requests 50 --isl-distribution fixed --isl-mean 256 --model sim-model --multi-job --output-dir $(BENCHMARK_RESULTS_DIR)
372+
@echo "Step 3/4: Running benchmark..."
373+
@python3 benchmarks/benchmark.py --context $(BENCHMARK_CONTEXT) --scenarios $(BENCHMARK_SCENARIO) --model sim-model --batch-size 50 --num-jobs 1 --results-dir $(BENCHMARK_RESULTS_DIR)
374+
@echo "Step 4/4: Done!"
375+
@echo "Report: $(BENCHMARK_RESULTS_DIR)/report.html"
376+
@echo "Metadata: $(BENCHMARK_RESULTS_DIR)/run-metadata.json"
377+
@if [ -z "$(BENCHMARK_KEEP_CLUSTER)" ]; then \
378+
echo "Tearing down benchmark namespace..."; \
379+
KUBE_CONTEXT=$(BENCHMARK_CONTEXT) SCENARIO=$(BENCHMARK_SCENARIO) bash benchmarks/teardown.sh; \
380+
else \
381+
echo "Keeping cluster (BENCHMARK_KEEP_CLUSTER set). Teardown with: make benchmark-local-teardown"; \
382+
fi
383+
384+
## benchmark-local-teardown: Teardown local benchmark environment
385+
benchmark-local-teardown:
386+
@KUBE_CONTEXT=$(BENCHMARK_CONTEXT) SCENARIO=$(BENCHMARK_SCENARIO) bash benchmarks/teardown.sh
387+
343388
## test-e2e: Run E2E tests against a live API server (requires TEST_BASE_URL or dev-deploy NodePort services)
344389
## Use TEST_RUN to filter tests, e.g.: make test-e2e TEST_RUN=TestE2E/Batches/Cancel/InProgress
345390
test-e2e:
346391
@echo "Running E2E tests..."
347392
@OUT=$$(mktemp); \
348-
cd test/e2e && $(GO) test -v -count=1 $(if $(TEST_RUN),-run $(TEST_RUN)) ./... 2>&1 | tee $$OUT; \
393+
echo "Processor observability endpoint: auto-resolved by the e2e test helpers"; \
394+
cd test/e2e && $(GO) test -v -count=1 -timeout=20m $(if $(TEST_RUN),-run $(TEST_RUN)) ./... 2>&1 | tee $$OUT; \
349395
TEST_EXIT=$${PIPESTATUS[0]}; \
350396
PASS_COUNT=$$(grep -- '--- PASS:' $$OUT 2>/dev/null | wc -l | tr -d ' '); \
351397
FAIL_COUNT=$$(grep -- '--- FAIL:' $$OUT 2>/dev/null | wc -l | tr -d ' '); \

0 commit comments

Comments
 (0)