Command line utilities for interacting with Airbnb Chronos
Python
Latest commit 7d8214e Jan 27, 2014 @ssorallen ssorallen Use timestamp to guarantee unique IDs in create forest
The create forest command is generated with `"DEPENDENTJOB%i" % i` where
`i` is the value of the iterator. If the command is fun multiple times,
it uses the same names over and over. `--create` appends
`datetime.datetime.utcnow()`, which has resolution to 1/100,000th of a
second and is granular enough to produce unique values between
iterations in the loop.

This fixes --createforest to produce unique job names.
Permalink
Failed to load latest commit information.
lib Adds a random-forest option to generate dependent jobs. Also creates … Jan 21, 2014
.gitignore Ignore all "compiled" Python files Nov 20, 2013
LICENSE Fill company and year in license Nov 22, 2013
README.md
chronos-jobs.py Use timestamp to guarantee unique IDs in create forest Jan 27, 2014
chronos-version.py Add a version command and mark version 0.0.1 Jan 3, 2014
chronos.py Add a version command and mark version 0.0.1 Jan 3, 2014

README.md

chronos-utils

Command line utilities for interacting with Airbnb Chronos. Check out the full reference below for all available commands.

First, a demonstration

This demonstrates creating jobs, deleting a single job, deleting all the jobs, and listing jobs from the command line.

$ ./chronos.py jobs --create 3
Created 3 job(s) on local Chronos

$ ./chronos.py jobs --list
+------------------+--------------+------------------------------------+
|       Name       |    Owner     |              Schedule              |
+==================+==============+====================================+
| JOB1386714810695 | rob@fake.com | R/2013-12-10T22:33:30.695273/PT24H |
+------------------+--------------+------------------------------------+
| JOB1386714810719 | rob@fake.com | R/2013-12-10T22:33:30.719465/PT24H |
+------------------+--------------+------------------------------------+
| JOB1386714810737 | rob@fake.com | R/2013-12-10T22:33:30.737307/PT24H |
+------------------+--------------+------------------------------------+

Showing all 3 job(s)

$ ./chronos.py jobs --delete JOB1386714810719
Deleted job named 'JOB1386714810719'.

$ ./chronos.py jobs --list
+------------------+--------------+------------------------------------+
|       Name       |    Owner     |              Schedule              |
+==================+==============+====================================+
| JOB1386714810695 | rob@fake.com | R/2013-12-10T22:33:30.695273/PT24H |
+------------------+--------------+------------------------------------+
| JOB1386714810737 | rob@fake.com | R/2013-12-10T22:33:30.737307/PT24H |
+------------------+--------------+------------------------------------+

Showing all 2 job(s)

$ ./chronos.py jobs --deleteall
Are you sure you want to delete ALL jobs? [yes/No] yes
Deleted ALL jobs. The slate is all clean.

$ ./chronos.py jobs --list
+------+-------+----------+
| Name | Owner | Schedule |
+======+=======+==========+
+------+-------+----------+

No jobs

Full Reference

chronos

Forward commands to other files in the directory. New commands should be added to the command description in this file.

./chronos.py -h
usage: chronos [-h] <command>

Supported chronos commands are:
  jobs      Create, destroy, and list jobs
  version   Print the chronos utils version

positional arguments:
  <command>   this is it, the command to execute

optional arguments:
  -h, --help  show this help message and exit

chronos-jobs

Create, destroy, and list jobs

./chronos.py jobs -h
usage: chronos-jobs [-h] [--hostname <host:port>] [-v]
                    (--create [<n>] | --createforest [<n>] | --delete <jobname> | --deleteall | --list | --run <jobname> | --runall)

optional arguments:
  -h, --help            show this help message and exit
  --hostname <host:port>
                        hostname and port of the Chronos instance (default:
                        localhost:8080)
  -v                    print verbose output
  --create [<n>]        create <n> sleep jobs (default: 1)
  --createforest [<n>]  create <n> sleep jobs, with random dependencies
                        (default: 1)
  --delete <jobname>    delete job with name <jobname>
  --deleteall           delete all jobs (this is serious business)
  --list                list all jobs
  --run <jobname>       run job with name <jobname>
  --runall              run all jobs (could be a lot of work)