fix: add runtime version banner, log after unpack for accuracy#71
Merged
fix: add runtime version banner, log after unpack for accuracy#71
Conversation
Log worker, runpod-flash, and runpod versions at boot. Banner is emitted after maybe_unpack() so the bundled runpod_flash (from flash build) is on sys.path, reporting the actual deployed version rather than the base image's pip-installed version. - Add version.py with __version__ constant and package version helpers - Read flash version from bundled runpod_flash.__version__ first - Fall back to importlib.metadata for non-bundled environments - Move version banner to after unpack in both QB and LB handlers
… hardcoded constant Worker version is now read from the co-located pyproject.toml via regex, eliminating manual version maintenance. Falls back to importlib.metadata if pyproject.toml is unavailable.
The pyproject.toml-reading approach fails because maybe_unpack() extracts the user's flash project to /app/, overwriting the worker's pyproject.toml with the user's (version 0.1.0). Use a release-please-managed __version__ constant instead.
3 tasks
Contributor
There was a problem hiding this comment.
Pull request overview
Improves startup logging accuracy by reporting the correct worker/Flash/RunPod SDK runtime versions and ensuring the banner is emitted only after bundled artifacts are unpacked and available on sys.path.
Changes:
- Add
src/version.pyto centralize worker/flash/runpod version resolution and banner formatting. - Move the startup banner log to after
maybe_unpack()insrc/handler.pyandsrc/lb_handler.py. - Update unit tests for the new version utilities and adjust LB handler import-time mocking; update release-please to bump
src/version.py.
Reviewed changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
uv.lock |
Updates locked dependency set (includes worker-flash and runpod-flash bumps plus broader upgrades). |
tests/unit/test_version.py |
Adds unit coverage for version resolution and banner formatting. |
tests/unit/test_lb_handler.py |
Mocks version.format_version_banner() to avoid LB handler import-time side effects. |
src/version.py |
New module defining __version__ and version/banner helpers. |
src/lb_handler.py |
Logs version banner after unpack so bundled runpod_flash is importable. |
src/handler.py |
Logs version banner after unpack; updates generated handler import warning text. |
release-please-config.json |
Moves extra-files version bump target to src/version.py. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Remove docker-test-lb job (pytorch base, build-only, no tests) - Update docker-validation gate to 4 check jobs - Replace jlumbroso/free-disk-space with targeted rm -rf in prod jobs docker-test-lb-cpu already validates LB code (~2 min) and docker-test validates the pytorch base image. GPU LB image still builds on release via docker-prod-lb.
Remove unnecessary steps from PR docker jobs that only apply to prod cross-platform builds: lint dependency (validation gate already checks), QEMU (amd64-only), uv setup (Dockerfiles handle deps), disk cleanup (CPU images are ~150MB vs 14GB free), and full git history fetch. Add LB handler test to docker-test-lb-cpu for regression coverage.
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 7 out of 8 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
test-lb-handler.sh unconditionally used `uv run` which creates a fresh venv and re-downloads 117 packages inside Docker, consuming the entire 30s timeout before the server can start. Apply the same Docker detection pattern used in test-handler.sh: use system python directly when running inside a container where packages are pre-installed.
The test script polled /health for readiness but lb_handler.py only exposes /ping. Server started fine but the check always timed out.
KAJdev
approved these changes
Feb 26, 2026
boto3 1.42.57->1.42.58, ruff 0.15.3->0.15.4, runpod-flash 1.4.1->1.4.2
deanq
added a commit
that referenced
this pull request
Feb 26, 2026
* feat(worker): add version logging after unpack for accurate reporting Log worker, runpod-flash, and runpod versions at boot. Banner is emitted after maybe_unpack() so the bundled runpod_flash (from flash build) is on sys.path, reporting the actual deployed version rather than the base image's pip-installed version. - Add version.py with __version__ constant and package version helpers - Read flash version from bundled runpod_flash.__version__ first - Fall back to importlib.metadata for non-bundled environments - Move version banner to after unpack in both QB and LB handlers * refactor(version): read worker version from pyproject.toml instead of hardcoded constant Worker version is now read from the co-located pyproject.toml via regex, eliminating manual version maintenance. Falls back to importlib.metadata if pyproject.toml is unavailable. * fix(version): use __version__ constant instead of pyproject.toml reading The pyproject.toml-reading approach fails because maybe_unpack() extracts the user's flash project to /app/, overwriting the worker's pyproject.toml with the user's (version 0.1.0). Use a release-please-managed __version__ constant instead. * perf(ci): remove 56-min GPU LB build from PR checks - Remove docker-test-lb job (pytorch base, build-only, no tests) - Update docker-validation gate to 4 check jobs - Replace jlumbroso/free-disk-space with targeted rm -rf in prod jobs docker-test-lb-cpu already validates LB code (~2 min) and docker-test validates the pytorch base image. GPU LB image still builds on release via docker-prod-lb. * perf(ci): optimize PR docker jobs and add LB handler test Remove unnecessary steps from PR docker jobs that only apply to prod cross-platform builds: lint dependency (validation gate already checks), QEMU (amd64-only), uv setup (Dockerfiles handle deps), disk cleanup (CPU images are ~150MB vs 14GB free), and full git history fetch. Add LB handler test to docker-test-lb-cpu for regression coverage. * fix(ci): use system python in LB handler test inside Docker test-lb-handler.sh unconditionally used `uv run` which creates a fresh venv and re-downloads 117 packages inside Docker, consuming the entire 30s timeout before the server can start. Apply the same Docker detection pattern used in test-handler.sh: use system python directly when running inside a container where packages are pre-installed. * fix(ci): use /ping endpoint in LB handler test The test script polled /health for readiness but lb_handler.py only exposes /ping. Server started fine but the check always timed out. * chore(deps): update dependencies boto3 1.42.57->1.42.58, ruff 0.15.3->0.15.4, runpod-flash 1.4.1->1.4.2
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.
Problem
The worker startup banner was reporting wrong versions:
unknownbecauseworker-flashis a virtual package (never pip-installed), soimportlib.metadataalways fails1.4.0) instead of the bundled version (1.4.1) that actually runs at runtimemaybe_unpack(), so the bundledrunpod_flashwasn't even onsys.pathyetChanges
New
version.pymodule__version__constant managed by release-please (x-release-please-versionannotation)runpod_flash.__version__from the bundled package, falls back toimportlib.metadataimportlib.metadata(always pip-installed, so this is correct)Banner timing
format_version_banner()call to AFTERmaybe_unpack()in bothhandler.pyandlb_handler.py, so the bundledrunpod_flashis onsys.pathwhen the version is readrelease-please config
extra-filesto point atsrc/version.pyso__version__is auto-bumped on releaseResult
Before:
Starting Flash Worker vunknown | runpod-flash 1.4.0 | runpod 1.8.1After:
Starting Flash Worker 1.1.0 | runpod-flash 1.4.1 | runpod 1.8.1Companion PR
__version__torunpod_flash, fixes User-Agent, always bundles)Test plan
make quality-checkpasses (279 tests, 81% coverage,version.pyat 100%)pyproject.toml