![jobman](https://github.com/ryancswallace/jobman/raw/main/assets/logo.png?raw=true)
Jobman automates the process of running and monitoring jobs on the command line. Jobman supports
* running commands in the background immune to hangups
* logging command output
* retrying commands
* aborting commands after timeout
* delaying command execution for a specified time or event
* sending notifications on command success or failure
![Build Status](https://github.com/ryancswallace/jobman/actions/workflows/test.yml/badge.svg)
[![codecov](https://codecov.io/gh/ryancswallace/jobman/branch/main/graph/badge.svg)](https://codecov.io/gh/ryancswallace/jobman)
[![Docs site](https://img.shields.io/badge/docs-GitHub_Pages-blue)](https://ryancswallace.github.io/jobman/)
# Documentation
**Visit the :book: [jobman documentation site](https://ryancswallace.github.io/jobman/) :book: for complete information on using jobman.**
# Requirements
Jobman runs on UNIX-like operating systems including Linux and MacOS. Windows is not supported.
Jobman requires Python3.9+.
# Installation
Install or upgrade from PyPI with
```
$ pip install jobman
```
# Example
The example below uses jobman to run a Python script `train.py` in the background and immune to hangups (e.g., a SIGHUP from an SHH timeout).
Jobman will ensure 60 seconds have passed *and* that the file `data.csv` exists before starting the program. If those conditions haven't been met by 5:00PM on March 5, 2032, jobman will abort the job.
Jobman will retry the program up to five times until there's one successful run, defined as an exit code of `0` or `42`, waiting ten seconds between retries.
If the job succeeds, jobman will send a notification email. If the job fails, jobman will send an SMS message.
```bash
$ jobman \
--wait-duration 60s --wait-for-file data.csv \
--abort-time "2032-03-05T17:00:00" \
--retry-attempts 5 --retry-delay 10s -c 0 -c 42 \
--notify-on-job-success my-email --notify-on-job-failure my-cell \
train.py
12e4b604
```
After submitting the `train.py` job above, use `jobman show` to display details on job progress:
```bash
jobman show 12e4b604
```
To view a running log of the consolidated stdout and stderr streams of the latest run of the job, use `jobman logs`:
```bash
jobman logs 12e4b604 --follow
```
# Alternatives
Jobman aims to be reliable and fully-featured. It operates *without* requiring a system service/daemon for orchestration.
Alternative tools for similar use cases include:
* **cron**: for scheduling repeated executions of a job
* **Airflow**, **Prefect**, and **Dagster**: for managing dependencies between multiple jobs
* **supervisord**: for daemon-based job management
# Developing
Jobman uses pyenv for Python version management and poetry for builds. Before working on Jobman, ensure you have `pyenv` and `poetry` installed.
The `Makefile` defines targets for common operations during development, including the following:
* `make setup`: set up and install the package
* `make fmt`: run the autoformatters
* `make test`: run the type tests and unit test suite
* `make build`: build the jobman wheel
To release a new version of the package, use the `bumpver.sh` script. For example, to update to version 1.2.3, run `./bumpver.sh 1.2.3`.
# Contributing
Feature requests, bug reports, and pull requests are welcome! See [CONTRIBUTING.md](https://github.com/ryancswallace/jobman/blob/main/CONTRIBUTING.md) for details on how to contribute to jobman.
Raw data
{
"_id": null,
"home_page": "https://ryancswallace.github.io/jobman",
"name": "jobman",
"maintainer": "Ryan Wallace",
"docs_url": null,
"requires_python": ">=3.9,<4.0",
"maintainer_email": "ryancswallace@gmail.com",
"keywords": "python,cli,command-line,background-jobs,supervisor,retry,cli-app,command-line-tool,nohup",
"author": "Ryan Wallace",
"author_email": "ryancswallace@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/ed/df/af9f82bbb6f8e4f672de0e82269f91fb607cbacedfe8aa2f05b2a73c2778/jobman-0.4.0.tar.gz",
"platform": null,
"description": "![jobman](https://github.com/ryancswallace/jobman/raw/main/assets/logo.png?raw=true)\n\nJobman automates the process of running and monitoring jobs on the command line. Jobman supports\n* running commands in the background immune to hangups\n* logging command output\n* retrying commands\n* aborting commands after timeout\n* delaying command execution for a specified time or event\n* sending notifications on command success or failure\n\n![Build Status](https://github.com/ryancswallace/jobman/actions/workflows/test.yml/badge.svg)\n[![codecov](https://codecov.io/gh/ryancswallace/jobman/branch/main/graph/badge.svg)](https://codecov.io/gh/ryancswallace/jobman)\n[![Docs site](https://img.shields.io/badge/docs-GitHub_Pages-blue)](https://ryancswallace.github.io/jobman/)\n\n# Documentation\n**Visit the :book: [jobman documentation site](https://ryancswallace.github.io/jobman/) :book: for complete information on using jobman.**\n\n# Requirements\nJobman runs on UNIX-like operating systems including Linux and MacOS. Windows is not supported.\n\nJobman requires Python3.9+.\n# Installation\nInstall or upgrade from PyPI with\n```\n$ pip install jobman\n```\n\n# Example\nThe example below uses jobman to run a Python script `train.py` in the background and immune to hangups (e.g., a SIGHUP from an SHH timeout).\n\nJobman will ensure 60 seconds have passed *and* that the file `data.csv` exists before starting the program. If those conditions haven't been met by 5:00PM on March 5, 2032, jobman will abort the job.\n\nJobman will retry the program up to five times until there's one successful run, defined as an exit code of `0` or `42`, waiting ten seconds between retries.\n\nIf the job succeeds, jobman will send a notification email. If the job fails, jobman will send an SMS message.\n```bash\n$ jobman \\\n --wait-duration 60s --wait-for-file data.csv \\\n --abort-time \"2032-03-05T17:00:00\" \\\n --retry-attempts 5 --retry-delay 10s -c 0 -c 42 \\\n --notify-on-job-success my-email --notify-on-job-failure my-cell \\\n train.py\n12e4b604\n```\n\nAfter submitting the `train.py` job above, use `jobman show` to display details on job progress:\n```bash\njobman show 12e4b604\n```\n\nTo view a running log of the consolidated stdout and stderr streams of the latest run of the job, use `jobman logs`:\n```bash\njobman logs 12e4b604 --follow\n```\n\n# Alternatives\nJobman aims to be reliable and fully-featured. It operates *without* requiring a system service/daemon for orchestration.\n\nAlternative tools for similar use cases include:\n* **cron**: for scheduling repeated executions of a job\n* **Airflow**, **Prefect**, and **Dagster**: for managing dependencies between multiple jobs\n* **supervisord**: for daemon-based job management\n\n# Developing\nJobman uses pyenv for Python version management and poetry for builds. Before working on Jobman, ensure you have `pyenv` and `poetry` installed.\n\nThe `Makefile` defines targets for common operations during development, including the following:\n* `make setup`: set up and install the package\n* `make fmt`: run the autoformatters\n* `make test`: run the type tests and unit test suite\n* `make build`: build the jobman wheel\n\nTo release a new version of the package, use the `bumpver.sh` script. For example, to update to version 1.2.3, run `./bumpver.sh 1.2.3`.\n\n# Contributing\nFeature requests, bug reports, and pull requests are welcome! See [CONTRIBUTING.md](https://github.com/ryancswallace/jobman/blob/main/CONTRIBUTING.md) for details on how to contribute to jobman.",
"bugtrack_url": null,
"license": "MIT",
"summary": "A command line job manager with flexible support for retries, timeouts, logging, notifications, and more",
"version": "0.4.0",
"project_urls": {
"Bug Tracker": "https://github.com/ryancswallace/jobman/issues",
"Documentation": "https://ryancswallace.github.io/jobman",
"Homepage": "https://ryancswallace.github.io/jobman",
"Repository": "https://github.com/ryancswallace/jobman"
},
"split_keywords": [
"python",
"cli",
"command-line",
"background-jobs",
"supervisor",
"retry",
"cli-app",
"command-line-tool",
"nohup"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "6a609ec4e529cff0f2f17e0cc69730d26e18a93b965a2a163b31f4fdc8817212",
"md5": "ebca5418cdb5bfcab129628ef3871bc4",
"sha256": "049072f3bccd3417211892a9d9de9d3c686a94ef0b9cad3b8d86f89b73a99026"
},
"downloads": -1,
"filename": "jobman-0.4.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "ebca5418cdb5bfcab129628ef3871bc4",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9,<4.0",
"size": 11643,
"upload_time": "2023-09-08T01:31:08",
"upload_time_iso_8601": "2023-09-08T01:31:08.639516Z",
"url": "https://files.pythonhosted.org/packages/6a/60/9ec4e529cff0f2f17e0cc69730d26e18a93b965a2a163b31f4fdc8817212/jobman-0.4.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "eddfaf9f82bbb6f8e4f672de0e82269f91fb607cbacedfe8aa2f05b2a73c2778",
"md5": "d9c003e93ea5151c9b7db5026e00eae2",
"sha256": "2cd4e0cda2cd43426a8eb75ba03736bb2cec2508148df9a683a0b4389b166b7b"
},
"downloads": -1,
"filename": "jobman-0.4.0.tar.gz",
"has_sig": false,
"md5_digest": "d9c003e93ea5151c9b7db5026e00eae2",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9,<4.0",
"size": 10402,
"upload_time": "2023-09-08T01:31:09",
"upload_time_iso_8601": "2023-09-08T01:31:09.920794Z",
"url": "https://files.pythonhosted.org/packages/ed/df/af9f82bbb6f8e4f672de0e82269f91fb607cbacedfe8aa2f05b2a73c2778/jobman-0.4.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-09-08 01:31:09",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "ryancswallace",
"github_project": "jobman",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "jobman"
}