fix(sglang): ship sglang/killall_sglang console-scripts in amzn2023 runtime image - #6502
Closed
bhanutejagk wants to merge 1 commit into
Closed
fix(sglang): ship sglang/killall_sglang console-scripts in amzn2023 runtime image#6502bhanutejagk wants to merge 1 commit into
bhanutejagk wants to merge 1 commit into
Conversation
…untime image The amzn2023 image is multi-stage. The builder stage runs an editable install (`uv pip install --system -e "python[all]"`), which generates the `sglang` and `killall_sglang` console-scripts in the builder's /usr/local/bin. The runtime stage copies site-packages and only the `sglang-router` binary, so the `sglang` CLI declared by the package (entry point `sglang.cli.main:main`) is absent from PATH in the shipped image. Copy both console-scripts from the builder stage so the advertised CLI is available at runtime. The Ubuntu Dockerfile is unaffected (single-stage base image already provides the CLI) and is not changed.
Contributor
Author
|
Superseded by #6503 — moved to an upstream branch so CI can authenticate and build (fork PRs lack the repo secrets/region creds the DLC build jobs need). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Root cause
docker/sglang/Dockerfile.amzn2023is multi-stage. The builder stage runs an editable install (uv pip install --system -e "python[all]"), which generates thesglangandkillall_sglangconsole-scripts into the builder's/usr/local/bin. The runtime stage copies site-packages and explicitly copies only thesglang-routerbinary — it never copiessglang/killall_sglang.As a result the shipped amzn2023 image declares a
sglangCLI (entry pointsglang.cli.main:main) that is not onPATH. Any invocation ofsubprocess.Popen(['sglang', 'serve', ...])fails withFileNotFoundError: 'sglang'.Both the ec2-amzn2023 and sagemaker-amzn2023 images build from this shared
Dockerfile.amzn2023, so this single change fixes both.Fix
Copy the two console-scripts from the builder stage into the runtime stage, immediately after the existing
sglang-routercopy:Why fix the image instead of the test?
The registered upstream tests are pulled from upstream at the same ref the image builds from, so there is no version skew to manage. Upstream now advertises
sglang serveas the canonical entrypoint, whilepython -m sglang.launch_serverprints a legacy-fallback notice. Shipping thesglangCLI that the package already declares is the correct fix; patching the test would paper over a genuine gap in the image and drift from upstream's documented interface.Customer impact
None. Customer entrypoints today use
python -m sglang.launch_server, which continues to work unchanged. This change only adds the missingsglang/killall_sglangscripts toPATH.Scope
docker/sglang/Dockerfileis not affected — it is single-stage on top of the upstream base image, which already providessglang— and is not modified.Build status
Build-unverified: no full from-source GPU rebuild was run for this change. The diff is a two-line file-copy in the runtime stage and does not alter the build graph.