rush.client¶
- class rush.client.RunError(message)[source]¶
Bases:
objectRepresents a run error message, returned from failed collected runs.
- Parameters:
message (str)
- message: str¶
- class rush.client.RunOpts(name=None, description=None, tags=None, email=None)[source]¶
Bases:
objectThe description currently doesn’t show up anywhere. The tags will also show up in the Rush UI and will (eventually) allow for run searching and filtering. The email flag, if set to True, will cause an email to be sent to you upon run completion.
- Parameters:
name (str | None)
description (str | None)
tags (list[str] | None)
email (bool | None)
- description: str | None = None¶
- email: bool | None = None¶
- name: str | None = None¶
Shows up as the name (i.e. title) of the run in the Rush UI.
- tags: list[str] | None = None¶
- class rush.client.RunSpec(target=None, walltime=None, storage=10, storage_units='MB', cpus=None, gpus=None, nodes=None)[source]¶
Bases:
objectThe run specification: configuration for the target and resources of a run.
- Parameters:
target (Target | None)
walltime (int | None)
storage (int | None)
storage_units (StorageUnit | None)
cpus (int | None)
gpus (int | None)
nodes (int | None)
- cpus: int | None = None¶
The number of CPUs for the run. Default is module-specific.
- gpus: int | None = None¶
The number of GPUs for the run. Default is module-specific.
- nodes: int | None = None¶
The number of nodes for the run. Only relevant for supercomputer targets. Default is module-specific.
- storage: int | None = 10¶
Max storage in the specified storage units for the run.
- storage_units: StorageUnit | None = 'MB'¶
The storage units for the run.
- target: Target | None = None¶
The Rush-specified hardware that the run will be submitted to. By default, randomly chooses a cloud compute “Bullet” node of the three available.
- walltime: int | None = None¶
Max walltime in minutes for the run.
- class rush.client.RushRun(id, created_at, updated_at, status, deleted_at=None, name=None, description=None, tags=None, result=None, trace=None, stdout=None)[source]¶
Bases:
objectPrint it out to see a nicely-formatted summary of a run!
- Parameters:
id (str)
created_at (str)
updated_at (str)
status (str)
deleted_at (str | None)
name (str | None)
description (str | None)
tags (list[str] | None)
result (dict | None)
trace (dict | None)
stdout (str | None)
- created_at: str¶
- deleted_at: str | None = None¶
- description: str | None = None¶
- id: str¶
- name: str | None = None¶
- result: dict | None = None¶
- status: str¶
- stdout: str | None = None¶
- tags: list[str] | None = None¶
- trace: dict | None = None¶
- updated_at: str¶
- rush.client.collect_run(run_id, max_wait_time=3600)[source]¶
Waits until the run finishes, or max_wait_time elapses, and returns either the actual result of the run, an error string if the run failed, or a string indicating that the run timed out.
- Parameters:
run_id (str)
max_wait_time (int)
- Return type:
dict | RunError
- rush.client.delete_run(run_id)[source]¶
Delete a run by ID.
- Parameters:
run_id (str)
- Return type:
None
- rush.client.download_object(path)[source]¶
Downloads the contents of the given Rush object store path directly into a variable. Be careful, if the contents are too large it might not fit into memory!
- Parameters:
path (str)
- rush.client.fetch_run_info(run_id)[source]¶
Fetch all info for a run by ID.
Returns None if the run doesn’t exist.
- Parameters:
run_id (str)
- Return type:
RushRun | None
- rush.client.fetch_runs(*, name=None, name_contains=None, status=None, tags=None, limit=None)[source]¶
Query runs and return their IDs.
- Parameters:
name (str | None) – Filter by exact run name (case-insensitive).
name_contains (str | None) – Filter by runs whose name contains this substring.
status (RunStatus | list[RunStatus] | None) – Filter by status. Can be a single status or a list of statuses.
tags (list[str] | None) – Filter by tags. Returns runs that have ALL specified tags.
limit (int | None) – Maximum number of runs to return. If None, returns all matching runs.
- Returns:
A list of run IDs matching the filters.
- Return type:
list[str]
- rush.client.save_json(d, filepath=None, name=None)[source]¶
Save a JSON file into the workspace folder. Convenient for saving non-object JSON output from a module run alongside the object outputs.
- Parameters:
d (dict)
filepath (Path | str | None)
name (str | None)
- rush.client.save_object(path, filepath=None, name=None, type=None, ext=None, extract=False)[source]¶
Saves the contents of the given Rush object store path into the workspace folder. Provides a variety of naming schemes, and supports automatically extracting tar.zst archives (which are sometimes used for module outputs).
Note
The filepath and name parameters are mutually exculsive.
- Parameters:
path (str) – The Rush object store path to save.
filepath (Path | str | None) – Overrides the path to save to.
name (str | None) – Sets the name of the file to save to.
type (Literal['json', 'bin'] | None) – Manually specify the type of object (usually not necessary).
ext (str | None) – Manually the filetype extension to use (otherwise, based on type).
extract (bool) – Automatically extract tar.zst files before saving.
- Return type:
Path
- rush.client.set_opts(workspace_dir=None)[source]¶
Sets Rush options. Currently, only allows setting the workspace directory.
- Parameters:
workspace_dir (Path | None)
- rush.client.upload_object(filepath)[source]¶
Upload an object at the filepath to the current project. Usually not necessary; the module functions should handle this automatically.
- Parameters:
filepath (Path | str)
- rush.client.RunStatus¶
pending runs are queued for submission to a target.
- Type:
All self-explanatory
alias of
Literal[‘pending’, ‘running’, ‘done’, ‘error’, ‘cancelled’, ‘draft’]
- rush.client.StorageUnit¶
Valid values for the storage_units field of RunSpec.
alias of
Literal[‘KB’, ‘MB’, ‘GB’]
- rush.client.Target¶
Valid values for the target field of RunSpec.
alias of
Literal[‘Bullet’, ‘Bullet2’, ‘Bullet3’, ‘Gadi’, ‘Setonix’]