Skip to main content

Troika

Submit, monitor and kill jobs on local and remote hosts

Requirements

Installing

python3 -m venv troika
source troika/bin/activate
python3 -m pip install troika

Running the tests

Once Troika is installed in your environment, the tests can be run using pytest:

python3 -m pytest -v tests/

Building documentation

The documentation uses sphinx. To generate the HTML docs:

cd docs/
make html

Presentation

Slides and recording of the "Troika: Submit, monitor, and interrupt jobs on any HPC system with the same interface" talk at FOSDEM'23 are available via https://fosdem.org/2023/schedule/event/troika_hpc_jobs .

Getting started

Concepts

Troika holds a list of sites onto which jobs can be submitted. A site is defined by two main parameters: a connection type (local or ssh), and a site type (e.g. direct or slurm). Every site is identified by a name given in the configuration file.

Example configuration file

---
sites:
    localhost:
        type: direct         # jobs are run directly on the target
        connection: local    # the target is the current host
    remote:
        type: direct         # jobs are run directly on the target
        connection: ssh      # connect to the target via ssh
        host: remotebox      # ssh host
        copy_script: true    # if false, the script will be piped through ssh
        at_startup: ["check_connection"]
    slurm_cluster:
        type: slurm          # jobs are submitted to Slurm
        connection: ssh      # connect to the target via ssh
        host: remotecluster  # ssh host
        copy_script: true    # if false, the script will be piped through ssh
        at_startup: ["check_connection"]
        pre_submit: ["create_output_dir"]
        at_exit: ["copy_submit_logfile"]
    pbs_cluster:
        type: pbs            # jobs are submitted to PBS
        connection: ssh      # connect to the target via ssh
        host: othercluster   # ssh host
        copy_script: true    # if false, the script will be piped through ssh
        at_startup: ["check_connection"]
        pre_submit: ["create_output_dir"]
        at_exit: ["copy_submit_logfile"]

The configuration can be checked using the list-sites command:

$ troika -c config.yml list-sites
Available sites:
Name                         Type            Connection
------------------------------------------------------------
localhost                    direct          local
remote                       direct          ssh
slurm_cluster                slurm           ssh
pbs_cluster                  pbs             ssh

Available options

$ troika --help

Main commands

Submit a job on cluster:

$ troika -c config.yaml submit -o /path/to/output/file cluster job.sh

Query the status of the job:

$ troika -c config.yaml monitor cluster job.sh

Kill the job:

$ troika -c config.yaml kill cluster job.sh

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

troika-0.2.7.tar.gz (33.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

troika-0.2.7-py3-none-any.whl (47.5 kB view details)

Uploaded Python 3

File details

Details for the file troika-0.2.7.tar.gz.

File metadata

  • Download URL: troika-0.2.7.tar.gz
  • Upload date:
  • Size: 33.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.14.7

File hashes

Hashes for troika-0.2.7.tar.gz
Algorithm Hash digest
SHA256 ef85090bc8b9c8355d4a7bbee6232c1d0ac4bde02d67ad22d41c08cd08e44c31
MD5 383a48da920ee4db5bd59686e358a6a5
BLAKE2b-256 0a58a53c0a251b46e794c56378f7c607596ef06f5d33d090ba5aeb8303a23d63

See more details on using hashes here.

File details

Details for the file troika-0.2.7-py3-none-any.whl.

File metadata

  • Download URL: troika-0.2.7-py3-none-any.whl
  • Upload date:
  • Size: 47.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.14.7

File hashes

Hashes for troika-0.2.7-py3-none-any.whl
Algorithm Hash digest
SHA256 1587dc77425fd0797f44c2a20e1490b14a64f66749590c239b39356fb1e64ce7
MD5 3a7c1242585bbb86f463a5bdcba6e344
BLAKE2b-256 c3cfbe365e9fa4a45357e6f6594b2a13d3db99180e9f4123f459c1b06c76eefa

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.2.7 This release

2 files

0.2.6

2 files

0.2.5

2 files

0.2.4

2 files

0.2.3

2 files

0.2.2

2 files

0.2.1

2 files

0.2.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page