Skip to main content

CLI para facilitar o setup de Airflow com Docker.

Project description

Airflow Docker Helper

A command-line tool to facilitate the setup of Apache Airflow using Docker and enable local DAG development and testing.

Features

  • 🚀 Quick Airflow setup with Docker Compose
  • 🔧 Local DAG development and testing
  • 📦 Pre-configured Docker environment
  • 🛠️ CLI interface for common Airflow operations
  • 🧪 Testing utilities for DAG validation

Prerequisites

  • Python 3.7+
  • Docker and Docker Compose
  • Git

Installation

From PyPI (Recommended)

pip install airflow-cli

Quick Start

1. Start Airflow Environment

airflow-cli up

This command will:

  • Check Docker installation and environment
  • Download the latest docker-compose.yml from LEMA UFPB repository
  • Start Airflow services with Docker Compose

2. Access Airflow UI

Open your browser and navigate to http://localhost:8080

Default credentials:

  • Username: airflow
  • Password: airflow

3. Stop Airflow Environment

airflow-cli down

Usage

Available Commands

# Start Docker environment
airflow-cli up

# Stop Docker environment  
airflow-cli down

# Run Airflow DAG inside Docker
airflow-cli run-dag

# Run flake8 linter on DAGs
airflow-cli fix-code

# Show help
airflow-cli --help

DAG Development

  1. Place your DAG files in the dags/ directory
  2. The directory is automatically mounted to the Airflow container
  3. Changes are reflected immediately (no restart required)

Expected DAG structure for run-dag command:

project/
├── dags/
│   └── my_dag/
│       ├── config.yml
│       └── dag.py

Example config.yml:

args:
  id: "my_dag_id"

Testing DAGs

Run a DAG inside Docker

airflow-cli run-dag

This command will:

  • Look for DAG configuration files in dags/*/config.yml
  • Execute the DAG inside the running Airflow container

Validate DAG syntax with flake8

airflow-cli fix-code

This will run flake8 linter on the dags/ folder to check for Python syntax issues.

Building from Source

# Build wheel
python -m build

# Install built package
pip install dist/airflow_cli-*.whl

Publishing to PyPI

# Build wheel
python -m build
# Publish to PyPI
twine upload dist/*

License

This project is licensed under the MIT License - see the LICENSE file for details.


Made with ❤️ by the LEMA UFPB team

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

airflow_cli-0.1.12.tar.gz (8.7 kB view details)

Uploaded Source

Built Distribution

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

airflow_cli-0.1.12-py3-none-any.whl (9.4 kB view details)

Uploaded Python 3

File details

Details for the file airflow_cli-0.1.12.tar.gz.

File metadata

  • Download URL: airflow_cli-0.1.12.tar.gz
  • Upload date:
  • Size: 8.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.16

File hashes

Hashes for airflow_cli-0.1.12.tar.gz
Algorithm Hash digest
SHA256 f0438108bb9f1afb681a3c85a3ca42892c7c04b97965effb501bef3d3f83f655
MD5 2dfca22bc11a46d7a1cba9f6172c3637
BLAKE2b-256 593e0c46c7f4bee3e96965f5d1799dff1fc034f97dcf35920e9aba897b08d159

See more details on using hashes here.

File details

Details for the file airflow_cli-0.1.12-py3-none-any.whl.

File metadata

  • Download URL: airflow_cli-0.1.12-py3-none-any.whl
  • Upload date:
  • Size: 9.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.16

File hashes

Hashes for airflow_cli-0.1.12-py3-none-any.whl
Algorithm Hash digest
SHA256 80a0db67800209eb8a02b334b90d5b6ce692016108833e6867407160f1763a50
MD5 8908295a53e37b074f9a363fa1b3ce85
BLAKE2b-256 1e3bc2192716fc05c546fcf00299441bbcbcd7a5042d3aa55925dba4d3a53752

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