Skip to content

nodus.volume

View Markdown

Volume: named storage with Modal’s commit and reload semantics for ReadWriteMany (resources.md §5.1, ADR-091).

File transfers go through the kopia client inside the nodus CLI with a storage grant from the Volume’s uploads subresource, so they run at object-store speed and never proxy bytes through the API.

class BatchUpload(volume: _Volume) -> None
put_directory(local_path: str | os.PathLike[str], remote_path: str) -> None
put_file(local_path: str | os.PathLike[str], remote_path: str) -> None
class Volume(name: str, *, create_if_missing: bool = False, access_mode: str | None = None, size: str = '50Gi', project: str | None = None, source: Obj | None = None) -> None
batch_upload() -> _BatchUpload

with vol.batch_upload() as up: up.put_file(...); up.put_directory(...) uploads as one revision.

clear() -> None

Commit an empty revision; the Volume and its history stay.

commit() -> None

Inside a container that mounts this Volume: publish this attempt’s changed paths as a new revision.

from_name(name: str, create_if_missing: bool = False, access_mode: str | None = None, size: str = '50Gi', project: str | None = None) -> _Volume

A reference resolved on first use; create_if_missing=True creates a ReadWriteMany Volume (as Modal).

import_from(name: str, *, huggingface: str | None = None, revision: str | None = None, git: str | None = None, url: str | None = None, sha256: str | None = None, extract: str = 'auto', s3: str | None = None, connection: str | None = None, query: str | None = None, secret: str | None = None, size: str = '50Gi', project: str | None = None) -> _Volume

Create a ReadOnlyMany Volume imported from Hugging Face, git, a URL, S3 or a Connection query.

listdir(path: str = '/') -> list[str]

Type: str

put_directory(local_path: str | os.PathLike[str], remote_path: str) -> None
put_file(local_path: str | os.PathLike[str], remote_path: str) -> None
read_file(remote_path: str) -> bytes
reload() -> None

Inside a container: remount the latest revision (close open files first).

remove_file(path: str) -> None
revisions() -> list[Obj]