How praveenadapa425/automated-machine-learning-automl-platform-with-mlflow-and-celery works
1. This repository is a small distributed Python platform split into two deployable services: a FastAPI API in api/ and a Celery worker in worker/. The top-level docker-compose.yml ties them together with Redis and MLflow, so the architecture is service-oriented rather than a single monolith.
2. The api/ service is the synchronous request layer. Its app lives under api/app/ with clear FastAPI-style boundaries: routes/ for HTTP endpoints, schemas/ for request/response models, services/ for business logic, and core/ for configuration and logging. In the current tree, the only explicit endpoint is GET /health, so the API is scaffolded for expansion but already production-shaped.
3. The worker/ service is the asynchronous execution layer. It uses Celery (worker/app/celery_app.py) and defines background jobs in worker/app/tasks/jobs.py. This is the boundary where longer-running AutoML work should live, separate from HTTP request handling.
4. The worker’s internal service split suggests two main responsibilities: automl_service.py for model training/selection workflows and artifact_service.py for persisting or organizing outputs. That means the worker is not just a generic queue consumer; it is the compute-and-artifact subsystem for the platform.
5. MLflow is an external system in the architecture and is central to experiment tracking / model artifact management. The presence of MLflow in the compose stack strongly implies the worker logs runs, parameters, metrics, and artifacts there rather than keeping them inside the API process.
6. Redis is the queue backbone. In this setup it is the Celery broker and likely the result backend, forming the handoff point between the API and worker. The main data flow is: a client calls the API, the API submits a background job, Redis carries the task, and the worker executes it.
7. Both services have their own core/config.py and core/logging.py, which means configuration and logging are intentionally isolated per runtime. Environment variables drive behavior in each container, and the .env.example files indicate the deployment model is config-heavy but code-light.
8. The schemas/ packages in both services define the contract boundary. In the API, schemas model HTTP payloads; in the worker, schemas/job.py likely describes task/job state or job metadata. This keeps transport concerns separate from service logic.
9. worker/app/utils/path_utils.py suggests filesystem path handling for local artifacts, temporary files, or ML outputs. That is a clue that the worker may manage intermediate model files before pushing final artifacts to MLflow or another storage target.
10. Docker is the deployment boundary for both services. Each service has its own Dockerfile, and the compose file provides local orchestration across API, worker, Redis, and MLflow. There is no separate database service visible in the tree, which is an important architectural signal.
11. The repository currently looks like a starter scaffold for an AutoML platform rather than a completed product. The structure already separates API, async execution, observability/artifact tracking, and shared infrastructure, so an architecture diagram should emphasize those boundaries even though only the health endpoint is implemented in the snapshot.
Main entry points: app/main.py API app · docker-compose.yml Compose stack · app/main.py Worker app · jobs.py Job tasks
Components 19
API Service
Synchronous FastAPI request layer and HTTP contract.
- API app · FastAPI application wiring and startup for the request service.
api/app/main.py - Health route · Explicit HTTP endpoint surface currently centered on health checks.
api/app/routes/health.py - API schemas · Request and response contracts for the API service.
api/app/schemas/health.py - Health logic · Business logic behind the health endpoint.
api/app/services/health_service.py - API config · Environment-driven API settings.
api/app/core/config.py - API logging · Logging setup isolated to the API runtime.
api/app/core/logging.py
Worker Service
Asynchronous Celery execution layer for AutoML jobs.
- Worker app · Worker process bootstrap and runtime wiring.
worker/app/main.py - Celery app · Celery configuration and broker/result integration.
worker/app/celery_app.py - Job tasks · Background task definitions executed by Celery.
worker/app/tasks/jobs.py - AutoML service · Model training and selection workflows.
worker/app/services/automl_service.py - Artifact service · Persistence and organization of outputs and artifacts.
worker/app/services/artifact_service.py - Job schema · Job metadata and state contract used by the worker.
worker/app/schemas/job.py - Worker config · Environment-driven worker settings.
worker/app/core/config.py - Worker logging · Logging setup isolated to the worker runtime.
worker/app/core/logging.py - Path utils · Filesystem path handling for local intermediate files.
worker/app/utils/path_utils.py
Infrastructure
Compose-managed runtime and external backing services.
- Compose stack · Local multi-service deployment for API, worker, Redis, and MLflow.
docker-compose.yml - Client · External caller that reaches the API.
- Redis · Task queue backbone between API and worker.
- MLflow · Experiment tracking and artifact registry.
Connections 21
- Client → API app: HTTP request · External callers hit the FastAPI service.
- Compose stack → API app: runs · Compose starts the API container.
- Compose stack → Worker app: runs · Compose starts the worker container.
- Compose stack → Redis: provides · Compose provisions the queue broker.
- Compose stack → MLflow: provides · Compose provisions the tracking service.
- API app → Health route: mounts · The app exposes HTTP routes.
- Health route → API schemas: validates · Route handlers use request and response models.
- Health route → Health logic: delegates · Endpoint handlers defer logic to services.
- API app → API config: loads · API startup reads runtime settings.
- API app → API logging: uses · API startup configures logging.
- Health logic → Redis: queues task · The API submits background work to the broker.
- Worker app → Celery app: boots · Worker runtime initializes Celery.
- Celery app → Redis: brokers · Celery consumes tasks through Redis.
- Celery app → Job tasks: registers · Celery discovers executable jobs.
- Job tasks → Job schema: uses · Task execution is shaped by job metadata contracts.
- Job tasks → AutoML service: executes · Jobs invoke AutoML workflows.
- Job tasks → Artifact service: persists · Jobs store outputs and artifacts.
- AutoML service → MLflow: logs runs · Training workflows record experiments and metrics.
- Artifact service → Path utils: manages paths · Artifact handling relies on filesystem helpers.
- Worker app → Worker config: loads · Worker startup reads runtime settings.
- Worker app → Worker logging: uses · Worker startup configures logging.