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
- Place your DAG files in the
dags/directory - The directory is automatically mounted to the Airflow container
- 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file airflow_cli-0.1.13.tar.gz.
File metadata
- Download URL: airflow_cli-0.1.13.tar.gz
- Upload date:
- Size: 6.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.16
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5df640d9ba9b5ee6be8104e0d3365394d49ecfcd9ce4ed9da21bc275305c39de
|
|
| MD5 |
31262baef8e0c52d7d715974cb4a4e61
|
|
| BLAKE2b-256 |
c15362b7a5d7260cfe127d2934743ea77d10c6c48638042ce7f76ccee3415387
|
File details
Details for the file airflow_cli-0.1.13-py3-none-any.whl.
File metadata
- Download URL: airflow_cli-0.1.13-py3-none-any.whl
- Upload date:
- Size: 8.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.16
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6dfa102ec7a415047ed454868cd8dc8971551edb22c5c54e67821de27de8fa0c
|
|
| MD5 |
37db703c47a2f609a2bf1d5fc414b97a
|
|
| BLAKE2b-256 |
02cb725a450181acaac4a5ffa8366bf512ca3db3b811b51a352efb2de143db75
|