Skip to content

service.submission

The submission of a run in the background: its environment, image and workflow.

POST /runs validates and plans a run, writes its record submitting (with the deterministic name of its workflow and the settings of its tasks) and returns its id at once. The controller then runs Submitter.run in its pool of submissions (Controller.start_submission): it resolves the environment of the run, builds its image when the registry does not have it (once per image: a second submission of the same new environment waits for the first build and finds the image), records the image and the time it was ready (built, from which the grace of a submission counts), reserves the node of the run and submits its workflow; the run is queued then.

A failure lands in the record: the run fails with a message, its node is released and a workflow a failed submission may have created is cancelled. A run cancelled while it is resolved or built is not submitted; one cancelled while its workflow is submitted has the workflow cancelled; the workflow of one cancelled and deleted meanwhile is cancelled as an orphan.

SubmissionError

Bases: Exception

A submission which cannot go on; the message is the one of the record.

Submitter

Submitter(
    store,
    backend,
    types,
    controller,
    cluster,
    python,
    simrun_wheel,
    build_constraints=None,
)

Resolves, builds and submits the runs written submitting.

Create the submitter.

Parameters:

Name Type Description Default
store RunStore

The run store.

required
backend Backend

The backend the workflows run on.

required
types dict[str, TaskType]

The task types by name.

required
controller Controller

The controller, whose lock guards the records.

required
cluster ClusterConfig

The cluster.

required
python str

Python version of the images.

required
simrun_wheel Path | None

The simrun wheel the images install.

required
build_constraints Path | None

The pinned versions of the build backends, the ones of simrun by default.

None

environment

environment(record)

The image of a run and the lock of its environment, built when missing.

A run whose model has no pyproject.toml keeps the image it was written with (the default image of the service).

Raises:

Type Description
SubmissionError

The environment cannot be resolved, the service has no simrun wheel to build with, or the build fails.

run

run(run_id)

Resolve, build and submit a run written submitting.

Parameters:

Name Type Description Default
run_id str

The run.

required

has_model_project

has_model_project(store, sources)

Whether the model of a run (its first source) has a pyproject.toml.