bundle.lambdalabs.runner ======================== .. py:module:: bundle.lambdalabs.runner .. autoapi-nested-parse:: Lambda Labs remote job runner — full lifecycle management. Attributes ---------- .. autoapisummary:: bundle.lambdalabs.runner.log bundle.lambdalabs.runner.BUNDLE_INSTALL_CMD Classes ------- .. autoapisummary:: bundle.lambdalabs.runner.RemoteJob Module Contents --------------- .. py:data:: log .. py:data:: BUNDLE_INSTALL_CMD :value: 'pip install --quiet thebundle 2>/dev/null || pip install --quiet... .. py:class:: RemoteJob(config: bundle.lambdalabs.config.LambdaLabsConfig | None = None, api_key: str | None = None, ssh_key_path: pathlib.Path | None = None, ssh_user: str = 'ubuntu', auto_terminate: bool = False, filesystem_name: str | None = None) Manages a single remote training job on Lambda Labs. Lifecycle: 1. launch() — start a GPU instance (or attach to an existing one) 2. wait() — poll until active + has IP 3. setup() — install bundle on the remote instance 4. upload() — rsync local workspace → remote (skips unchanged files) 5. run() — execute a command via SSH 6. download() — rsync remote results → local 7. terminate()— shut down the instance (optional) Filesystem mode (recommended): Pass ``filesystem_name`` to mount a Lambda Labs persistent NFS volume. The workspace lives at ``/home/ubuntu//`` and survives instance termination — images and SfM output are never re-uploaded. Only the small ``runs/`` results are downloaded after each job. .. py:attribute:: config .. py:attribute:: ssh_key_path .. py:attribute:: ssh_user :value: 'ubuntu' .. py:attribute:: auto_terminate :value: False .. py:attribute:: filesystem_name :type: str .. py:attribute:: instance :type: bundle.lambdalabs.models.Instance | None :value: None .. py:method:: launch(instance_type: str | None = None, ssh_key_name: str | None = None, region: str | None = None, name: str | None = None, instance_id: str | None = None) -> bundle.lambdalabs.models.Instance :async: Launch a new instance or attach to an existing one by ID. .. py:method:: wait(timeout: float = 600) -> bundle.lambdalabs.models.Instance :async: Poll until the instance is active with an IP. .. py:method:: setup() -> None :async: Install bundle on the remote instance. .. py:method:: upload(local: pathlib.Path, remote: pathlib.Path, skip_existing: bool = False) -> None :async: rsync local directory → remote instance. When ``skip_existing=True`` (set automatically in filesystem mode), files already on the remote are not re-transferred — saving time and bandwidth for large image datasets on subsequent runs. .. py:method:: download(remote: pathlib.Path, local: pathlib.Path) -> None :async: rsync remote directory → local. .. py:method:: run(command: str) -> None :async: Execute a shell command on the remote instance via SSH. .. py:method:: terminate() -> None :async: Terminate the instance.