Terminal

class runner.runners.terminal.TerminalRunner(name, database='database.db', interpreter='#!/bin/bash', pre_runner_data=None, max_jobs=50, cycle_time=30, keep_run=False, run_folder='./', multi_fail=0, logfile=None)[source]

Bases: BaseRunner

Terminal Runner

Parameters:
  • name (str) – The name of the runner. It is saved as terminal:<given_name>. Used to identify from other runners attached to the database.

  • database (str) – ASE database to connect

  • interpreter (str) – the interpreter for the shell

  • pre_runner_data (RunnerData) – pre-run runnerdata Files, tasks, and scheduler_options can be added to be added to all the runs handled by this runner.

  • max_jobs (int) – maximum number of jobs running at an instance

  • cycle_time (int) – time in seconds

  • keep_run (bool) – keep the folder in which the run was performed

  • run_folder (str) – the folder that needs to be populated

  • multi_fail (int) – The number of re-runs on failure

  • logfile (str) – The log filename for logging

Similarily a terminal runner can be setup:

>>> from runner import TerminalRunner
>>> runner_ = TerminalRunner('myRunner',
...                          'myDatabase.db',
...                          tasks=[['shell', 'module load anaconda3']],
...                          max_jobs=5,
...                          cycle_time=30,
...                          keep_run=False,
...                          run_folder='./')

This runner can start spooling via:

>>> runner_.spool()

or the runner can be attached to the database:

>>> runner_.to_database()

to be run from the respective machine:

>>> runner_ = TerminalRunner.from_database('terminal:myRunner',
...                                        'myDatabase.db')
>>> runner_.spool()

or can be run via Command Line Interface (CLI) tools:

$ runner start terminal:myRunner -db database.db
...

Note

Terminal tasks are run as a child process of the TerminalRunner itself, and hence, are killed when TerminalRunner is stopped. This is an unwanted behaviour, and will be rectified in the future release.

Terminal scheduler options in RunnerData

Scheduler options are not yet implemented in TermianlRunner