Simplified Airflow CLI Tool for Lauching CeleryExecutor Deployment
Project description
Airflow Run
Python tool for deploying Airflow Multi-Node Cluster.
Requirements
Python >=3.6 (tested)
Goal
Steps
Generate config yaml file.
Run commands to start webserver, scheduler, worker, (rabbitmq, postgres).
Add dag files and run initdb.
Generate config file:
afr --generate_config
Running the tool in the same directory as config file:
afr --run postgresql
afr --run initdb
afr --run rabbitmq
afr --run webserver
afr --run scheduler
afr --run worker --queue {queue name}
afr --run flower
Or, running the tool specifying config path:
afr --run postgresql --config /path/config.yaml
Or, use this environment variable to set the config path:
export AIRFLOWRUN_CONFIG_PATH="/some_path/config.yaml"
After running webserver, scheduler and worker (postgres and rabbitmq if needed local instances), Add your dag files in the dags subdirectory in the directory you defined in the config file. Then, run the following:
afr --run initdb
(* note: make sure you have the correct user permission in the dags, logs subdirectories.)
That is it!!
Default Config yaml file:
private_registry: False
registry_url: registry.hub.docker.com
username: ""
password: ""
repository: pkuong/airflow-run
image: airflow-run
tag: latest
local_dir: {local directory where you want to mount /dags and /logs folder}
webserver_port: 8000
flower_port: 5555
env:
AIRFLOW__CORE__EXECUTOR: CeleryExecutor
AIRFLOW__CORE__LOAD_EXAMPLES: "False"
AIRFLOW__CORE__DAGS_FOLDER: /usr/local/airflow/airflow/dags
AIRFLOW__CORE__LOGS_FOLDER: /usr/local/airflow/airflow/logs
AIRFLOW_HOME: /usr/local/airflow
rabbitmq:
name: rabbitmq
username: {username}
password: {password}
host: {IP}
virtual_host: /
image: rabbitmq:3-management
home: /var/lib/rabbitmq
ui_port: 15672
port: 5672
env:
RABBITMQ_DEFAULT_USER: {username}
RABBITMQ_DEFAULT_PASS: {password}
postgresql:
name: postgresql
username: {username}
password: {password}
host: {host}
image: postgres
data: /var/lib/postgresql/data
port: 5432
env:
PGDATA: /var/lib/postgresql/data/pgdata
POSTGRES_USER: {username}
POSTGRES_PASSWORD: {password}
Docker image
https://hub.docker.com/repository/docker/pkuong/airflow-run
Building the image:
afd --build --config_path={absolute path to config.yaml} --dockerfile_path={absolute path to directory which contains Dockerfile}
Contributors
Paulo Kuong (@pkuong)
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
File details
Details for the file airflow-run-0.1.7.tar.gz
.
File metadata
- Download URL: airflow-run-0.1.7.tar.gz
- Upload date:
- Size: 9.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/45.1.0 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/3.6.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a8805c7c2a6c5fa689fa78ca77571bf4f9772d0e6323b0b3a3ef132ede884e7a |
|
MD5 | ee212b4cb9da6b2647ddcff8e6af366c |
|
BLAKE2b-256 | 2630053c09da245b939063ed213cb56c4fe1b3a3fe0e42b4628103bb75c1acf7 |
Provenance
File details
Details for the file airflow_run-0.1.7-py3-none-any.whl
.
File metadata
- Download URL: airflow_run-0.1.7-py3-none-any.whl
- Upload date:
- Size: 10.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/45.1.0 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/3.6.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d4c60982720fa4f8bcebc5cbd00e045b04910d1a57873f17a67b07a8912b0dac |
|
MD5 | ceb45b98ddb7dcdd8b1a64ad40f961ed |
|
BLAKE2b-256 | e18ad572ff22fb217886a79b243864859c1daa4d66001739f7c6e29ee0ff6835 |