tunel.launcher package

Subpackages

Submodules

tunel.launcher.base module

class tunel.launcher.base.ContainerLauncher(server, **kwargs)[source]

Bases: Launcher

A container launcher has shared functions for launching a head node container.

run_app(app)[source]

A Singularity app means running a container directly with some arguments, etc.

class tunel.launcher.base.Launcher(server, **kwargs)[source]

Bases: object

A launcher is a base for executing commands.

property assets
property assets_dir
property environ

Get envars

get_modules(needed_modules)[source]

Given a list of needed modules, return for an app to load

property home

Get (or create) a local home

property path

Get additions to the path

prepare_render(app, paths)[source]

Given an app, prepare default variables (and custom args) to render

property remote_assets_dir
property remote_home

Get (or create) a remote home

property remote_sockets

Get a remote sockets directory

property remote_work

Get a remote work (must exist)

run(*args, **kwargs)[source]
run_app(*args, **kwargs)[source]
scp_and_run(script)[source]

Given a local script, copy to cluster, run, and return the result

scp_get(src, dest)[source]

Copy an asset FROM the server to local assets

property slug
stop(*args, **kwargs)[source]
stop_app(*args, **kwargs)[source]
property username

Get the username

write_temporary_script(content)[source]

Write a temporary script to file

tunel.launcher.singularity module

class tunel.launcher.singularity.Singularity(server, **kwargs)[source]

Bases: ContainerLauncher

name = 'singularity'
run(*args, **kwargs)[source]

Run handles some command to singularity (e.g., run or exec)

tunel.launcher.singularity.post_commands(ssh, app, socket)[source]

tunel.launcher.slurm module

class tunel.launcher.slurm.Slurm(server, **kwargs)[source]

Bases: Launcher

A slurm launcher interacts with slurm

get_machine(name, max_attempts=None)[source]

Given the name of a job, wait for the job to start and return the machine

property modules_file
property nodes_file
previous_job_exists(name)[source]

Check to see if a previous job was submit/exists.

print_session_instructions(job_name)[source]

Print extra sessions with forward instructions.

print_updated_logs(logs_prefix, app, socket)[source]

Start a separate thread that regularly checks and prints logs (when there is an updated line)

run(cmd, job_name=None, logs_prefix=None, app=None, socket=None)[source]

Run a command for slurm, typically sbatch (and eventually with supporting args)

run_app(app)[source]

Given an app designated for slurm, run it!

show_logs_instruction(logs_prefix)[source]

print to the screen how to see currently running logs

stop(names)[source]

Stop one or more named jobs

stop_app(app)[source]

Wrapper to stop a single app.

update_inventory()[source]
tunel.launcher.slurm.post_commands(ssh, app, logs_prefix, socket)[source]

Post commands to show logs and any commands->post defined by the app

Module contents

tunel.launcher.get_launcher(app, launcher=None)[source]

Get a launcher for a loaded app