Shire
Heavy-job queue processor
Installation
pip install shire
Create config file
Run shire-cli create_config, follow instructions.
An example of the shire.cfg:
[connection] redis_url = redis://127.0.0.1:6379/0 db_url = postgres://peewee:123@127.0.0.1:5432/peewee [hostler] check_time = 5 [shire] venv_path = /path/to/your/virtualenv sys_path = /path/to/your/project:/path/to/external/library host = default [scribe] per_pool = 1 log_max_size = 104857600 log_directory = logs max_logs = 5 default_log = default.log [pool] check_time = 30 [whip] limits_update_time = 60 check_time = 1
Queue management
- Interactive shire config creation
shire-cli -c /path/to/your/shire.cfg create_config
- Run whip (Enqueue jobs to pools)
shire-cli -c /path/to/your/shire.cfg run_whip
- Run scribe (Shire job logs writer)
shire-cli -c /path/to/your/shire.cfg run_scribe
- Run hostler (Shire failed jobs restarter)
shire-cli -c /path/to/your/shire.cfg run_hostler
- Run pool (Shire job executor)
shire-cli -c /path/to/your/shire.cfg run_pool –name=pool_name
- Run multiple pools with one master-process
shire-cli -c /path/to/your/shire.cfg start_pools –names=pool_name,another_pool
Example
- Run shire
shire-cli -c /path/to/your/shire.cfg run_whip shire-cli -c /path/to/your/shire.cfg run_pool –name=default
Create example jobs module:
# my_jobs.py
from shire.job import Job
import requests
def save(text_len):
# save - your external function to save result data. Shire not save any results itself.
pass
class CountWordsAtUrl(Job):
def run(url=None):
resp = requests.get(url)
save(len(resp.text.split()))
Create example configuration module:
# shire_conf.py
from shire.config import Config as ShireConfig
conf = ShireConfig()
conf.load('/path/to/your/shire.cfg')
Enqueue job:
from my_jobs import CountWordsAtUrl
from shire_conf import conf
CountWordsAtUrl.delay(conf, pool='default', kwargs={'url': 'https://github.com/suguby/shire'})
Metadata
Release files for shire 0.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| shire-0.2.1.tar.gz | 20.8 kB | Without provenance | Details |
Release files / shire-0.2.1.tar.gz
| Download URL | shire-0.2.1.tar.gz |
|---|---|
| Size | 20.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
115ba0f78b935454ae0fb78889089944e1756155a65f78b26fc0de3e2c78a00a
|
|
BLAKE2b-256 checksum How to use checksums |
560128457870d196afb505ee88f6957a564d30a5c9d13c7698ed2288967a7542
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for shire 0.2.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.