lwr.managers Module¶
Job Managers
lwr.managers.base Module¶
Base Classes and Infrastructure Supporting Concret Manager Implementations.
lwr.managers.base.base_drmaa Module¶
lwr.managers.base.directory Module¶
lwr.managers.base.external Module¶
-
class
lwr.managers.base.external.ExternalBaseManager(name, app, **kwds)[source]¶ Bases:
lwr.managers.base.directory.DirectoryBaseManagerBase class for managers that interact with external distributed resource managers.
-
class
lwr.managers.base.BaseManager(name, app, **kwds)[source]¶ Bases:
lwr.managers.ManagerInterface-
job_directory(job_id)¶
-
-
class
lwr.managers.base.JobDirectory(staging_directory, job_id, lock_manager=None)[source]¶ Bases:
lwr.lwr_client.job_directory.RemoteJobDirectory
-
lwr.managers.base.get_mapped_file(directory, remote_path, allow_nested_files=False, local_path_module=<module 'posixpath' from '/home/docs/checkouts/readthedocs.org/user_builds/lwr/envs/latest/lib/python2.7/posixpath.pyc'>, mkdir=True)[source]¶ >>> import ntpath >>> get_mapped_file(r'C:\lwr\staging\101', 'dataset_1_files/moo/cow', allow_nested_files=True, local_path_module=ntpath, mkdir=False) 'C:\\lwr\\staging\\101\\dataset_1_files\\moo\\cow' >>> get_mapped_file(r'C:\lwr\staging\101', 'dataset_1_files/moo/cow', allow_nested_files=False, local_path_module=ntpath) 'C:\\lwr\\staging\\101\\cow' >>> get_mapped_file(r'C:\lwr\staging\101', '../cow', allow_nested_files=True, local_path_module=ntpath, mkdir=False) Traceback (most recent call last): Exception: Attempt to read or write file outside an authorized directory.
lwr.managers.queued Module¶
-
class
lwr.managers.queued.QueueManager(name, app, **kwds)[source]¶ Bases:
lwr.managers.unqueued.ManagerA job manager that queues up jobs directly (i.e. does not use an external queuing software such PBS, SGE, etc...).
-
manager_type= 'queued_python'¶
-
lwr.managers.queued_drmaa Module¶
lwr.managers.queued_external_drmaa Module¶
-
class
lwr.managers.queued_external_drmaa.ExternalDrmaaQueueManager(name, app, **kwds)[source]¶ Bases:
lwr.managers.base.base_drmaa.BaseDrmaaManagerDRMAA backed queue manager.
-
manager_type= 'queued_external_drmaa'¶
-
lwr.managers.queued_condor Module¶
-
class
lwr.managers.queued_condor.CondorQueueManager(name, app, **kwds)[source]¶ Bases:
lwr.managers.base.external.ExternalBaseManagerJob manager backend that plugs into Condor.
-
manager_type= 'queued_condor'¶
-
lwr.managers.queued_pbs Module¶
-
class
lwr.managers.queued_pbs.PbsQueueManager(name, app, **kwds)[source]¶ Bases:
lwr.managers.base.BaseManagerPlaceholder for PBS-python backed queue manager. Not yet implemented, for many situations this would be used the DRMAA or CLI+Torque managers may be better choices or at least stop gaps.
-
manager_type= 'queued_pbs'¶
-
lwr.managers.unqueued Module¶
-
class
lwr.managers.unqueued.Manager(name, app, **kwds)[source]¶ Bases:
lwr.managers.base.directory.DirectoryBaseManagerA simple job manager that just directly runs jobs as given (no queueing). Preserved for compatibilty with older versions of LWR client code where Galaxy is used to maintain queue (like Galaxy’s local job runner).
-
manager_type= 'unqueued'¶
-
lwr.managers.stateful Module¶
-
class
lwr.managers.stateful.ActiveJobs(manager)[source]¶ Bases:
objectKeeps track of active jobs (those that are not yet “complete”). Current implementation is file based, but could easily be made database-based instead.
TODO: Keep active jobs in memory after initial load so don’t need to repeatedly hit disk to recover this information.
-
class
lwr.managers.stateful.ManagerMonitor(stateful_manager)[source]¶ Bases:
objectMonitors active jobs of a StatefulManagerProxy.
lwr.managers.status Module¶
lwr.managers.util Module¶
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 LWR.
lwr.managers.staging Module¶
This module contains the code that allows the LWR to stage file’s during preprocessing (currently this means downloading or copying files) and then unstage or send results back to client during postprocessing.
-
class
lwr.managers.ManagerInterface[source]¶ Bases:
objectDefines the interface to various job managers.
-
clean(job_id)[source]¶ Delete job directory and clean up resources associated with job with id job_id.
-
get_status(job_id)[source]¶ Return status of job as string, currently supported statuses include ‘cancelled’, ‘running’, ‘queued’, and ‘complete’.
-
job_directory(job_id)[source]¶ Return a JobDirectory abstraction describing the state of the job working directory.
-
launch(job_id, command_line, submit_params={}, dependencies_description=None, env=[])[source]¶ Called to indicate that the client is ready for this job with specified job id and command line to be executed (i.e. run or queue this job depending on implementation).
-
return_code(job_id)[source]¶ Return integer indicating return code of specified execution or LWR_UNKNOWN_RETURN_CODE.
-
setup_job(input_job_id, tool_id, tool_version)[source]¶ Setup a job directory for specified input (galaxy) job id, tool id, and tool version.
-
lwr.daemon Module¶
-
class
lwr.daemon.LwrConfigBuilder(args=None, **kwds)[source]¶ Bases:
objectGenerate paste-like configuration from supplied command-line arguments.
-
class
lwr.daemon.LwrManagerConfigBuilder(args=None, **kwds)[source]¶ Bases:
lwr.daemon.LwrConfigBuilder
lwr.scripts Module¶
This module contains entry points into various LWR scripts. Corresponding
shell scripts that setup the deployment specific environments and then
delegate to these Python scripts can be found in LWR_ROOT/scripts.
lwr.scripts.drmaa_kill Module¶
lwr.scripts.drmaa_launch Module¶
lwr.scripts.lwr_submit Module¶
lwr.scripts.mesos_executor Module¶
lwr.scripts.mesos_framework Module¶
lwr.web Module¶
The code explicitly related to the LWR web server can be found in this module and its submodules.
lwr.web.framework Module¶
Tiny framework used to power LWR application, nothing in here is specific to running or staging jobs. Mostly deals with routing web traffic and parsing parameters.
-
class
lwr.web.framework.Controller(response_type='OK')[source]¶ Bases:
objectWraps python functions into controller methods.
lwr.web.routes Module¶
-
class
lwr.web.routes.LwrController(**kwargs)[source]¶ Bases:
lwr.web.framework.Controller
lwr.web.wsgi Module¶
-
class
lwr.web.wsgi.LwrWebApp(lwr_app)[source]¶ Bases:
lwr.web.framework.RoutingAppWeb application for LWR web server.
lwr.messaging Module¶
This module contains the server-side only code for interfacing with
message queues. Code shared between client and server can be found in
submodules of lwr.lwr_client.
lwr.mesos Module¶
This module and submodules contain code for interfacing the Apache Mesos framework.
lwr.mesos.framework Module¶
lwr.app Module¶
Deprecated module for wsgi app factory. LWR servers should transition to
lwr.web.wsgi:app_factory.
lwr.manager_endpoint_util Module¶
Composite actions over managers shared between HTTP endpoint (routes.py) and message queue.
lwr.manager_factory Module¶
lwr.tools Module¶
Tools
lwr.tools.toolbox Module¶
-
class
lwr.tools.toolbox.InputsValidator(command_validator, config_validators)[source]¶ Bases:
object
-
class
lwr.tools.toolbox.SimpleToolConfig(tool_el, tool_path)[source]¶ Bases:
lwr.tools.toolbox.ToolConfigAbstract description of a Galaxy tool loaded from a toolbox with the tool tag not containing a guid, i.e. one not from the toolshed.
-
class
lwr.tools.toolbox.ToolBox(path_string)[source]¶ Bases:
objectAbstraction over a tool config file largely modelled after Galaxy’s shed_tool_conf.xml. Hopefully over time this toolbox schema will be a direct superset of Galaxy’s with extensions to support simple, non-toolshed based tool setups.
-
class
lwr.tools.toolbox.ToolConfig[source]¶ Bases:
objectAbstract description of a Galaxy tool.
-
inputs_validator¶
-
-
class
lwr.tools.toolbox.ToolShedToolConfig(tool_el, tool_path)[source]¶ Bases:
lwr.tools.toolbox.SimpleToolConfigAbstract description of a Galaxy tool loaded from a toolbox with the tool tag, i.e. one from the toolshed.
- <tool file=”../shed_tools/gvk.bx.psu.edu/repos/test/column_maker/f06aa1bf1e8a/column_maker/column_maker.xml” guid=”gvk.bx.psu.edu:9009/repos/test/column_maker/Add_a_column1/1.1.0”>
- <tool_shed>gvk.bx.psu.edu:9009</tool_shed> <repository_name>column_maker</repository_name> <repository_owner>test</repository_owner> <installed_changeset_revision>f06aa1bf1e8a</installed_changeset_revision <id>gvk.bx.psu.edu:9009/repos/test/column_maker/Add_a_column1/1.1.0</id> <version>1.1.0</version>
</tool>
lwr.tools.authorization Module¶
Bases:
object
Bases:
objectAllow any, by default LWR is assumed to be secured using a firewall or private_token.
Bases:
objectWork In Progress: Implement tool based white-listing of what jobs can run and what those jobs can do.