Skip to main content

CLI to handle Airflow in Docker Environment

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

actl up

This command will:

  • Check Docker installation and environment
  • Create last docker-compose.yml
  • 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

actl down

Usage

Available Commands

# Start Docker environment
actl up

# Stop Docker environment
actl down

# Run Airflow DAG inside Docker
actl run

# Run flake8 linter on DAGs
actl fix

# Show help
actl --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

actl run

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

actl fix

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
pip install twine
twine upload dist/* --username __token__ --password "$PYPI_TOKEN"

License

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


Made 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.24.tar.gz (6.5 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.24-py3-none-any.whl (7.8 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for airflow_cli-0.1.24.tar.gz
Algorithm Hash digest
SHA256 fcf5f70b870ff03a6626b79851fbf674c6f89b8063b2fd1ce07955a858c5ef54
MD5 c79048fdab4d6176159198ef5efe43c8
BLAKE2b-256 0445d5ea56865bb4406dcccf418eb5f466dd1940c82ffb98d7533788efc85be3

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for airflow_cli-0.1.24-py3-none-any.whl
Algorithm Hash digest
SHA256 eccec6dece11fe33d3755a501b68f6f997a7a732dd45dbd3c217bf9a507b404b
MD5 9146606fe713797c1431cee3681bb0e4
BLAKE2b-256 c36cb5bc31cede5d6bdd376d3fcb4e9c0c422a14b4abc546f3de6f0d5cf82aa4

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