Skip to content

About

ETL pipeline built with Apache Airflow for processing Azure DevOps data. This project combines data orchestration with containerized deployment for scalable data processing workflows.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

DevOps ETL Project

A comprehensive ETL (Extract, Transform, Load) pipeline built with Apache Airflow for processing DevOps data. This project combines data orchestration with containerized deployment for scalable data processing workflows.

Project Structure

devops-etl/
├── airflow_db/                 # PostgreSQL database for Airflow
├── dags/                       # Airflow DAG definitions
├── devops/                     # Core ETL package
│   ├── src/                    # Source code
│   │   ├── api.py              # API integrations
│   │   ├── devops.py           # Main DevOps logic
│   │   ├── orchestration.py    # Workflow orchestration
│   │   ├── orm.py              # Database ORM models
│   │   ├── parser.py           # Data parsing utilities
│   │   ├── requests.py         # HTTP request handling
│   │   ├── schema.py           # Data schemas
│   │   └── utils.py            # Utility functions
│   └── tests/                  # Test files
├── scripts/                    # Utility scripts
├── docker-compose.yaml         # Development environment
├── docker-compose.prod.yaml    # Production environment
├── Dockerfile                  # Container definition
├── .example.env                # Environment variables
└── requirements.txt            # Python dependencies

Prerequisites

  • Docker and Docker Compose
  • Python 3.12+
  • UV package manager (0.7.2 or higher)

Quick Start

Development Environment

  1. Clone the repository

    git clone <repository-url>
    cd devops-etl
  2. Start the development environment

    docker compose up -d
  3. Access services

Production Environment

docker compose -f docker-compose.prod.yaml up -d

Configuration

Environment Variables

Create a .env file in the root directory with the following variables:

# Airflow Configuration
AIRFLOW_HOME=/app/airflow
AIRFLOW__CORE__DAGS_FOLDER=/app/dags
AIRFLOW__CORE__LOAD_EXAMPLES=False
AIRFLOW__DATABASE__SQL_ALCHEMY_CONN=postgresql+psycopg2://airflow:airflow@airflow-db:5432/airflow
AIRFLOW__CORE__EXECUTOR=LocalExecutor

EXTERNAL_PYTHON_PATH=/app/devops/.venv/bin/python
PACKAGE_HOME=/app

# Database Configuration
# (Use a user that has only SELECT, INSERT, DELETE permissions, as pandas will mess up the schema if given more permissions)
DB_HOST=devops_db
DB_PORT=3306
DB_USER=devops_user
DB_PASSWORD=PAssWORD123
DB_NAME=internal_devops

Database Setup

The project uses two databases:

  • MySQL: For application data storage (connection to database is done using SQLAlchemy ORM)
  • PostgreSQL: For Airflow metadata

Run the following command to initialize the application database:

source scripts/init_db.sh

Since ORMs don't support creating views, you will need to create the views manually in the database. The SQL scripts for creating views are located in scripts/sql/.

Development

Local Development Setup

uv venv --python 3.12
uv pip install -r requirements.txt
cd devops/
uv sync

Adding New DAGs

  1. Create your DAG file in the dags/ directory
  2. Follow Airflow best practices for DAG definition
  3. Restart the Airflow scheduler to pick up new DAGs (Or use the Airflow UI to reparse DAGs)

Package Structure

The core devops package contains:

  • API Layer: Handle external API integrations
  • Data Processing: ETL pipeline implementations
  • ORM Models: Database schema definitions
  • Utilities: Common helper functions

Monitoring and Logs

  • Airflow Logs: Available in $AIRFLOW_HOME/logs/
  • Container Logs: Use docker compose logs <service-name>
  • Health Checks: All services include health check configurations

About

ETL pipeline built with Apache Airflow for processing Azure DevOps data. This project combines data orchestration with containerized deployment for scalable data processing workflows.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Contributors

Languages