Skip to main content

Hierarchical job execution and logging

Project description

🐊 Gator

Gator is a combination of a task runner and a logging system. Every job is managed by a wrapper layer that monitors its progress, resource usage, and captures the messages that it emits via STDOUT or STDERR. Execution is managed in a hierarchical structure, with jobs at the leaves reporting back to layers of parent processes.

NOTE This project is under development is not feature complete, nor has it been battle tested.

Setting Up

Gator has been developed using poetry for package management:

$> python3 -m pip install poetry
$> poetry install

YAML Specification

Tasks to perform are specified in a custom YAML syntax, arranged into two distinct object types:

  • !Job that describes a single task to perform;
  • !JobGroup that describes a set of tasks to perform, also supporting layers of nested groups;
  • !JobArray similar to a !JobGroup, but repeats the set of described tasks a specified number of times.

A simple specification may look like this:

!JobGroup
  id  : top
  jobs:
  # Nested layer
  - !JobGroup
      id  : inner
      jobs:
      - !Job
          id     : say_hi
          command: echo
          args   : ["hi"]
  # Arrayed job - waits for 'say_hi' to complete
  - !JobArray
      id     : counting
      on_pass:
        - say_hi
      repeats: 4
      jobs   :
      - !Job
          id     : echo_count
          command: echo
          args   : ["$GATOR_ARRAY_INDEX"]
  # Directly attached to root - waits for 'counting' to complete
  - !Job
      id     : say_bye
      on_pass:
        - counting
      command: echo
      args   : ["bye"]

Executing a Job Specification

To run a given job specification, use the Gator CLI:

$> python3 -m gator examples/job.yaml
[17:58:50] Starting Gator 🐊
           [INFO   ] Launching task: echo hey there you
           [INFO   ] Monitoring task
           [INFO   ] hey there you
           [INFO   ] Task completed with return code 0
           [INFO   ] Recorded 0 warnings and 0 errors

Hub

To run the hub:

$> poe hub

TODO

  • Get hub working
  • Pass artefacts between jobs and form artefact based dependencies
  • Arbitrary metrics gathering - replace warning and error counts with a generalised mechanism that supports aggregation while summarising min, max, mean, sum, and count of metrics recorded
  • Random number seeding
  • Hooks
  • Tool based log parsers
  • Custom runners - currently everything is shell, perhaps support other things?
  • Non-environment variable based parameters

Project details


Release history Release notifications | RSS feed

This version

0.1

Download files

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

Source Distribution

gator_eda-0.1.tar.gz (33.8 kB view details)

Uploaded Source

Built Distribution

gator_eda-0.1-py3-none-any.whl (50.1 kB view details)

Uploaded Python 3

File details

Details for the file gator_eda-0.1.tar.gz.

File metadata

  • Download URL: gator_eda-0.1.tar.gz
  • Upload date:
  • Size: 33.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.4.2 CPython/3.11.1 Darwin/22.2.0

File hashes

Hashes for gator_eda-0.1.tar.gz
Algorithm Hash digest
SHA256 cdd22e774529c09dedbdec698f97e3c6c4385a9c7a7d98d6408a239a5a54efb2
MD5 f571efaecef621fc0b32300de9b84278
BLAKE2b-256 4b7ac0d722298f67013b288549d3ea76ae02c76183c77bb419702e2f77609ae5

See more details on using hashes here.

File details

Details for the file gator_eda-0.1-py3-none-any.whl.

File metadata

  • Download URL: gator_eda-0.1-py3-none-any.whl
  • Upload date:
  • Size: 50.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.4.2 CPython/3.11.1 Darwin/22.2.0

File hashes

Hashes for gator_eda-0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3d334604cf64e5cf4ea5c070a799f1b9ac55652c00115501c4f14346cb15d327
MD5 f3824b6b8bcfa01baadadb62f95219d0
BLAKE2b-256 9a03526f1f3db530245444965a2cbd983a37419e68ee31211c8c0db8e31241c7

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