https://github.com/nikitachalykh/scheduler_task_service
Scheduler task service
https://github.com/nikitachalykh/scheduler_task_service
docker docker-compose postgresql pydantic-v2 python3 redis
Last synced: 3 months ago
JSON representation
Scheduler task service
- Host: GitHub
- URL: https://github.com/nikitachalykh/scheduler_task_service
- Owner: NikitaChalykh
- Created: 2025-03-04T07:15:42.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-03-04T09:21:06.000Z (over 1 year ago)
- Last Synced: 2025-03-04T09:29:18.616Z (over 1 year ago)
- Topics: docker, docker-compose, postgresql, pydantic-v2, python3, redis
- Language: Python
- Homepage:
- Size: 29.3 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Periodic shared task execution service
=====
Project description
----------
The project utilizes a shared task queue in Redis and supports multiple independent workers for easy scaling.
The service is deployed in the following Docker containers:
PostgreSQL database
Redis database
One or more workers for executing scheduled tasks
Error logging is configured, and task execution history, including statuses, is stored in the database.
System requirements
----------
* Python 3.12+
* Docker
* Works on Linux
Technology stack
----------
* Python 3.12+
* SQLAlchemy 2.0.38
* alembic 1.14.1
* pydantic 2.10.6
* Postgres 15.2
* Redis 7.2.0
* Docker, Docker Compose
Installing the project from the repository
----------
1. Clone the repository:
```bash
git clone git@github.com:NikitaChalykh/scheduler_task_service.git
cd scheduler_task_service # Go to the directory with the project
```
2. Create the ```.env``` file using ```env.example``` as a template
3. Installing and running the service in a container:
```bash
docker compose up -d # To run one worker
docker compose up --scale scheduler=2 -d # To run multiple workers (e.g. two)
```
4. Viewing logs:
```bash
docker exec -it scheduler-service log # Logs when running one worker
docker exec -it scheduler-service_1 log # Logs when running multiple workers (specify worker number)
```