et_engine.tools

Functions

connect(tool_name)

Searches for a tool with the specified name and returns a Tool object if found.

create(name, description)

Creates a new Tool

Classes

ArgParser([name])

Tool-side argument parser

Argument(name[, type, description, ...])

Tool-side argument handling

Hardware([filesystems, memory, cpu])

Logger(log_file[, level, append])

Utility for tool-side logging.

Tool(tool_id)

Class for interacting with a Tool

Exceptions

MaxRetriesExceededError

exception et_engine.tools.MaxRetriesExceededError[source]
et_engine.tools.connect(tool_name)[source]

Searches for a tool with the specified name and returns a Tool object if found.

Parameters:

name (string) – Name of the tool to connect to

et_engine.tools.create(name, description)[source]

Creates a new Tool

Parameters:
  • name (string) – Name of the tool

  • description (string) – Plain text description of the tool

Returns:

A Tool object connected to the newly-created tool

Return type:

Tool

class et_engine.tools.Tool(tool_id)[source]

Class for interacting with a Tool

id

unique ID of the tool

url

API endpoint for this tool

Type:

string

__init__(tool_id) None[source]

Creates a new tool object from an existing tool ID

Parameters:
  • tool_id (string) – id associated with the tool of interest

  • client (Client) – base authenticated client containing the active session

run_batch(fixed_kwargs={}, variable_kwargs=[], hardware=None)[source]
Parameters:
  • fixed_kwargs (dict) – key-value arguments to be passed into each job in the batch

  • variable_kwargs ([dict]) – variable arguments to be passed into separate jobs in the batch

  • hardware (Hardware) – the compute hardware to run for each job in the batch

Return type:

a jobs.Batch object

status()[source]
push(tar_gz_file, chunk_size=8388608, connections=100, wait=False, sleep_time=60)[source]

Update the tool code

Before pushing the tool, you must build, save, and gzip a docker image on your computer. To do this, run the following commands.

` docker build --tag my_tool /path/to/docker/folder docker save my_tool | gzip > my_tool.tar.gz `

Then, pass the path to /path/to/my_tool.tar.gz to this function. The image will be uploaded, processed, and made available for use.

Parameters:
  • tar_gz_file (string) – Path to the .tar.gz file containing the image

  • chunk_zie (int) – Size of the file chunks to be uploaded in bytes, default = 8192 (8MB) (optional)

class et_engine.tools.Hardware(filesystems=[], memory=512, cpu=1)[source]
__init__(filesystems=[], memory=512, cpu=1)[source]

Creates a hardware configuration object

to_dict()[source]
to_json()[source]

Converts the class instance to a json string that can be passed to The Engine

class et_engine.tools.Logger(log_file, level='info', append=True)[source]

Utility for tool-side logging. The determination of whether to log, where to log, and what logging level to use must be made within the tool.

__init__(log_file, level='info', append=True)[source]
Parameters:
  • log_file (str) – File name for logging. (If a file name with path is provided, remember that this is on whatever virtual file system may be set up and mounted with the docker container running the tool. Also, note that certain tools are already set up to write these log files to specific places in the virtual file system.)

  • level (str, optional) – Specified logging level. May be ‘debug’, ‘info’, ‘warning’, ‘error’, or ‘critical’. Default ‘info’. If level is not specified as one of these, then defaults to ‘info’.

  • append (boolean, optional) – Controls behavior if log_file already exists. If True (default), appends logging information to existing file. If False, overwrites existing file.

info(*args, **kwargs)[source]
debug(*args, **kwargs)[source]
class et_engine.tools.Argument(name, type=<class 'str'>, description='', required=False, default=None)[source]

Tool-side argument handling

__init__(name, type=<class 'str'>, description='', required=False, default=None)[source]
property value
class et_engine.tools.ArgParser(name='')[source]

Tool-side argument parser

__init__(name='')[source]
add_argument(name, type=<class 'str'>, description='', required=False, default=None)[source]