Fallback Jobs

The FallbackJobSpec class is used to define a fallback job specification. An instance of this class contains all the parameters of a job to be sent to fallback cloud.

The FallbackJob class represents a fallback job that runs on a fallback cloud. This class includes methods checking the status and results of the job.

class compute_horde_sdk.v1.fallback.FallbackJobSpec

Specification of a fallback job to run on the given cloud.

run: str | None = None

A command to execute. It should be a single string, not a list of arguments.

envs: Mapping[str, str] | None = None

Environment variables to run the job with.

work_dir: str = '/'

Path to the working directory for the job. Defaults to /.

artifacts_dir: str | None = None

Path of the directory that the job will write its results to. Contents of files found in this directory will be returned after the job completes as a part of the job result. It should be an absolute path (starting with /).

input_volumes: Mapping[str, InlineInputVolume | HuggingfaceInputVolume | HTTPInputVolume] | None = None

The data to be made available to the job in Docker volumes. The keys should be absolute file/directory paths under which you want your data to be available. The values should be InputVolume instances representing how to obtain the input data. For now, input volume paths must start with /volume/.

output_volumes: Mapping[str, HTTPOutputVolume] | None = None

The data to be read from the Docker volumes after job completion and uploaded to the described destinations. Use this for outputs that are too big to be treated as artifacts. The keys should be absolute file paths under which job output data will be available. The values should be OutputVolume instances representing how to handle the output data. For now, output volume paths must start with /output/.

cpus: int | float | str | None = None

Required number of CPUs for the job.

memory: int | float | str | None = None

Required amount of memory for the job.

accelerators: str | Mapping[str, int] | None = None

Required GPUs for the job.

disk_size: int | None = None

Required amount of memory for the job.

ports: int | str | Sequence[str] | None = None

Required amount of memory for the job.

instance_type: str | None = None

Instance type.

image_id: str | None = None

Image ID. For docker it must be in the form of docker:<image>.

region: str | None = None

Region to run the job in.

zone: str | None = None

Zone to run the job in.

class compute_horde_sdk.v1.fallback.FallbackJob

The class representing a job running on the SkyPilot cloud. Do not construct it directly, always use FallbackClient.

Variables:
  • uuid (str) – The UUID of the job.

  • status (FallbackJobStatus) – The status of the job.

  • result (FallbackJobResult | None) – The result of the job, if it has completed.

async wait(timeout=None)

Wait for this job to complete or fail.

Parameters:

timeout (float | None) – Maximum number of seconds to wait for.

Raises:

FallbackJobTimeoutError – If the job does not complete within timeout seconds.

Return type:

None

async refresh()

Refresh the current status and result of the job.

Return type:

None

compute_horde_sdk.v1.fallback.FallbackJobStatus

alias of ComputeHordeJobStatus

class compute_horde_sdk.v1.fallback.FallbackJobResult

Result of a fallback job.