-
-
Notifications
You must be signed in to change notification settings - Fork 7.7k
[Misc] Minimum requirements for SageMaker compatibility #11576
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
a49f5bb
sagemaker minimum requirements - /invocations, /ping, sm image uses p…
nathan-az ca96f97
Fix spacing for formatter
nathan-az b6d12d3
Correct score request mapping, remove messages variant as it is not s…
nathan-az dc09c67
Remove unused imports
nathan-az b263e40
Add and handlers
nathan-az 256a35b
Add custom entrypoint mapping env vars to cli args
nathan-az 5f1963d
Merge pull request #1 from nathan-az/sagemaker-custom-entrypoint
nathan-az 2e8a87f
use process subsitution instead of pipelining to fix local variable i…
nathan-az e9cef77
Copy sagemaker entrypoint to image
nathan-az b0e6255
Make /ping respond to GET and POST
nathan-az 312c97e
Move sagemaker entrypoint to examples and adjust dockerfile
nathan-az 09840ed
Update Dockerfile
simon-mo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/bin/bash | ||
|
||
# Define the prefix for environment variables to look for | ||
PREFIX="SM_VLLM_" | ||
ARG_PREFIX="--" | ||
|
||
# Initialize an array for storing the arguments | ||
# port 8080 required by sagemaker, https://docs.aws.amazon.com/sagemaker/latest/dg/your-algorithms-inference-code.html#your-algorithms-inference-code-container-response | ||
ARGS=(--port 8080) | ||
|
||
# Loop through all environment variables | ||
while IFS='=' read -r key value; do | ||
# Remove the prefix from the key, convert to lowercase, and replace underscores with dashes | ||
arg_name=$(echo "${key#"${PREFIX}"}" | tr '[:upper:]' '[:lower:]' | tr '_' '-') | ||
|
||
# Add the argument name and value to the ARGS array | ||
ARGS+=("${ARG_PREFIX}${arg_name}") | ||
if [ -n "$value" ]; then | ||
ARGS+=("$value") | ||
fi | ||
done < <(env | grep "^${PREFIX}") | ||
|
||
# Pass the collected arguments to the main entrypoint | ||
exec python3 -m vllm.entrypoints.openai.api_server "${ARGS[@]}" |
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.