toil.provisioners.node¶
Attributes¶
Classes¶
Module Contents¶
- 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 = 420¶
- publicIP¶
- privateIP¶
- name¶
- nodeType¶
- preemptible¶
- tags = None¶
- remainingBillingInterval()[source]¶
Returns a floating point value between 0 and 1.0 representing how much time is left in the current billing cycle for the given instance. If the return value is .25, we are three quarters into the billing cycle, with one quarters remaining before we will be charged again for that instance.
Assumes a billing cycle of one hour.
- Returns:
Float from 1.0 -> 0.0 representing fraction of pre-paid time remaining in cycle.
- Return type:
>>> node = Node("127.0.0.1", "127.0.0.1", "localhost", ... datetime.datetime.utcnow(), None, False) >>> node.remainingBillingInterval() >= 0 True >>> node.remainingBillingInterval() <= 1.0 True >>> node.remainingBillingInterval() > 0.5 True >>> interval1 = node.remainingBillingInterval() >>> time.sleep(1) >>> interval2 = node.remainingBillingInterval() >>> interval2 < interval1 True
>>> node = Node("127.0.0.1", "127.0.0.1", "localhost", ... datetime.datetime.now(datetime.timezone.utc) - ... datetime.timedelta(minutes=5), None, False) >>> node.remainingBillingInterval() < 0.99 True >>> node.remainingBillingInterval() > 0.9 True
- 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