Skip to content

nodus.app

View Markdown

App: the group of Functions defined in one Python file (resources.md §3.9, ADR-047).

with app.run(): creates an ephemeral App (renewed every 30 s, deleted on exit, so a vanished client leaves nothing running); app.deploy() creates or updates the persistent App and prunes members removed from the file. Code is uploaded once per content hash. Decorating never touches the network, so the worker can import the same file.

class App(name: str, *, project: str | None = None, image: Any = None, secrets: list[Any] | None = None, volumes: dict[str, Any] | None = None, description: str | None = None) -> None
cls(_cls: type | None = None, **options: Any) -> Any

Register a class as one Function; @nodus.method()s are callable remotely, hooks run once per worker.

deploy() -> View

Create or update the persistent App and its members; members no longer in the file are deleted.

function(_fn: Callable[..., Any] | None = None, *, name: str | None = None, gpu: Any = None, cpu: Any = None, memory: Any = None, ephemeral_disk: Any = None, image: Any = None, secrets: list[Any] | None = None, volumes: dict[str, Any] | None = None, env: dict[str, str] | None = None, network: Any = None, timeout: Any = None, retries: Any = None, checkpoint: Any = None, interruptible: Any = None, region: Any = None, profile: Any = None, max_cost: Any = None, min_workers: int | None = None, max_workers: int | None = None, scaledown_window: Any = None, target_concurrency: int | None = None, min_containers: int | None = None, max_containers: int | None = None) -> Any

Register a Function; the arguments map onto Function spec fields (resources.md §10.4).

local_entrypoint(_fn: Callable[..., Any] | None = None, *, name: str | None = None) -> Any

Mark the function nodus run app.py calls inside an ephemeral run of this App.

Type: str

Type: dict[str, Callable[..., Any]]

Type: dict[str, _Function]

run(*, show_logs: bool = True) -> AsyncIterator[_App]

Run the App ephemerally for the duration of the with block; it is deleted on exit.