This module and its submodules contains utilities for running external processes and interfacing with job managers. This module should contain functionality shared between Galaxy and the Pulsar., use_psutil=True)[source]

Submodules module[source]

Return the abstraction description of an environment variable definition into a statement for shell script.

>>> env_to_statement(dict(name='X', value='Y'))
'X="Y"; export X'
>>> env_to_statement(dict(name='X', value='Y', raw=True))
'X=Y; export X'
>>> env_to_statement(dict(name='X', value='"A","B","C"'))
'X="\\"A\\",\\"B\\",\\"C\\""; export X'
>>> env_to_statement(dict(file="Y"))
'. "Y"'
>>> env_to_statement(dict(file="'RAW $FILE'", raw=True))
". 'RAW $FILE'"
>>> # Source file takes precedence
>>> env_to_statement(dict(name='X', value='"A","B","C"', file="S"))
'. "S"'
>>> env_to_statement(dict(execute="module load java/1.5.1"))
'module load java/1.5.1' module, type=None)[source]

Attempt to parse the output of job submission commands for an external id.__doc__

>>> parse_external_id("12345.pbsmanager")
>>> parse_external_id('Submitted batch job 185')
>>> parse_external_id('Submitted batch job 185', type='torque')
'Submitted batch job 185'
>>> parse_external_id('submitted to cluster 125.')
>>> parse_external_id('submitted to cluster 125.', type='slurm')
>>> module, use_psutil=True)[source] module[source]

Check whether processes in process group pgid are still alive.[source]

Kill all processes in process group pgid. module

Interface layer for pykube library shared between Galaxy and Pulsar.[source], service_name, namespace=None)[source], ingress_name, namespace=None)[source], job_name, namespace=None)[source], job_name, namespace=None)[source][source]

Parse and validate the id of the Galaxy instance from supplied dict.

This will be added to Jobs and Pods names, so it needs to be DNS friendly, this means: The Internet standards (Requests for Comments) for protocols mandate that component hostname labels may contain only the ASCII letters ‘a’ through ‘z’ (in a case-insensitive manner), the digits ‘0’ through ‘9’, and the minus sign (‘-‘).

It looks for the value set on params[‘k8s_galaxy_instance_id’], which might or not be set. The idea behind this is to allow the Galaxy instance to trust (or not) existing k8s Jobs and Pods that match the setup of a Job that is being recovered or restarted after a downtime/reboot., pod, namespace=None)[source], job_prefix, spec)[source], service_name, spec)[source], ingress_name, spec)[source], instance_id=None)[source][source][source], cleanup='always')[source], cleanup='always', job_failed=False)[source], cleanup='always', job_failed=False)[source], data_claim=None, working_claim=None)[source][source]

pvc_param (str) – the pvc mount param in the format pvc-name/subpath/desired:/mountpath/desired[:r]

Return type



a dict like:

{"name": "pvc-name",
 "subPath": "subpath/desired",
 "mountPath": "/mountpath/desired",
 "readOnly": False} module*args, **kwargs)[source]

Helper method for building and executing Popen command. This is potentially sensetive code so should probably be centralized.