Skip to main content
Percival logo

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, token or secret is 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=False to 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.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for percival 0.1.2
File Size Uploaded Provenance Actions
percival-0.1.2.tar.gz 27.0 kB Without provenance Details for percival-0.1.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for percival 0.1.2
File Interpreter ABI Platform Actions
percival-0.1.2-py3-none-any.whl Python 3 none any Details for percival-0.1.2-py3-none-any.whl

Total release size: 53.9 kB

Release files / percival-0.1.2.tar.gz

Download URL percival-0.1.2.tar.gz
Size 27.0 kB
Tags Source
SHA-256 checksum
How to use checksums
7656c531b2d9f42990dedfe9e21537fd81df4189f88768cfed3430fb15bdcc7e
BLAKE2b-256 checksum
How to use checksums
0a30bdcb8a8e1f5827c94dddb104a1eb4891e732a7d29dac2c3fb1e33c94b799
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.2-py3-none-any.whl

Download URL percival-0.1.2-py3-none-any.whl
Size 26.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e87f9e477a8a71a6b082ba4dd6686fd524d8d8bf94562bfa4c40981c2ece8bb2
BLAKE2b-256 checksum
How to use checksums
b07c620e3d32277958a106689c5089dec59fbb95d720922d72f849fa5e0f3721
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.2

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page