LCORE-2338: LS container entrypoint + deployment artifacts for unified mode - #2319
LCORE-2338: LS container entrypoint + deployment artifacts for unified mode#2319max-svistunov wants to merge 2 commits into
Conversation
|
Warning Review limit reached
Next review available in: 59 minutes You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (6)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
The llama_stack_configuration.py CLI previously only performed legacy enrichment: it always read the --input run.yaml and enriched it, so a container handed a unified lightspeed-stack.yaml (with no external run.yaml) could not start. The spec's server-mode trigger mechanism requires the CLI to auto-detect the configuration shape. main() now dispatches on a new has_synthesis_input() helper that mirrors the root Configuration.check_unified_vs_legacy detection on the raw YAML dict (non-empty inference.providers, non-empty vector_store.providers, or a llama_stack.config block). Unified configs are synthesized via synthesize_to_file — --input is ignored and need not exist, relative profile: paths resolve against the --config directory (R8), and the output keeps the 0600 secret-safety mode (R10). Legacy configs enrich the --input run.yaml exactly as before, so existing container layouts and CI provider-matrix runs are unaffected. Tests cover the detection matrix (all three synthesis inputs, empty provider lists, null sections, legacy path) and both CLI dispatch paths, including synthesis with a nonexistent --input and relative-profile resolution.
Make server mode work end to end from a single unified lightspeed-stack.yaml, relying on the CLI's unified-vs-legacy auto-detection: - scripts/llama-stack-entrypoint.sh: document the two startup modes in the header (synthesis from a unified config vs legacy run.yaml enrichment — the Python CLI decides), rename the intermediate file to generated-run.yaml, and fail with a clear error when generation fails and no fallback run.yaml is mounted, instead of handing llama-stack a nonexistent path. - deploy/llama-stack/test.containerfile: ship src/data/ to /opt/app-root/data so load_default_baseline() resolves next to the standalone-copied script (it reads ./data/default_run.yaml relative to its own location); chown it for the runtime user. - docker-compose.yaml: mount the src/data host copy beside the existing script host-copies, and document that the run.yaml mount is only consumed in legacy mode — one compose file serves both modes, with the mode chosen by the content of lightspeed-stack.yaml, so the CI provider-matrix workflows that pair run-*.yaml files with this compose file keep working unchanged. - deploy/llama-stack/README.md: document what the image bundles, the two startup modes, a minimal unified-only compose snippet (no run.yaml mount), and when a rebuild is needed vs covered by the host-copy mounts. .tekton/ pipelines reference no compose files and need no changes.
69e9dff to
2f56509
Compare
Description
Implements LCORE-2338: server mode works end to end from a single unified
lightspeed-stack.yaml.The ticket assumed the Python CLI already auto-detected unified vs legacy configs — it did not:
main()only performed legacy enrichment, so a container handed a unified config (no external run.yaml) could not start. This PR closes that gap and updates the deployment artifacts around it:src/llama_stack_configuration.py):main()dispatches on a newhas_synthesis_input()helper mirroring the rootConfiguration.check_unified_vs_legacydetection (non-emptyinference.providers, non-emptyvector_store.providers, or allama_stack.configblock). Unified configs are synthesized viasynthesize_to_file(--inputignored and need not exist; relativeprofile:resolves against the--configdir, R8; output keeps mode 0600, R10). Legacy configs enrich--inputexactly as before, so existing layouts and the CI provider-matrix workflows are untouched.scripts/llama-stack-entrypoint.sh): documents the two startup modes, adopts the post-renameogx stack runcommand, and fails with a clear error when generation fails and no fallback run.yaml is mounted. (Note for a follow-up:ogx stack runalready emits a FutureWarning recommendingogx run— inherited from the rename, kept for consistency with the rest of main.)deploy/llama-stack/test.containerfile): shipssrc/data/to/opt/app-root/datasoload_default_baseline()resolves next to the standalone-copied script.docker-compose.yaml): one file serves both modes — mode is chosen by the content oflightspeed-stack.yaml; therun.yamlmount is documented as legacy-only and is inert in unified mode. Adds thesrc/datahost-copy mount beside the existing script mounts.deploy/llama-stack/README.md, new): image contents, the two startup modes, a minimal unified-only compose snippet (no run.yaml mount), and rebuild guidance..tekton/pipelines reference no compose files and need no changes (flagging for @radofuchs as the Konflux owner per the ticket).Type of change
Tools used to create PR
Identify any AI code assistants used in this PR (for transparency and review context)
Related Tickets & Documents
Checklist before requesting a review
Testing
uv run pytest tests/unit/test_llama_stack_synthesize.py -k "main or has_synthesis" -vExpected: detection matrix + both dispatch paths pass, including synthesis with a nonexistent
--inputand relative-profile resolution.Actual: 4 passed (51 passed for the whole module; full unit suite 3176 passed).
uv run python src/llama_stack_configuration.py(viamigrate_config_dumbovertests/e2e/configs/run-ci.yaml+tests/e2e/configuration/server-mode/lightspeed-stack.yaml, enrichment inputs stripped) → rootlightspeed-stack.yaml;docker compose up -d llama-stack lightspeed-stackExpected: llama-stack log shows the synthesis path; all containers healthy;
/v1/queryanswers through LCORE → LS.Actual (re-verified after rebasing onto the OGX-rename main):
llama-stack | Generating llama-stack config from /opt/app-root/lightspeed-stack.yaml (mode auto-detected)...llama-stack | Using generated config: /tmp/generated-run.yamldocker compose ps: llama-stack, lightspeed-stack, mock-mcp, mock-tls-inference allhealthycurl -X POST http://localhost:8080/v1/query …→{"response":"unified ogx works",…}lightspeed-stack.yaml(CI server-mode config, no synthesis input) withrun.yaml=run-ci.yaml, recreate the two containers:docker compose up -d --force-recreate llama-stack lightspeed-stackExpected: enrichment path taken (the config has no synthesis input, so only
generate_configurationover the mounted run.yaml can produce the generated config); containers healthy;/v1/queryanswers.Actual (post-rebase): all containers
healthy; BYOK enrichment visible in the generated config (backend: byok_e2e-test-docs_storage);curl …→{"response":"legacy ogx works",…}uv run make format/uv run make verifyActual: clean, except 14 pre-existing mypy errors in
tests/unit/utils/test_models_dumper.pythat reproduce identically on untouched upstream/main.