:py:mod:`cwltool.job`
=====================

.. py:module:: cwltool.job


Module Contents
---------------

Classes
~~~~~~~

.. autoapisummary::

   cwltool.job.JobBase
   cwltool.job.CommandLineJob
   cwltool.job.ContainerCommandLineJob



Functions
~~~~~~~~~

.. autoapisummary::

   cwltool.job.relink_initialworkdir
   cwltool.job.neverquote



Attributes
~~~~~~~~~~

.. autoapisummary::

   cwltool.job.CollectOutputsType
   cwltool.job.needs_shell_quoting_re
   cwltool.job.FORCE_SHELLED_POPEN
   cwltool.job.SHELL_COMMAND_TEMPLATE
   cwltool.job.CONTROL_CODE_RE


.. py:data:: CollectOutputsType

   

.. py:data:: needs_shell_quoting_re

   

.. py:data:: FORCE_SHELLED_POPEN

   

.. py:data:: SHELL_COMMAND_TEMPLATE
   :value: Multiline-String

    .. raw:: html

        <details><summary>Show Value</summary>

    .. code-block:: python

        """#!/bin/bash
        python3 "run_job.py" "job.json"
        """

    .. raw:: html

        </details>

   

.. py:function:: relink_initialworkdir(pathmapper, host_outdir, container_outdir, inplace_update = False)


.. py:function:: neverquote(string, pos = 0, endpos = 0)


.. py:class:: JobBase(builder, joborder, make_path_mapper, requirements, hints, name)


   Bases: :py:obj:`cwltool.utils.HasReqsHints`

   .. autoapi-inheritance-diagram:: cwltool.job.JobBase
      :parts: 1

   Base class for get_requirement().

   .. py:method:: __repr__()

      Represent this Job object.


   .. py:method:: run(runtimeContext, tmpdir_lock = None)
      :abstractmethod:


   .. py:method:: prepare_environment(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).


   .. py:method:: process_monitor(sproc)

      Watch a process, logging its max memory usage.



.. py:class:: CommandLineJob(builder, joborder, make_path_mapper, requirements, hints, name)


   Bases: :py:obj:`JobBase`

   .. autoapi-inheritance-diagram:: cwltool.job.CommandLineJob
      :parts: 1

   Base class for get_requirement().

   .. py:method:: run(runtimeContext, tmpdir_lock = None)



.. py:data:: CONTROL_CODE_RE
   :value: '\\x1b\\[[0-9;]*[a-zA-Z]'

   

.. py:class:: ContainerCommandLineJob(builder, joborder, make_path_mapper, requirements, hints, name)


   Bases: :py:obj:`JobBase`

   .. autoapi-inheritance-diagram:: cwltool.job.ContainerCommandLineJob
      :parts: 1

   Commandline job using containers.

   .. py:attribute:: CONTAINER_TMPDIR
      :type: str
      :value: '/tmp'

      

   .. py:method:: get_from_requirements(r, pull_image, force_pull, tmp_outdir_prefix)
      :abstractmethod:


   .. py:method:: create_runtime(env, runtime_context)
      :abstractmethod:

      Return the list of commands to run the selected container engine.


   .. py:method:: append_volume(runtime, source, target, writable = False)
      :staticmethod:
      :abstractmethod:

      Add binding arguments to the runtime list.


   .. py:method:: add_file_or_directory_volume(runtime, volume, host_outdir_tgt)
      :abstractmethod:

      Append volume a file/dir mapping to the runtime option list.


   .. py:method:: add_writable_file_volume(runtime, volume, host_outdir_tgt, tmpdir_prefix)
      :abstractmethod:

      Append a writable file mapping to the runtime option list.


   .. py:method:: add_writable_directory_volume(runtime, volume, host_outdir_tgt, tmpdir_prefix)
      :abstractmethod:

      Append a writable directory mapping to the runtime option list.


   .. py:method:: create_file_and_add_volume(runtime, volume, host_outdir_tgt, secret_store, tmpdir_prefix)

      Create the file and add a mapping.


   .. py:method:: add_volumes(pathmapper, runtime, tmpdir_prefix, secret_store = None, any_path_okay = False)

      Append volume mappings to the runtime option list.


   .. py:method:: run(runtimeContext, tmpdir_lock = None)


   .. py:method:: docker_monitor(cidfile, tmpdir_prefix, cleanup_cidfile, docker_exe, process)

      Record memory usage of the running Docker container.



