Skip to main content

Python 기반 통합 배치 스케줄링 시스템

Project description

jobu (Job Unified)

Python 기반 통합 배치 스케줄링 시스템

요구사항: Python 3.12+

개요

RDB에 크론 정보를 저장하고, Dispatcher가 스케줄에 따라 Job을 생성하면 Worker가 실행하는 구조입니다.

[cron_jobs] --Dispatcher--> [job_executions] --Worker--> [Handler]

특징

  • Dispatcher/Worker 분리로 HA 구성 용이
  • 다중 DB 지원 (SQLite, PostgreSQL, MySQL)
  • 다중 DB 트랜잭션 지원 (@transactional(db1, db2))
  • 비즈니스 로직과 model/sql 분리
  • aiosql 기반 SQL 쿼리 관리
  • 비동기 커넥션풀 지원
  • Admin API로 크론/잡 관리

모듈

모듈 설명
admin 관리 API 및 모니터링 화면
database DB 커넥션풀, 트랜잭션 관리
dispatcher 크론 기반 Job 생성
worker Job 실행 워커풀

흐름: Admin에서 크론 등록 -> Dispatcher가 스케줄에 맞춰 Job 생성 -> Worker가 Job 실행

구조

jobu/
  config/       # 설정 파일
  database/     # DB 커넥션풀 (SQLite, PostgreSQL, MySQL)
  dispatcher/   # Job 생성
  worker/       # Job 실행
  admin/        # 관리 API
  docker/       # Docker 개발 환경

설치

pip install jobu

빠른 시작

# 새 프로젝트 생성
jobu init myproject
cd myproject

# 가상환경 설정
python -m venv .venv
source .venv/bin/activate  # Windows: .venv\Scripts\activate
pip install -r requirements.txt

# 실행
python main.py

템플릿 옵션

jobu init myproject                     # 기본 (main 브랜치)
jobu init myproject --template sample   # sample 브랜치

개발 환경 설치

# 가상환경 생성 및 활성화
python -m venv .venv
source .venv/bin/activate  # Windows: .venv\Scripts\activate

# 의존성 설치
pip install -r requirements.txt

실행

# Admin API
python -m uvicorn admin.main:app --reload --port 8080

# Dispatcher
python -m dispatcher.main

# Worker
python -m worker.main

# Docker (PostgreSQL, MySQL 개발환경)
cd docker && docker-compose up -d

관리자 페이지

URL 설명
http://localhost:8080/docs API 문서 (Swagger)
http://localhost:8080/crons 크론 관리 화면
http://localhost:8080/jobs 잡 이력 화면

개발 가이드

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

jobu-0.2.1.tar.gz (42.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

jobu-0.2.1-py3-none-any.whl (60.0 kB view details)

Uploaded Python 3

File details

Details for the file jobu-0.2.1.tar.gz.

File metadata

  • Download URL: jobu-0.2.1.tar.gz
  • Upload date:
  • Size: 42.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for jobu-0.2.1.tar.gz
Algorithm Hash digest
SHA256 f86d6fbce887e90d160302682a9884379246ea45551ee25416913da444db3686
MD5 53840a393302bc72683929aeb041f501
BLAKE2b-256 f2f43852957a940bd21e0f3f62e44c56788fd914d0e5db20a4738af103724ffa

See more details on using hashes here.

File details

Details for the file jobu-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: jobu-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 60.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for jobu-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0f736b0dc38e6e4718c1169cc31b9163e04a2bc0396c1571d1324b2f4a2b1d91
MD5 220148d05bacba44c6a342abbf246ac4
BLAKE2b-256 03d56efccbbddab4050048afe427cfcd8efd7dd2fe6ed40757894c218f18cb34

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page