percival
The client half of Percival, a self-hosted control panel for Celery. You install it in your Celery project. It lets the panel change schedules without restarting beat or workers, and it stops two things a ping monitor can't see: a task running twice, and a stale worker running old code.
Needs Celery 5.3+ and Redis. The broker can be Redis or RabbitMQ.
Setup
pip install percival
# proj/celery.py, right after app = Celery(...)
import os, percival
percival.init(
app,
redis_url="redis://localhost:6379/0",
code_version=os.environ.get("GIT_SHA", "dev"), # whatever identifies a deploy
)
celery -A proj beat -S percival.beat.Scheduler
Then run the panel, one container:
docker run -d -p 8080:8080 -v percival:/data \
-e PERCIVAL_REDIS_URL=redis://host.docker.internal:6379/0 \
-e PERCIVAL_ADMIN_PASSWORD=pick-a-long-one \
ghcr.io/rijinraju/percival
Or install it with pip install percival-server.
What init() sets up
- Run events. Started, success, failure, retry and revoked go to a Redis
stream, with timing, worker, code version and redacted args. Anything named
like
password,tokenorsecretis replaced before it leaves the worker. - Worker heartbeat. Every worker reports its hostname, queues and code version every 30 seconds.
- Task metadata. The signature, docstring and source of each task, so the
panel can show them. Pass
publish_source=Falseto keep source private. - Stale worker gate. A schedule can require a code version. A worker on a different version doesn't run the task. The message goes back on the queue for an up-to-date worker.
Stopping duplicate runs
from percival import once_per
@app.task
@once_per(key=lambda user_id, **kw: user_id, window="1d")
def send_digest(user_id): ...
A second run for the same key in the same window is skipped and recorded.
Moving an existing beat_schedule
percival import --app proj.celery:app --redis-url redis://localhost:6379/0 --apply
Then remove those entries from beat_schedule.
The full README has every
option and a docker compose up demo.
Metadata
Release files for percival 0.1.3
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 | Actions |
|---|---|---|---|---|
| percival-0.1.3.tar.gz | 27.0 kB | Without provenance | Details for percival-0.1.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| percival-0.1.3-py3-none-any.whl | Python 3 | none | any | Details for percival-0.1.3-py3-none-any.whl |
Total release size: 53.9 kB
Release files / percival-0.1.3.tar.gz
| Download URL | percival-0.1.3.tar.gz |
|---|---|
| Size | 27.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
677356715320325cb5f9769564ce8a4fd8c9a3f52cf53c8e13a34cc94fc650cc
|
|
BLAKE2b-256 checksum How to use checksums |
df4a6b67740734567b1176266bcec10897a06afe7eb8dbd4d22647b628577b47
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.3
|
Release files / percival-0.1.3-py3-none-any.whl
| Download URL | percival-0.1.3-py3-none-any.whl |
|---|---|
| Size | 26.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a50a988184bb87e6ea9328f58d76cf62ecfb698b41dc35eb65ed8cd19f8c4f8d
|
|
BLAKE2b-256 checksum How to use checksums |
03217034e6694614faa70486ccd4fa48a8ff3f0a78844b7c939b010fe136b5e5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.3
|
Security for percival 0.1.3
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.
To learn more about protecting yourself from malicious actors, visit our package security documentation.