Skip to content

podspec

The parts of a pod which every backend shares: image, shapes, command, environment.

simrun.argo and simrun.cwl run the same commands with the same environment; they differ in where the run store and the scratch directory are (a mount, a path) and in how a worker is named.

number

number(value)

A number of GiB for the environment, e.g. 0.5.

task_dir

task_dir(record, task_id, store)

The directory of a task below the store root store.

output

output(record, ref)

The output a reference <task>.<port> names, relative to the store.

env_values

env_values(record, task, task_type, shape, store, scratch)

The environment of the worker harness, see simrun.worker.

Parameters:

Name Type Description Default
record RunRecord

The run.

required
task TaskSpec

The task.

required
task_type TaskType

Its type.

required
shape PodShape

The pod shape.

required
store str

The root of the store as the pod sees it.

required
scratch str

The scratch directory of the pod.

required

Returns:

Type Description
dict[str, str]

The variables by name, PYTHONPATH the root of the model

dict[str, str]

(import_root); the caller adds the ones of its backend.

Raises:

Type Description
ValueError

The task stages a port which is no input.

import_root

import_root(record, store)

The root of the model, which a task imports from first.

As python -m in a checkout puts the checkout first on the path, a task of a model imports from the root of the model, e.g. examples at the root of a checkout of sbmlsim, which no installed package has.

Parameters:

Name Type Description Default
record RunRecord

The run, its first source the model.

required
store str

The root of the store as the pod sees it.

required

Returns:

Type Description
str | None

The snapshot of the model, else its recorded working tree, None for a run

str | None

without sources.

image

image(record, task, task_type)

The image of a task: the one of its type, else the one of the run.

Raises:

Type Description
ValueError

The type has no image and the run has none.

merge_shape

merge_shape(shape, base_gb)

The merge: one core and the memory of one worker process besides the base.

unsplit_command

unsplit_command(record, task, task_type, store, scratch)

The image and argv of an unsplit task.

The image of a command task is the one of its settings, the image of a plugin type the one of image; the argv is unsplit_argv.

Parameters:

Name Type Description Default
record RunRecord

The run.

required
task TaskSpec

The task.

required
task_type TaskType

Its type.

required
store str

The root of the store as the pod sees it.

required
scratch str

The scratch directory of the pod, as in env_values.

required

Returns:

Type Description
tuple[str, list[str]]

The image and the argv.

Raises:

Type Description
ValueError

The type is neither splittable nor has a command, or it has no image and the run has none.

unsplit_argv

unsplit_argv(record, task, task_type, store, scratch)

The argv of an unsplit task, without its image.

The command of a plugin type runs through simrun-exec, which installs the snapshots, sets the thread variables and writes a report; a command task runs its args. In the command template of a type and in the args of a command task, {settings} is the path of the settings file and {out} the output directory of the task, and a part with {input} is repeated once per input port of the task, sorted by port, with {input} replaced by <port>=<path>, the output the port reads as the pod sees it, or <scratch>/<port> for a staged port of a plugin type, the copy simrun-exec stages; without inputs the part is dropped. The local backend runs it without an image, which a run there does not have.

Parameters:

Name Type Description Default
record RunRecord

The run.

required
task TaskSpec

The task.

required
task_type TaskType

Its type.

required
store str

The root of the store as the pod sees it.

required
scratch str

The scratch directory of the pod, as in env_values.

required

Returns:

Type Description
list[str]

The argv.

Raises:

Type Description
ValueError

The type is neither splittable nor has a command.