Skip to main content

Trailblazer is a tool to manage and track state of analyses

Project description

Trailblazer Coverage Status

Monitor the progress of analysis workflows submitted to SLURM

Trailblazer is a tool that aims to provide:

  • a Python interface to interact with MIP in an automated fashion
  • a limited command line interface to simplify running MIP using an opinionated setup

Here you can find a simple web UI for Trailblazer that helps you keep track of the status of multiple runs

Todo

  • fetch all job ids from sacct status log and offer to kill all jobs
  • display statistics like which steps most analyses fail at

Roadmap

Trailblazer's scope will be reduced in the next months and will become SLURM+! Meaning it will become a web UI tool that monitors pipelines to help you keep track of the status of multiple analyses.

We have chosen to have a pipeline export the SLURM job ids in the form of a file:

123145
123146
123147
123148

The plan is formulated in issue/39.

Installation

Trailblazer written in Python 3.6+ and is available on the Python Package Index (PyPI).

pip install trailblazer

If you would like to install the latest development version:

git clone https://github.com/Clinical-Genomics/trailblazer
cd trailblazer
pip install --editable .

Files will be blacked automatically with each push to github. If you would like to automatically Black format your commits on your local machine:

pre-commit install

Contributing

Trailblazer is using github flow branching model as described in our development manual.

Documentation

Here's a brief documentation. Trailblazer functionality can be accessed from the command line interface (CLI), the monitoring web interface, the supporting REST API, as well as using the Python API.

Command line interface

Config file

Trailblazer supports a simple config file written in YAML. You can always provide the same option on the command line, however, it's recommended to store some commonly used values in the config.

The following options are supported:

---
database: mysql+pymysql://userName:passWord@domain.com/database
script: /path/to/MIP/mip.pl
mip_config: /path/to/global/MIP_config.yaml

Tip: setup a Bash alias in your ~/.bashrc to always point to your config automatically:

alias trailblazer="trailblazer --config /path/to/trailblazer/config.yaml"

Command: trailblazer init

Setup (or reset) a Trailblazer database. It will simply setup all the tables in the database. You can reset an existing database by using the --reset option.

trailblazer --database "sqlite:///tb.sqlite3" init --reset
Delete existing tables? [analysis, info, job, user] [y/N]: y
Success! New tables: analysis, info, job, user

Command: trailblazer user

This command can be used both to add a new user to the database (and give them access to the web interface) and view information about an existing user.

# add a new user
trailblazer user --name "Paul Anderson" paul.anderson@magnolia.com
New user added: paul.anderson@magnolia.com (2)

# check an existing user
trailblazer user paul.anderson@magnolia.com
{'created_at': datetime.datetime(2017, 6, 22, 8, 49, 44, 685977), 'google_id': None, 'name': 'Paul Anderson', 'email': 'paul.anderson@magnolia.com', 'avatar': None, 'id': 2}

Command: trailblazer log

Logs the status of a run to the supporting database. You need to point to the analysis config of a specific run.

trailblazer log path/to/family/analysis/family_config.yaml

You can point to the same analysis multiple times, Trailblazer will detect if the same analysis has been added before and skip it if no information has been updated. If an analysis has been added previously as "running" or "pending", those entries will automatically be removed as soon as the same analysis is logged as either "completed" or "failed".

Trailblazer will automatically find additional files used for logging the analysis status (family_qc_sample_info.yaml (sampleinfo) and mip.pl_2017-06-17T12:11:42.log.status (sacct)) unless you explicitly point to them using the --sampleinfo and --sacct flags. If either of the files are missing, Trailblazer will simply skip adding a status for that analysis.

Command: trailblazer scan

Convenience command to scan an entire directory structure for all analyses and update their status in one go. Assumes the base directory consists of individual family folders:

trailblazer scan /path/to/analyses/dir/

This command can easily be setup in a crontab to run e.g. every hour and keep the analysis statuses up-to-date!

Command: trailblazer ls

Prints the family id for the most recently completed analyses to the console. This is useful to tie in downstream tools that might want to do something with the data from completed runs.

trailblazer ls
F0013487
F0013362
F0006106
17083
F0013469
17085

Command: trailblazer delete

Deletes an analysis log from the database. The input is the unique analysis id which is printed ones the analysis is initially logged. It's also displayed in the web interface.

trailblazer delete 4

Command: trailblazer start

Start MIP from Trailblazer. It's only a thin wrapper around the MIP command line. It removes some complexity like having to provide the global MIP config if it is already defined in the Trailblazer config. It also logs a started analysis as "pending" until the first job has been completed and the status can be evaluated (creates the sacct status file).

trailblazer start family4 --priority high

Project details


Release history Release notifications | RSS feed

Download files

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

Source Distribution

trailblazer-10.1.2.tar.gz (23.9 kB view details)

Uploaded Source

Built Distribution

trailblazer-10.1.2-py2.py3-none-any.whl (18.3 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file trailblazer-10.1.2.tar.gz.

File metadata

  • Download URL: trailblazer-10.1.2.tar.gz
  • Upload date:
  • Size: 23.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.10.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.4

File hashes

Hashes for trailblazer-10.1.2.tar.gz
Algorithm Hash digest
SHA256 d80f6e1998ccfca4927c71d720db1eabb655abfa05f41e608d4f90df6c3a0fc2
MD5 632a6a6868e42bf08036871ed5569f1a
BLAKE2b-256 4ae95a7b4e68422e04ed29fb4f05e79174306f04bec5646d35b1ec15295eba7d

See more details on using hashes here.

File details

Details for the file trailblazer-10.1.2-py2.py3-none-any.whl.

File metadata

  • Download URL: trailblazer-10.1.2-py2.py3-none-any.whl
  • Upload date:
  • Size: 18.3 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.10.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.4

File hashes

Hashes for trailblazer-10.1.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 b6ddf920af9f15f61c68e6cc96ffd98a016d3b5fa8afd1ba8f1254b614556f71
MD5 872dba2d99ae614b5d1cebf11f6eaf56
BLAKE2b-256 d9638136933bf64ec3465aafa3aa093bd86f2c9e65837bdb0bb7bd10e37318bb

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page