Django-based job queue
Project description
parviraptor
parviraptor is a Django app for managing queue-based jobs, both
sequentially and in parallel.
This package provides
-
abstract base classes and factories for modelling Django Model based job queues
-
capabilities of supporting jobs' interdependencies
-
a management command for processing job queues
-
rudimentary Django views for monitoring and job queue statistics
Compatibility
parviraptor should be compatible with any Django codebase. The test suite
covers Django 3.2, 4.0, 4.1 and 4.2 with each MySQL 5 and 8, the latter
depending on which MySQL versions Django supports.
Running tests
Tests and lints are covered by just test, you can separately lint using
the command just lint.
Development
For developing parviraptor it is necessary to have nix 2.x and direnv
2.x installed as system-wide dependencies. nix must have enabled the features
"nix command" and "flake support".
The development shell can be invoked by e.g. direnv exec . zsh. Executing
this for the first time might require to run direnv allow. Shorthand
commands, for example those mentioned in chapter "Running tests", can be
enumerated using just --help.
In order to test whether the package would be built correctly, you can
run python setup.py build in the development shell to inspect whether
build/lib/parviraptor/ looks as expected.
Installation
Just add 'parviraptor' to your INSTALLED_APPS Django setting as usual.
API outline
-
parviraptor.models.AbstractJobFactoryis a factory generating job base classes. For details, see the class documentation itself. Also, you can spy intotests/models.pyto see job class examples which have (or don't have) interdependencies. -
parviraptorimplements rudimentary views for monitoring (/queue-monitoring) and statistics (/open-queue-entries). You can reuse them by including the URLs by e.g.from django.urls import include, path urlpatterns = [ # ... path("", include("parviraptor.urls")), # ... ]
-
/queue-monitoring: As a german IT department started implementing this functionality this endpoint serves "Alles OK" in case everything is fine. If there are failed, long unprocessed or long pending jobs, they are counted per queue and written down in english plain text. -
/open-queue-entriesserves a human-readable, styled table (in English) with open or pending job counts.
-
-
The management command
process_queuestarts a worker for processing a certain job queue. It internally manages each necessary job transition (e.g.PROCESSING->FAILED).parviraptorsupports so-called temporary job failures, i.e. if a "temporary exception" is raised,parviraptorresumes the job respecting the per-job configurable backoff strategy.- generic call:
./manage.py process_queue <app_label> <model>. - example:
./manage.py process_queue very_busy_app HeavyDutyJob
- generic call:
-
The management command
clean_old_processed_jobscan be used for cleaning up stale job entries. -
parviraptor.testprovides a simple API for testing job queues.parviraptor.test.make_test_case_for_all_queuesinfers a test class which automatically covers all queues in your current codebase. You just need to derive fromJobEntryFactoryand provide an implementation which covers creating concrete instances for each job class. For further details, see according class and function documentations.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file parviraptor-3.4.0.tar.gz.
File metadata
- Download URL: parviraptor-3.4.0.tar.gz
- Upload date:
- Size: 25.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
592c4757e37367d40e11f5affbbed23ee8087b6f255daf137bd0a82e782dfdd2
|
|
| MD5 |
d0613a486f9499e8e1b047a9041d7d77
|
|
| BLAKE2b-256 |
80b6d18b7df907dcad1d7b0110078e5acb634412b84fbbc664232655eee4b80a
|
Provenance
The following attestation bundles were made for parviraptor-3.4.0.tar.gz:
Publisher:
python-publish.yml on puzzleYOU/parviraptor
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
parviraptor-3.4.0.tar.gz -
Subject digest:
592c4757e37367d40e11f5affbbed23ee8087b6f255daf137bd0a82e782dfdd2 - Sigstore transparency entry: 748761501
- Sigstore integration time:
-
Permalink:
puzzleYOU/parviraptor@bf1ec0b69ce40807b112238a92f8e82abf47ae6b -
Branch / Tag:
refs/tags/3.4.0 - Owner: https://github.com/puzzleYOU
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@bf1ec0b69ce40807b112238a92f8e82abf47ae6b -
Trigger Event:
release
-
Statement type:
File details
Details for the file parviraptor-3.4.0-py3-none-any.whl.
File metadata
- Download URL: parviraptor-3.4.0-py3-none-any.whl
- Upload date:
- Size: 32.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8ed0a113d2a68428130704997e313ee63d1782919de04a53a0002d45ff29ab18
|
|
| MD5 |
fa3a3e25d9bfae040625c649ee2b5606
|
|
| BLAKE2b-256 |
7685787fb462c28f27cb992661af246f1557247dfd76da71dbb26d26bfbb8e6b
|
Provenance
The following attestation bundles were made for parviraptor-3.4.0-py3-none-any.whl:
Publisher:
python-publish.yml on puzzleYOU/parviraptor
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
parviraptor-3.4.0-py3-none-any.whl -
Subject digest:
8ed0a113d2a68428130704997e313ee63d1782919de04a53a0002d45ff29ab18 - Sigstore transparency entry: 748761506
- Sigstore integration time:
-
Permalink:
puzzleYOU/parviraptor@bf1ec0b69ce40807b112238a92f8e82abf47ae6b -
Branch / Tag:
refs/tags/3.4.0 - Owner: https://github.com/puzzleYOU
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@bf1ec0b69ce40807b112238a92f8e82abf47ae6b -
Trigger Event:
release
-
Statement type: