arq dashboard and http api
Project description
arq-http
Dashboard and HTTP api for arq job queue.
Installation
Run with docker
docker run -e REDIS_ADDRESS="<REDIS_ADDRESS>" -p 8000:8000 pieca/arq-http:0.2
Install Python package
# install
TODO
# start rerver
arq-http
Configuration
Configuration is made via environment variables.
| variable | description |
|---|---|
| REDIS_ADDRESS | redis address, default: redis://localhost:6379 |
| DEFAULT_REFRESH | default refresh frequency of dashboards (in seconds), default: 5.0 |
Refresh frequency can also be controlled by query parameter when opening dashboards:
http://localhost:8000/dashboard/arq:myqueue?refresh=2
Usage
Links
- dashboards per queue: http://localhost:8000/dashboard/
- api docs: http://localhost:8000/api/docs
Api
- list jobs
curl -X GET http://localhost:8000/api/jobs
- schedule job
Keyword arguments to enqueue_job need to be posted as json data.
Assuming you have a function get_random_numbers:
curl -X POST \
-d '{"_queue_name": "arq:myqueue", "function": "get_random_numbers", "n": 10}' \
http://localhost:8000/api/jobs
Screenshots
Dashboard
Job listing
Job details
local dev
# run valkey
docker run -p 6380:6379 valkey/valkey:8.0.2
# run dashboard
REDIS_ADDRESS="redis://localhost:6380" arq-http
# run example worker
REDIS_ADDRESS="redis://localhost:6380" arq arq_http.worker.WorkerSettings
# create jobs
parallel -I ,, curl -X POST -d \'{\"_queue_name\": \"arq:myqueue\", \"function\": \"get_random_numbers\", \"n\": ,,}\' http://localhost:8000/api/jobs ::: {100000..100100}
parallel -N0 curl -X POST -d \'{\"_queue_name\": \"arq:myqueue\", \"function\": \"random_sleep\"}\' http://localhost:8000/api/jobs ::: {1..10}
# docker build
docker build -t pieca/arq-http:0.2 .
Known limitations
- to be triggered via http api, jobs cannot take custom classes as arguments
- dashboard needs to be manually refreshed after running unknown function
TODO:
- optional disable table generation if too many items
- push only if new data available
- better filters based on job status
- abort endpoint
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 arq_http-0.2.tar.gz.
File metadata
- Download URL: arq_http-0.2.tar.gz
- Upload date:
- Size: 296.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ff1d9253780e3bb98b1e5c9df9351c1987c73a4098d90e0c571114d341856975
|
|
| MD5 |
53cf507d389bee715cf8e7c793f177d7
|
|
| BLAKE2b-256 |
f4378583a0218ab8028c4cb368c5f7ab607fb90a8a4e6559f98f2b6a1b7d2e14
|
File details
Details for the file arq_http-0.2-py3-none-any.whl.
File metadata
- Download URL: arq_http-0.2-py3-none-any.whl
- Upload date:
- Size: 302.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
552ea9702484a9aa4418a21480b937d0770928f4513525e6d21576ef1c511ffe
|
|
| MD5 |
91245ef0cafd1a392d48eebe993dc620
|
|
| BLAKE2b-256 |
a75a0167551cdafa2d20646bd7eda35c8cc133ac9eb0f4c7a64c8a50997f4810
|