Skip to content

fix: add runtime version banner, log after unpack for accuracy#71

Merged
deanq merged 9 commits intomainfrom
fix/ae-2265-bug-cross-endpoint
Feb 26, 2026
Merged

fix: add runtime version banner, log after unpack for accuracy#71
deanq merged 9 commits intomainfrom
fix/ae-2265-bug-cross-endpoint

Conversation

@deanq
Copy link
Contributor

@deanq deanq commented Feb 26, 2026

Problem

The worker startup banner was reporting wrong versions:

  • Worker version showed unknown because worker-flash is a virtual package (never pip-installed), so importlib.metadata always fails
  • Flash version showed the pip-installed base image version (e.g. 1.4.0) instead of the bundled version (1.4.1) that actually runs at runtime
  • The banner was logged before maybe_unpack(), so the bundled runpod_flash wasn't even on sys.path yet

Changes

New version.py module

  • Worker version: __version__ constant managed by release-please (x-release-please-version annotation)
  • Flash version: reads runpod_flash.__version__ from the bundled package, falls back to importlib.metadata
  • RunPod SDK version: importlib.metadata (always pip-installed, so this is correct)

Banner timing

  • Moved format_version_banner() call to AFTER maybe_unpack() in both handler.py and lb_handler.py, so the bundled runpod_flash is on sys.path when the version is read

release-please config

  • Updated extra-files to point at src/version.py so __version__ is auto-bumped on release

Result

Before: Starting Flash Worker vunknown | runpod-flash 1.4.0 | runpod 1.8.1
After: Starting Flash Worker 1.1.0 | runpod-flash 1.4.1 | runpod 1.8.1

Companion PR

Test plan

  • make quality-check passes (279 tests, 81% coverage, version.py at 100%)
  • Deploy and verify banner reports bundled flash version, not base image version
  • Verify worker version matches pyproject.toml

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.
@deanq deanq changed the title Add version logging after unpack for accurate reporting Report accurate runtime versions in worker startup banner Feb 26, 2026
@deanq deanq changed the title Report accurate runtime versions in worker startup banner Add runtime version banner, log after unpack for accuracy Feb 26, 2026
@deanq deanq changed the title Add runtime version banner, log after unpack for accuracy fix: add runtime version banner, log after unpack for accuracy Feb 26, 2026
@deanq deanq requested a review from Copilot February 26, 2026 17:18
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.py to centralize worker/flash/runpod version resolution and banner formatting.
  • Move the startup banner log to after maybe_unpack() in src/handler.py and src/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.

deanq and others added 3 commits February 26, 2026 10:52
- 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.
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.
boto3 1.42.57->1.42.58, ruff 0.15.3->0.15.4, runpod-flash 1.4.1->1.4.2
@deanq deanq merged commit 74ea9ba into main Feb 26, 2026
20 of 22 checks passed
@deanq deanq deleted the fix/ae-2265-bug-cross-endpoint branch February 26, 2026 20:42
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants