Skip to content

fix(apps): bind volume mounts from RUNPOD_MOUNTS when the runtime did not - #626

Draft
justinwlin wants to merge 1 commit into
mainfrom
fix/volume-path-self-configure
Draft

justinwlin wants to merge 1 commit into
mainfrom
fix/volume-path-self-configure

Conversation

@justinwlin

Copy link
Copy Markdown
Contributor

In deployed apps, NetworkVolume.path raised volume '...' is not mounted in the current execution even though the volume was attached at /runpod-volume.

Cause

vol.path reads bindings that the worker runtime installs by calling _configure_mounts before user code (sdk-runtime mounts.py, added 2026-09-29). The published runtime images (runpod/queue:py3.12-latest and the rest) were pushed on 2026-09-22 and don't contain that hook. docker run against the image shows no mounts.py, and its queue/worker.py never calls configure_mounts. The bindings are never installed.

Change

Deployed workers run the client's vendored runpod, so the first vol.path lookup now installs the bindings from the RUNPOD_MOUNTS provisioning env itself when the runtime hasn't. A runtime that configured mounts still takes precedence. Invalid JSON raises VolumeError.

This removes the SDK's dependence on the image for vol.path. The images still need a rebuild for dev sessions, which run on the image's own runpod.

Verification
  • Live rp flash deploy on the current images, with a CPU queue writing through vol.path / "probe.txt". It returned {'path': '/runpod-volume', 'read': 'ok'}. The app and volume were deleted afterward.
  • New tests: binding from the env when the runtime didn't, runtime configuration winning, and invalid env JSON. pytest tests: all pass, coverage above 90%.

… not

vol.path reads bindings the worker runtime installs through
_configure_mounts before user code. Runtime images published before
that hook never call it, so on them every deployed NetworkVolume
attached but vol.path raised "not mounted in the current execution".

Deployed workers run the client's vendored runpod package, so the
first vol.path lookup now installs the bindings from the RUNPOD_MOUNTS
provisioning env itself when the runtime has not. A runtime that
configured mounts still takes precedence.
def test_path_binds_from_env_when_runtime_did_not(self, monkeypatch):
# runtime images released before the mounts hook never call
# _configure_mounts; the vendored sdk reads the env itself
import runpod.apps.volume as volume_mod
NetworkVolume("models").path

def test_invalid_env_bindings_raise(self, monkeypatch):
import runpod.apps.volume as volume_mod
def test_path_binds_from_env_when_runtime_did_not(self, monkeypatch):
# runtime images released before the mounts hook never call
# _configure_mounts; the vendored sdk reads the env itself
import runpod.apps.volume as volume_mod
NetworkVolume("models").path

def test_invalid_env_bindings_raise(self, monkeypatch):
import runpod.apps.volume as volume_mod

This branch has not been deployed

No deployments
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.

2 participants