[WIP] chore: add switchyard-server wiring to benchmarks - #177
Conversation
Signed-off-by: ayushag <ayushag@nvidia.com>
WalkthroughChangesRust Switchyard Benchmark Migration
Estimated code review effort: 4 (Complex) | ~45 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@benchmark/run-baseline.sh`:
- Around line 879-880: Update the SERVER_CONFIG_DIR condition in the Docker
mount argument logic to recognize REPO_ROOT only when it is the directory itself
or has a path-separator boundary, not merely a string prefix. Ensure sibling
paths such as /work/repo-configs still receive the read-only bind mount while
paths under REPO_ROOT continue to be skipped.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: adef066f-7ed5-46ce-b6a5-292366d962ae
📒 Files selected for processing (10)
benchmark/DATASETS.mdbenchmark/README.mdbenchmark/run-baseline.shbenchmark/run_manifest.pybenchmark/server-configs/tb-lite-llm-classifier-opus-kimi-gemini.tomlbenchmark/server-configs/tb-lite-single-gpt-5-5.tomlbenchmark/server-configs/tb-lite-single-opus-4-7.tomlbenchmark/switchyard-server.Dockerfiletests/test_run_baseline_script.pytests/test_run_manifest.py
| if [[ -n "\${SERVER_CONFIG_DIR}" && "\${SERVER_CONFIG_DIR}" != "\${REPO_ROOT}"* ]]; then | ||
| DOCKER_RUN_ARGS+=(-v "\${SERVER_CONFIG_DIR}:\${SERVER_CONFIG_DIR}:ro") |
There was a problem hiding this comment.
🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win
Use a directory-boundary check before skipping the config mount.
Line 879 treats /work/repo-configs as inside /work/repo because ${REPO_ROOT}* is a plain prefix match. The bind mount is skipped, but the container still receives that absolute config path and fails to open it.
Proposed fix
- if [[ -n "${SERVER_CONFIG_DIR}" && "${SERVER_CONFIG_DIR}" != "${REPO_ROOT}"* ]]; then
+ repo_prefix="${REPO_ROOT%/}/"
+ if [[ -n "${SERVER_CONFIG_DIR}" \
+ && "${SERVER_CONFIG_DIR}" != "${REPO_ROOT}" \
+ && "${SERVER_CONFIG_DIR}" != "${repo_prefix}"* ]]; then
DOCKER_RUN_ARGS+=(-v "${SERVER_CONFIG_DIR}:${SERVER_CONFIG_DIR}:ro")
fi📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| if [[ -n "\${SERVER_CONFIG_DIR}" && "\${SERVER_CONFIG_DIR}" != "\${REPO_ROOT}"* ]]; then | |
| DOCKER_RUN_ARGS+=(-v "\${SERVER_CONFIG_DIR}:\${SERVER_CONFIG_DIR}:ro") | |
| repo_prefix="${REPO_ROOT%/}/" | |
| if [[ -n "${SERVER_CONFIG_DIR}" \ | |
| && "${SERVER_CONFIG_DIR}" != "${REPO_ROOT}" \ | |
| && "${SERVER_CONFIG_DIR}" != "${repo_prefix}"* ]]; then | |
| DOCKER_RUN_ARGS+=(-v "${SERVER_CONFIG_DIR}:${SERVER_CONFIG_DIR}:ro") |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@benchmark/run-baseline.sh` around lines 879 - 880, Update the
SERVER_CONFIG_DIR condition in the Docker mount argument logic to recognize
REPO_ROOT only when it is the directory itself or has a path-separator boundary,
not merely a string prefix. Ensure sibling paths such as /work/repo-configs
still receive the read-only bind mount while paths under REPO_ROOT continue to
be skipped.
Signed-off-by: ayushag <ayushag@nvidia.com>
What
Why
Currently Switchyard benchmarking suite uses old python server path to run the benchmarks. With the migration of routing algos to the libsy and the new rust switchyard-server, the benchmark flow also needs to follow this path
Closes SWITCH-119
How tested
uv run ruff check .cleanuv run mypy switchyardcleanuv run pytest tests/greenChecklist
snake_caseof the primary class.switchyard/__init__.py.__all__if intended for downstream use.--helpupdated if customer-facing surface changed.Signed-off-by: Your Name <email>) per the DCO.Notes for reviewers
Anything reviewers should pay extra attention to — risky paths, follow-up tickets, intentional trade-offs.
Summary by CodeRabbit
New Features
Documentation
Bug Fixes
Refactor