moldesign.compute package


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]
status = 'finished'
stderr = ''
stdout = ''

Returns a fully qualified tag that points to the correct registry

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


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

Helper for running jobs.

  • 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

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': '', 'default_ccc_host': '', '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': '', 'default_ccc_host': '', 'default_python_image': '', '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.


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:

  • 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: ‘’
  • default_python_image (str) – Image to run python commands in (default:[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:

For instance, the ambertools 0.6 image is stored in the default repository at:

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

moldesign.compute.configuration.registry_login(client, login)[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.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


alias of RunsRemotely