cwltool.job
¶
Module Contents¶
Classes¶
Base class for get_requirement(). |
|
Base class for get_requirement(). |
|
Commandline job using containers. |
Functions¶
|
|
|
Attributes¶
- cwltool.job.needs_shell_quoting_re¶
- cwltool.job.FORCE_SHELLED_POPEN¶
- cwltool.job.SHELL_COMMAND_TEMPLATE = Multiline-String¶
Show Value
1#!/bin/bash 2python3 "run_job.py" "job.json"
- cwltool.job.relink_initialworkdir(pathmapper, host_outdir, container_outdir, inplace_update=False)¶
- Parameters
pathmapper (cwltool.pathmapper.PathMapper) –
host_outdir (str) –
container_outdir (str) –
inplace_update (bool) –
- Return type
None
- cwltool.job.neverquote(string, pos=0, endpos=0)¶
- Parameters
string (str) –
pos (int) –
endpos (int) –
- Return type
Optional[Match[str]]
- cwltool.job.CollectOutputsType¶
- class cwltool.job.JobBase(builder, joborder, make_path_mapper, requirements, hints, name)¶
Bases:
cwltool.utils.HasReqsHints
Base class for get_requirement().
- Parameters
builder (cwltool.builder.Builder) –
joborder (cwltool.utils.CWLObjectType) –
make_path_mapper (Callable[Ellipsis, cwltool.pathmapper.PathMapper]) –
requirements (List[cwltool.utils.CWLObjectType]) –
hints (List[cwltool.utils.CWLObjectType]) –
name (str) –
- __repr__(self)¶
Represent this Job object.
- Return type
str
- abstract run(self, runtimeContext, tmpdir_lock=None)¶
- Parameters
runtimeContext (cwltool.context.RuntimeContext) –
tmpdir_lock (Optional[threading.Lock]) –
- Return type
None
- prepare_environment(self, runtimeContext, envVarReq)¶
Set up environment variables.
Here we prepare the environment for the job, based on any preserved variables and EnvVarRequirement. Later, changes due to MPIRequirement, Secrets, or SoftwareRequirement are applied (in that order).
- Parameters
runtimeContext (cwltool.context.RuntimeContext) –
envVarReq (Mapping[str, str]) –
- Return type
None
- process_monitor(self, sproc)¶
- Parameters
self (subprocess.Popen[str]) –
- Return type
None
- class cwltool.job.CommandLineJob(builder, joborder, make_path_mapper, requirements, hints, name)¶
Bases:
JobBase
Base class for get_requirement().
- Parameters
builder (cwltool.builder.Builder) –
joborder (cwltool.utils.CWLObjectType) –
make_path_mapper (Callable[Ellipsis, cwltool.pathmapper.PathMapper]) –
requirements (List[cwltool.utils.CWLObjectType]) –
hints (List[cwltool.utils.CWLObjectType]) –
name (str) –
- run(self, runtimeContext, tmpdir_lock=None)¶
- Parameters
runtimeContext (cwltool.context.RuntimeContext) –
tmpdir_lock (Optional[threading.Lock]) –
- Return type
None
- cwltool.job.CONTROL_CODE_RE = \x1b\[[0-9;]*[a-zA-Z]¶
- class cwltool.job.ContainerCommandLineJob(builder, joborder, make_path_mapper, requirements, hints, name)¶
Bases:
JobBase
Commandline job using containers.
- Parameters
builder (cwltool.builder.Builder) –
joborder (cwltool.utils.CWLObjectType) –
make_path_mapper (Callable[Ellipsis, cwltool.pathmapper.PathMapper]) –
requirements (List[cwltool.utils.CWLObjectType]) –
hints (List[cwltool.utils.CWLObjectType]) –
name (str) –
- CONTAINER_TMPDIR :str = /tmp¶
- abstract get_from_requirements(self, r, pull_image, force_pull, tmp_outdir_prefix)¶
- Parameters
r (cwltool.utils.CWLObjectType) –
pull_image (bool) –
force_pull (bool) –
tmp_outdir_prefix (str) –
- Return type
Optional[str]
- abstract create_runtime(self, env, runtime_context)¶
Return the list of commands to run the selected container engine.
- Parameters
env (MutableMapping[str, str]) –
runtime_context (cwltool.context.RuntimeContext) –
- Return type
Tuple[List[str], Optional[str]]
- abstract static append_volume(runtime, source, target, writable=False)¶
Add binding arguments to the runtime list.
- Parameters
runtime (List[str]) –
source (str) –
target (str) –
writable (bool) –
- Return type
None
- abstract add_file_or_directory_volume(self, runtime, volume, host_outdir_tgt)¶
Append volume a file/dir mapping to the runtime option list.
- Parameters
runtime (List[str]) –
volume (cwltool.pathmapper.MapperEnt) –
host_outdir_tgt (Optional[str]) –
- Return type
None
- abstract add_writable_file_volume(self, runtime, volume, host_outdir_tgt, tmpdir_prefix)¶
Append a writable file mapping to the runtime option list.
- Parameters
runtime (List[str]) –
volume (cwltool.pathmapper.MapperEnt) –
host_outdir_tgt (Optional[str]) –
tmpdir_prefix (str) –
- Return type
None
- abstract add_writable_directory_volume(self, runtime, volume, host_outdir_tgt, tmpdir_prefix)¶
Append a writable directory mapping to the runtime option list.
- Parameters
runtime (List[str]) –
volume (cwltool.pathmapper.MapperEnt) –
host_outdir_tgt (Optional[str]) –
tmpdir_prefix (str) –
- Return type
None
- create_file_and_add_volume(self, runtime, volume, host_outdir_tgt, secret_store, tmpdir_prefix)¶
Create the file and add a mapping.
- Parameters
runtime (List[str]) –
volume (cwltool.pathmapper.MapperEnt) –
host_outdir_tgt (Optional[str]) –
secret_store (Optional[cwltool.secrets.SecretStore]) –
tmpdir_prefix (str) –
- Return type
str
- add_volumes(self, pathmapper, runtime, tmpdir_prefix, secret_store=None, any_path_okay=False)¶
Append volume mappings to the runtime option list.
- Parameters
pathmapper (cwltool.pathmapper.PathMapper) –
runtime (List[str]) –
tmpdir_prefix (str) –
secret_store (Optional[cwltool.secrets.SecretStore]) –
any_path_okay (bool) –
- Return type
None
- run(self, runtimeContext, tmpdir_lock=None)¶
- Parameters
runtimeContext (cwltool.context.RuntimeContext) –
tmpdir_lock (Optional[threading.Lock]) –
- Return type
None
- docker_monitor(self, cidfile, tmpdir_prefix, cleanup_cidfile, process)¶
Record memory usage of the running Docker container.
- Parameters
cidfile (str) –
tmpdir_prefix (str) –
cleanup_cidfile (bool) –
process (subprocess.Popen[str]) –
- Return type
None