Grid Queueing¶
Interface for configuring and submitting jobs on a computing cluster. Do not use this class directly. Instead use one of the batch plugins that inherit from this class.
- class iceprod.server.grid.BaseGrid(cfg, rest_client, cred_client)[source]¶
Interface for a generic job distribution system. Do not use this class directly. Use one of the plugins.
- async dataset_lookup(dataset_id: str) Dataset [source]¶
Lookup a dataset fromn the REST API.
Uses caching with TTL 60 seconds.
- Parameters:
dataset_id – dataset id
- Returns:
iceprod.core.config.Dataset object
- async get_tasks_to_queue(num: int) list[Task] [source]¶
Get new tasks to queue from the REST API.
- Parameters:
num – number of tasks to retrieve
- Returns:
list of iceprod.core.config.Task objects
- async get_tasks_on_queue() list [source]¶
Get all tasks that are “assigned” to this queue.
- Returns:
list of tasks
- async task_idle(task: GridTask)[source]¶
Tell IceProd API a task is now idle on the queue (put back to “queue” status).
- Parameters:
task – IceProd task info
- async task_processing(task: GridTask, site: str | None = None)[source]¶
Tell IceProd API a task is now processing (put in the “processing” status).
- Parameters:
task – IceProd task info
site – computing site the task is running at
- async task_reset(task: GridTask, reason: str | None = None, stats: dict | None = None)[source]¶
Tell IceProd API a task should be reset back to the “waiting” status.
- Parameters:
task – IceProd task info
stats – task resource statistics
reason – A reason for failure
- async task_failure(task: GridTask, reason: str | None = None, stats: dict | None = None, stdout: Path | None = None, stderr: Path | None = None)[source]¶
Tell IceProd API a task should be put in the “failed” status.
- Stats format:
- {
resources: {cpu: 1, gpu: 1, …}, …
}
- Parameters:
task – IceProd task info
reason – A reason for failure
stats – task resource statistics
stdout – path to stdout file
stderr – path to stderr file
- async task_success(task: GridTask, stats: dict | None = None, stdout: Path | None = None, stderr: Path | None = None)[source]¶
Tell IceProd API a task was successfully completed.
- Parameters:
task – IceProd task info
stats – task resource statistics
stdout – path to stdout file
stderr – path to stderr file