Skip to main content

(Python) Process Manager

Project description

https://badge.fury.io/py/pman.svg https://travis-ci.org/FNNDSC/pman.svg?branch=master https://img.shields.io/badge/python-3.5%2B-blue.svg

1. Overview

‘pman’ is a process management system that launches and tracks the status of jobs. In the most general sense, jobs are simply applications run on an underlying system shell.

2. Installation

apt install python-zmq python-webob
pip install pman
# optional
pip install httpie

3. Usage

Scripts

# start 'pman', listening on port 5010 of the current host
pman --raw 1 --http  --port 5010 --listeners 12

Modules

# in yourscript.py
import pman

pman.pman(
  debugFile = '/tmp/debug.file'
  )

4. More

pman.py --raw 1 --http  --port 5010 --listeners 12

Now, assuming the IP of the host as below, a job can be submitted to ‘pman’ using a REST type interface

http POST http://10.17.24.163:5010/api/v1/cmd/ \
Content-Type:application/json Accept:application/json \
payload:='
  {
  "exec": {"cmd": "cal 7 1970"},
  "action":"run",
  "meta": {
      "jid": "123-456-1",
      "auid": "rudolphpienaar"
    }
  }'

‘pman’ will then spawn the process and provide information on the status of the job. Note the <tt>payload</tt> JSON dictionary that provides some additional behaviour options (see later).

Jobs launched by ‘pman.py’ can be queried with

http GET http://10.17.24.163:5010/api/v1/_01/endInfo \
  Content-Type:application/json Accept:application/json

for the pid and status of job “1”, for example

Project details


Release history Release notifications | RSS feed

This version

0.6

Download files

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

Source Distribution

pman-0.6.tar.gz (59.4 kB view details)

Uploaded Source

File details

Details for the file pman-0.6.tar.gz.

File metadata

  • Download URL: pman-0.6.tar.gz
  • Upload date:
  • Size: 59.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pman-0.6.tar.gz
Algorithm Hash digest
SHA256 98bc2869f242824fd5b06a3f3b16f2d05daa83878ee05674d8b6775ab2c29808
MD5 33a394686c60ce4452a0d7c281cdc574
BLAKE2b-256 4ace04e8d9016a8e266a264943c5673f61c77c9faf99668c9c0405105fa0742f

See more details on using hashes here.

Supported by

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