-
Notifications
You must be signed in to change notification settings - Fork 21
feat: Model Streamer initial support #136
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
Open
nicolasnoble
wants to merge
14
commits into
main
Choose a base branch
from
nnoble/model-streamer-provider
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
24bfba5
feat: Model Streamer initial support
nicolasnoble 486a156
chore: remove .egg-info from repo and add Python artifacts to .gitignore
nicolasnoble 742f342
chore: remove redundant requirements.txt, install sidecar from pyproj…
nicolasnoble d84b564
fix: use correct field name 'endpoint' in test S3 credentials
nicolasnoble 6cf32e2
fix: align encode_model_id with Python sidecar cache layout
nicolasnoble 519d23c
feat: implement is_weight_file and is_ignored on ModelStreamerProvider
nicolasnoble f046417
fix: guard credential env vars with asyncio.Lock
nicolasnoble 1f154bb
fix: run blocking boto3 downloads in a thread pool
nicolasnoble 0082c52
fix: call .lower() once in is_weight_file and is_image_file
nicolasnoble 6653caf
fix: accept optional cache_dir in delete_model
nicolasnoble 8d84365
refactor: clean up downloader code quality
nicolasnoble 269c470
fix: filter non-existent files once after download
nicolasnoble 3b24b94
fix: address review feedback from PR #136
nicolasnoble 065599c
Merge branch 'main' into nnoble/model-streamer-provider
nicolasnoble 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
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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,56 @@ | ||
| #!/bin/bash | ||
| # SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| # Entrypoint script that runs both the Model Streamer sidecar and the ModelExpress server. | ||
|
|
||
| set -e | ||
|
|
||
| # Configuration | ||
| SIDECAR_PORT="${MODEL_EXPRESS_SIDECAR_PORT:-8002}" | ||
| LOG_LEVEL="${MODEL_EXPRESS_LOG_LEVEL:-info}" | ||
|
|
||
| echo "Starting ModelExpress with Model Streamer sidecar..." | ||
|
|
||
| # Start the Python sidecar in the background | ||
| echo "Starting Model Streamer sidecar on port ${SIDECAR_PORT}..." | ||
| /app/venv/bin/python -m uvicorn \ | ||
| modelexpress_sidecar.main:app \ | ||
| --host 127.0.0.1 \ | ||
| --port "${SIDECAR_PORT}" \ | ||
| --log-level "${LOG_LEVEL}" & | ||
|
|
||
| SIDECAR_PID=$! | ||
|
|
||
| # Wait for sidecar to be ready | ||
| echo "Waiting for sidecar to be ready..." | ||
| MAX_RETRIES=30 | ||
| RETRY_COUNT=0 | ||
| while [ $RETRY_COUNT -lt $MAX_RETRIES ]; do | ||
| if /app/venv/bin/python -c "import httpx; httpx.get('http://127.0.0.1:${SIDECAR_PORT}/health', timeout=2)" > /dev/null 2>&1; then | ||
| echo "Sidecar is ready!" | ||
| break | ||
| fi | ||
| RETRY_COUNT=$((RETRY_COUNT + 1)) | ||
| sleep 1 | ||
| done | ||
|
|
||
| if [ $RETRY_COUNT -eq $MAX_RETRIES ]; then | ||
| echo "Warning: Sidecar health check timed out, proceeding anyway..." | ||
| fi | ||
|
|
||
| # Trap to ensure cleanup on exit | ||
| cleanup() { | ||
| echo "Shutting down..." | ||
| if [ -n "$SIDECAR_PID" ]; then | ||
| kill "$SIDECAR_PID" 2>/dev/null || true | ||
| fi | ||
| } | ||
| trap cleanup EXIT INT TERM | ||
|
|
||
| # Start the main server. Run it in the background and wait so the shell stays | ||
| # alive to handle signals and the cleanup trap can fire to kill the sidecar. | ||
| echo "Starting ModelExpress server..." | ||
| /app/modelexpress-server "$@" & | ||
| SERVER_PID=$! | ||
| wait $SERVER_PID |
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
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.