moldesign.compute package

Submodules

moldesign.compute.compute module

class moldesign.compute.compute.DummyJob(result, updated_object=None)[source]

Bases: object

A job that doesn’t actually need to run. Useful as a return value for processes that return a job object.

static get_output_files(filename=None)[source]
get_stderr_stream()
get_stdout_stream()
kill()
status = 'finished'
stderr = ''
stdout = ''
wait()
moldesign.compute.compute.get_image_path(image_name)[source]

Returns a fully qualified tag that points to the correct registry

Parameters:image_name (str) – name of the image (without tags, repository, etc.)

Examples

>>> config.update({'default_repository':'my.docker.registry/orgname/myrepo:',
                   'default_version_tag':'latest'})
>>> get_image_path('myimage')
'my.docker.registry/orgname/myrepo:myimage-latest'
>>> config.update({'default_repository':'docker.io/myorg',
                   'default_version_tag':'0.2'})
>>> get_image_path('someimage')
'docker.io/myorg/someimage:0.2
moldesign.compute.compute.run_job(job, engine=None, image=None, wait=True, jobname=None, display=True, _return_result=False)[source]

Helper for running jobs.

Parameters:
  • job (pyccc.Job) – The job to run
  • engine (pyccc.Engine) – Engine to run this job on (default: moldesign.compute.get_engine())
  • image (str) – URL for the docker image
  • wait (bool) – if True, block until this function completes and return the function’s return value. Otherwise, return a job object immediately that can be queried later.
  • display (bool) – if True, show logging output for this job
Returns:

pyccc job object OR function’s return value

moldesign.compute.configuration module

moldesign.compute.configuration.DEFAULT_CONFIG_PATH = '/Users/aaronvirshup/.moldesign/moldesign.yml'

str – default search path for moldesign.yml.

moldesign.compute.configuration.DEF_CONFIG = {'default_repository': 'docker.io/autodesk/moldesign:', 'default_ccc_host': 'cloudcomputecannon.bionano.autodesk.com:9000', 'default_python_image': None, 'default_version_tag': '0.7.3', 'default_docker_host': 'unix://var/run/docker.sock', 'engine_type': 'ccc'}

dict – default configuration to be written to moldesign.yml if it doesn’t exist

moldesign.compute.configuration.ENVVAR = 'MOLDESIGN_CONFIG'

str – name of environmental variable that stores path to moldesign.yml file.

If this variable is not set, $HOME/.moldesign/moldesign.yml will be used by default.

moldesign.compute.configuration.config = {'default_repository': 'docker.io/autodesk/moldesign:', 'default_ccc_host': 'cloudcomputecannon.bionano.autodesk.com:9000', 'default_python_image': 'docker.io/autodesk/moldesign:moldesign_complete-0.7.3', 'default_version_tag': '0.7.3', 'default_docker_host': 'unix://var/run/docker.sock', 'default_docker_machine': 'default', 'engine_type': 'docker'}

dict – dictionary of parameters (read from user’s moldesign.yml at startup)

This dictionary configures how MDT interacts with “computational engines” - the systems that run jobs, usually using docker images.

Notes

Values in this dictionary can be configured at runtime; however, after changing them, you should update the compute configuration by running moldesign.compute.reset_compute_engine()

Configuration is specified using the following keys:

Parameters:
  • engine_type (str) – The computational job engine to use. Default: ‘ccc’. Currently supported: ‘docker’, ‘ccc’, or ‘subprocess’
  • default_repository (str) – Repository to pull MDT’s standard images from. default: ‘docker.io/autodesk/moldesign:’
  • default_python_image (str) – Image to run python commands in (default: docker.io/autodesk/moldesign:moldesign_complete-[VERSION], where [VERSION] is the version of MDT)
  • default_version_tag (str) – Default version tag for docker images (default: moldesign.__version__)
  • default_docker_machine (str) – Name of the docker machine to connect to; if engine_type=='docker', EITHER this OR default_docker_url (but not both) must be set. (default: ‘default’)
  • default_docker_url (str) – URL for the docker daemon to run; if engine_type=='docker', EITHER this OR default_docker_machine (but not both) must be set. (default: unix://var/run/docker.sock, the URL for a local docker instance)

MDT uses a non-standard docker tagging system to store its docker images. Generally, a given image is pulled from a URL of the form:

http://[some_docker_registry/orgname/reponame]:[imagename]-[versiontag]
For instance, the ambertools 0.6 image is stored in the default repository at:
http://docker.io/autodesk/moldesign:ambertools-0.6
moldesign.compute.configuration.get_engine()[source]
moldesign.compute.configuration.init_config()[source]

Called at the end of package import to read initial configuration and setup cloud computing.

moldesign.compute.configuration.registry_login(client, login)[source]
moldesign.compute.configuration.reset_compute_engine()[source]

Read the configuration dict at moldesign.compute.config and set up compute engine

Sets the module-level variable default_engine.

Returns:copy of the config dictionary used to set the engine
Return type:dict
moldesign.compute.configuration.write_config(path=None)[source]

moldesign.compute.runsremotely module

class moldesign.compute.runsremotely.RunsRemotely(enable=True, display=True, jobname=None, sendsource=False, engine=None, image=None, is_imethod=False)[source]

Bases: object

moldesign.compute.runsremotely.runsremotely

alias of RunsRemotely