Standalone admin panel with all data stored in SQLite database
| Tasks Page | Task Details Page |
|---|---|
![]() | ![]() |
- Import and connect the middleware to the broker:
... fromtaskiq.middlewares.taskiq_admin_middlewareimportTaskiqAdminMiddlewarebroker= ( RedisStreamBroker( url=redis_url, queue_name="my_lovely_queue", ) .with_result_backend(result_backend) .with_middlewares( TaskiqAdminMiddleware( url="http://localhost:3000", # the url to your taskiq-admin instanceapi_token="supersecret", # any secret enough stringtaskiq_broker_name="mybroker", ) ) ) ...Pull the image from GitHub Container Registry:
docker pull ghcr.io/taskiq-python/taskiq-admin:latestReplace
TASKIQ_ADMIN_API_TOKENwith any secret enough string and run:
docker run -d --rm \ -p "3000:3000" \ -v "./taskiq-admin-data/:/usr/database/" \ -e "TASKIQ_ADMIN_API_TOKEN=supersecret" \ --name "taskiq-admin" \ "ghcr.io/taskiq-python/taskiq-admin:latest"- Go to
http://localhost:3000/tasks
services: queue: build: context: .dockerfile: ./Dockerfilecontainer_name: my_queuecommand: taskiq worker app.tasks.queue:broker --workers 1 --max-async-tasks 20environment: - TASKIQ_ADMIN_URL=http://taskiq_admin:3000 - TASKIQ_ADMIN_API_TOKEN=supersecretdepends_on: - redis - taskiq_admintaskiq_admin: image: ghcr.io/taskiq-python/taskiq-admin:latestcontainer_name: taskiq_adminports: - 3000:3000environment: - TASKIQ_ADMIN_API_TOKEN=supersecretvolumes: - admin_data:/usr/database/volumes: admin_data:cp env-example .env, enter.envfile and fill in all needed variables- run
make devto run it locally in dev mode - run
make prodto run it locally in prod mode
Let's assume we have a task 'do_smth', there are all states it can embrace:
queued- the task has been sent to the queue without an errorrunning- the task is grabbed by a worker and is being processedsuccess- the task is fully processed without any errorsfailure- an error occured during the task processingabandoned- taskiq-admin sets all 'running' tasks as 'abandoned' if there was a downtime between the time these tasks were in 'running' state and the time of next startup of taskiq-admin
- Run
pnpm installto install all dependencies - Run
pnpm db:pushto create the sqlite database if needed - Run
pnpm devto run the project

