toil.provisioners.node

Attributes

a_short_time

logger

Classes

Node

Functions

parse_iso_utc(s)

Parses an ISO time with a hard-coded Z for zulu-time (UTC) at the end. Other timezones are

Module Contents

toil.provisioners.node.parse_iso_utc(s)[source]

Parses an ISO time with a hard-coded Z for zulu-time (UTC) at the end. Other timezones are not supported. Returns a timezone-naive datetime object.

Parameters:

s (str) – The ISO-formatted time

Returns:

A timezone-naive datetime object

Return type:

datetime.datetime

>>> parse_iso_utc('2016-04-27T00:28:04.000Z')
datetime.datetime(2016, 4, 27, 0, 28, 4)
>>> parse_iso_utc('2016-04-27T00:28:04Z')
datetime.datetime(2016, 4, 27, 0, 28, 4)
>>> parse_iso_utc('2016-04-27T00:28:04X')
Traceback (most recent call last):
...
ValueError: Not a valid ISO datetime in UTC: 2016-04-27T00:28:04X
toil.provisioners.node.a_short_time = 5
toil.provisioners.node.logger
class toil.provisioners.node.Node(publicIP, privateIP, name, launchTime, nodeType, preemptible, tags=None, use_private_ip=None)[source]
Parameters:
maxWaitTime
__str__()[source]

Return str(self).

__repr__()[source]

Return repr(self).

__hash__()[source]

Return hash(self).

remainingBillingInterval()[source]

If the node has a launch time, this function returns a floating point value between 0 and 1.0 representing how far we are into the current billing cycle for the given instance. If the return value is .25, we are one quarter into the billing cycle, with three quarters remaining before we will be charged again for that instance.

Assumes a billing cycle of one hour.

Returns:

Float from 0 -> 1.0 representing percentage of pre-paid time left in cycle.

Return type:

float

waitForNode(role, keyName='core')[source]
Parameters:
Return type:

None

copySshKeys(keyName)[source]

Copy authorized_keys file to the core user from the keyName user.

injectFile(fromFile, toFile, role)[source]

rysnc a file to the container with the given role

extractFile(fromFile, toFile, role)[source]

rysnc a file from the container with the given role

sshAppliance(*args, **kwargs)[source]
Parameters:
  • args – arguments to execute in the appliance

  • kwargs – tty=bool tells docker whether or not to create a TTY shell for interactive SSHing. The default value is False. Input=string is passed as input to the Popen call.

sshInstance(*args, **kwargs)[source]

Run a command on the instance. Returns the binary output of the command.

coreSSH(*args, **kwargs)[source]

If strict=False, strict host key checking will be temporarily disabled. This is provided as a convenience for internal/automated functions and ought to be set to True whenever feasible, or whenever the user is directly interacting with a resource (e.g. rsync-cluster or ssh-cluster). Assumed to be False by default.

kwargs: input, tty, appliance, collectStdout, sshOptions, strict

Parameters:

input (bytes) – UTF-8 encoded input bytes to send to the command

coreRsync(args, applianceName='toil_leader', **kwargs)[source]
Parameters:
  • args (List[str])

  • applianceName (str)

  • kwargs (Any)

Return type:

int