Skip to content

fix(deploy): onnxruntime is a runtime dependency; bake the demo model into the image - #74

Merged
Thomasbehan merged 1 commit into
mainfrom
fix/render-runtime-deps
Jul 27, 2026
Merged

fix(deploy): onnxruntime is a runtime dependency; bake the demo model into the image#74
Thomasbehan merged 1 commit into
mainfrom
fix/render-runtime-deps

Conversation

@Thomasbehan

Copy link
Copy Markdown
Owner

Fixes the Render deployment.

onnxruntime was missing from base requires

The demo now serves the JEPA family by default (#71), and its encoder loads through onnxruntime — but onnxruntime was declared only in the optional [jepa] training extra. The Dockerfile runs pip install -e ., i.e. base requires only, so the container imports cleanly and then raises ModuleNotFoundError: onnxruntime on the first /predict.

This is a bug I introduced when changing the default predictor; the dependency became a runtime one and the packaging didn't follow.

The image fetched a model the demo no longer serves

The Dockerfile pulled the old M-4s Keras model. The demo now serves JEPA medium, so the image now bakes that in instead. It could self-heal at runtime — _ensure_jepa_model downloads on demand — but that would make the first request after a cold start pull 318 MB, which on Render's free tier will time out and look like a broken app.

Verified locally

extract path matches Dockerfile test: OK
predictor loaded from baked-in path: JEPADemoPredictor | precision fp32

The exact curl … | tar xz -C models/jepa from the Dockerfile was run, then _get_predictor() loaded it with no environment overrides — the same path the container takes.

Test plan

  • ruff check clean
  • 100 tests pass (1 pre-existing Windows-only symlink failure)
  • Dockerfile fetch/extract verified end-to-end against the real release asset

Note: this addresses a runtime failure I can prove. If Render is failing at build time, that may be separate — TensorFlow 2.21 is a very heavy base dependency for a container that no longer needs it for the demo path. I'd want the actual build log before changing that.

…odel in

The web demo now serves the JEPA family by default, whose encoder loads through
onnxruntime — but onnxruntime was declared only in the optional [jepa] extra.
A deployment installing base requires (the Dockerfile runs `pip install -e .`)
imports cleanly and then raises ModuleNotFoundError on the first /predict.

The Dockerfile also fetched the old M-4s Keras model, which the demo no longer
serves. It now bakes in the JEPA medium tarball instead. The app can self-heal
by downloading it at runtime, but that would make the first request after a
cold start pull 318 MB and time out.

Verified: the fetch+extract produces models/jepa/medium/jepa_config.json and
_get_predictor() loads it with no environment overrides.
@render
render Bot temporarily deployed to fix/render-runtime-deps - LesNet PR #74 July 27, 2026 00:28 Destroyed
@Thomasbehan
Thomasbehan merged commit 8323cc8 into main Jul 27, 2026
6 checks passed
@Thomasbehan
Thomasbehan deleted the fix/render-runtime-deps branch July 27, 2026 00:30
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.

1 participant