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.
env_values
¶
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, |
dict[str, str]
|
( |
Raises:
| Type | Description |
|---|---|
ValueError
|
The task stages a port which is no input. |
import_root
¶
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
¶
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
¶
The merge: one core and the memory of one worker process besides the base.
unsplit_command
¶
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 |
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
¶
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 |
required |
Returns:
| Type | Description |
|---|---|
list[str]
|
The argv. |
Raises:
| Type | Description |
|---|---|
ValueError
|
The type is neither splittable nor has a command. |