Skip to content

nodus.workspace

View Markdown

Workspace: a development machine with SSH, VS Code, JupyterLab and a persistent home (resources.md §3.8).

class Workspace(obj: Obj) -> None
create(name: str, *, gpu: Any = None, cpu: Any = None, memory: Any = None, disk: Any = None, image: str | None = None, volume: str | _Volume | None = None, ephemeral: bool = False, tools: list[str] | None = None, idle_timeout: Any = None, secrets: list[Any] | None = None, env: dict[str, str] | None = None, max_cost: Any = None, project: str | None = None) -> _Workspace

Create a Workspace; unless ephemeral=True its home is volume (default <name>-home), made if missing.

exec(*command: str, pty: bool = False) -> _Process

Type: _Files

from_name(name: str, project: str | None = None) -> _Workspace
logs(follow: bool = False) -> AsyncIterator[str]

Type: str

open(tool: str = 'vscode', browser: bool = True) -> str

Mint a preview URL for VS Code or JupyterLab in the browser, open it, and return it.

schedule(ready_by: str | datetime, stop_at: str | datetime | None = None) -> None

Be ready by ready_by (it starts 15 minutes earlier) and stop at stop_at.

sessions() -> list[View]

Every running period of this Workspace, each an Attempt whose status is the session’s receipt.

ssh() -> None

Open an interactive SSH session through the CLI’s ssh-proxy (the CLI writes ~/.ssh/config).

start() -> None
status() -> View
stop() -> None
unschedule() -> None
wait_ready(timeout: float | None = None) -> View

Block until the tools answer (phase Running); raises when it fails or stops instead.