> Airflow is a platform to programmatically author, schedule and monitor workflows.
> Airflow is a platform to programmatically author, schedule and monitor workflows. Airflow Worker is one of the required components when the CeleryExecutor is configured.
https://airflow.apache.org/
https://airflow.apache.org/
### Ironbank Hardened Image Notes:
### Ironbank Hardened Image Notes:
...
@@ -10,7 +10,7 @@ apache-airflow-providers-elasticsearch will not work on this image due to vulner
...
@@ -10,7 +10,7 @@ apache-airflow-providers-elasticsearch will not work on this image due to vulner
@@ -26,7 +26,7 @@ You can find the default credentials and available configuration options in the
...
@@ -26,7 +26,7 @@ You can find the default credentials and available configuration options in the
* Bitnami container images are released daily with the latest distribution packages available.
* Bitnami container images are released daily with the latest distribution packages available.
> This [CVE scan report](https://quay.io/repository/bitnami/airflow?tab=tags) contains a security report with all open CVEs. To get the list of actionable security issues, find the "latest" tag, click the vulnerability report link under the corresponding "Security scan" field and then select the "Only show fixable" filter on the next page.
> This [CVE scan report](https://quay.io/repository/bitnami/airflow-worker?tab=tags) contains a security report with all open CVEs. To get the list of actionable security issues, find the "latest" tag, click the vulnerability report link under the corresponding "Security scan" field and then select the "Only show fixable" filter on the next page.
# Supported tags and respective `Dockerfile` links
# Supported tags and respective `Dockerfile` links
...
@@ -34,10 +34,10 @@ You can find the default credentials and available configuration options in the
...
@@ -34,10 +34,10 @@ You can find the default credentials and available configuration options in the
Learn more about the Bitnami tagging policy and the difference between rolling tags and immutable tags [in our documentation page](https://docs.bitnami.com/tutorials/understand-rolling-tags-containers/).
Learn more about the Bitnami tagging policy and the difference between rolling tags and immutable tags [in our documentation page](https://docs.bitnami.com/tutorials/understand-rolling-tags-containers/).
Subscribe to project updates by watching the [bitnami/airflow GitHub repo](https://github.com/bitnami/bitnami-docker-airflow).
Subscribe to project updates by watching the [bitnami/airflow GitHub repo](https://github.com/bitnami/bitnami-docker-airflow-worker).
# Prerequisites
# Prerequisites
...
@@ -45,14 +45,15 @@ To run this application you need [Docker Engine](https://www.docker.com/products
...
@@ -45,14 +45,15 @@ To run this application you need [Docker Engine](https://www.docker.com/products
# How to use this image
# How to use this image
Airflow requires access to a PostgreSQL database to store information. We will use our very own [PostgreSQL image](https://www.github.com/bitnami/bitnami-docker-postgresql) for the database requirements. Additionally, if you pretend to use the `CeleryExecutor`, you will also need an [Airflow Scheduler](https://www.github.com/bitnami/bitnami-docker-airflow-scheduler), one or more [Airflow Workers](https://www.github.com/bitnami/bitnami-docker-airflow-worker) and a [Redis(TM) server](https://www.github.com/bitnami/bitnami-docker-redis).
Airflow Worker is a component of an Airflow solution configuring with the `CeleryExecutor`. Hence, you will need to rest of Airflow components for this image to work.
You will need an [Airflow Webserver](https://www.github.com/bitnami/bitnami-docker-airflow), an [Airflow Scheduler](https://www.github.com/bitnami/bitnami-docker-airflow-scheduler), a [PostgreSQL database](https://www.github.com/bitnami/bitnami-docker-postgresql) and a [Redis(TM) server](https://www.github.com/bitnami/bitnami-docker-redis).
## Using Docker Compose
## Using Docker Compose
The main folder of this repository contains a functional [`docker-compose.yml`](https://github.com/bitnami/bitnami-docker-airflow/blob/master/docker-compose.yml) file. Run the application using it as shown below:
The main folder of this repository contains a functional [`docker-compose.yml`](https://github.com/bitnami/bitnami-docker-airflow-worker/blob/master/docker-compose.yml) file. Run the application using it as shown below:
@@ -135,6 +136,7 @@ If you want to run the application manually instead of using `docker-compose`, t
...
@@ -135,6 +136,7 @@ If you want to run the application manually instead of using `docker-compose`, t
-eAIRFLOW_DATABASE_NAME=bitnami_airflow \
-eAIRFLOW_DATABASE_NAME=bitnami_airflow \
-eAIRFLOW_DATABASE_USERNAME=bn_airflow \
-eAIRFLOW_DATABASE_USERNAME=bn_airflow \
-eAIRFLOW_DATABASE_PASSWORD=bitnami1 \
-eAIRFLOW_DATABASE_PASSWORD=bitnami1 \
-eAIRFLOW_QUEUE=new_queue \
--net airflow-tier \
--net airflow-tier \
--volume airflow_worker_data:/bitnami \
--volume airflow_worker_data:/bitnami \
bitnami/airflow-worker:latest
bitnami/airflow-worker:latest
...
@@ -148,7 +150,7 @@ If you remove the container all your data and configurations will be lost, and t
...
@@ -148,7 +150,7 @@ If you remove the container all your data and configurations will be lost, and t
For persistence you should mount a volume at the `/bitnami` path. Additionally you should mount volumes for persistence of [PostgreSQL data](https://github.com/bitnami/bitnami-docker-mariadb#persisting-your-database) and [Redis(TM) data](https://github.com/bitnami/bitnami-docker-mariadb#persisting-your-database)
For persistence you should mount a volume at the `/bitnami` path. Additionally you should mount volumes for persistence of [PostgreSQL data](https://github.com/bitnami/bitnami-docker-mariadb#persisting-your-database) and [Redis(TM) data](https://github.com/bitnami/bitnami-docker-mariadb#persisting-your-database)
The above examples define docker volumes namely `postgresql_data`, `redis_data`, `airflow_data`, `airflow_scheduler_data` and `airflow_worker_data`. The Airflow application state will persist as long as these volumes are not removed.
The above examples define docker volumes namely `postgresql_data`, `redis_data`, `airflow_data`, `airflow_scheduler_data` and `airflow_worker_data`. The Airflow Worker application state will persist as long as these volumes are not removed.
To avoid inadvertent removal of these volumes you can [mount host directories as data volumes](https://docs.docker.com/engine/tutorials/dockervolumes/). Alternatively you can make use of volume plugins to host the volume data.
To avoid inadvertent removal of these volumes you can [mount host directories as data volumes](https://docs.docker.com/engine/tutorials/dockervolumes/). Alternatively you can make use of volume plugins to host the volume data.
...
@@ -166,7 +168,7 @@ services:
...
@@ -166,7 +168,7 @@ services:
-POSTGRESQL_USERNAME=bn_airflow
-POSTGRESQL_USERNAME=bn_airflow
-POSTGRESQL_PASSWORD=bitnami1
-POSTGRESQL_PASSWORD=bitnami1
volumes:
volumes:
-/path/to/airflow-persistence:/bitnami/postgresql
-/path/to/airflow-persistence:/bitnami
redis:
redis:
image:'bitnami/redis:latest'
image:'bitnami/redis:latest'
environment:
environment:
...
@@ -291,63 +293,36 @@ services:
...
@@ -291,63 +293,36 @@ services:
# Configuration
# Configuration
## Load DAG files
Custom DAG files can be mounted to `/opt/bitnami/airflow/dags`.
## Installing additional python modules
## Installing additional python modules
This container supports the installation of additional python modules at start-up time. In order to do that, you can mount a `requirements.txt` file with your specific needs under the path `/bitnami/python/requirements.txt`.
This container supports the installation of additional python modules at start-up time. In order to do that, you can mount a `requirements.txt` file with your specific needs under the path `/bitnami/python/requirements.txt`.
## Environment variables
## Environment variables
The Airflow instance can be customized by specifying environment variables on the first run. The following environment values are provided to customize Airflow:
The Airflow Worker instance can be customized by specifying environment variables on the first run. The following environment values are provided to customize Airflow Worker:
-`AIRFLOW_LDAP_URI`: LDAP server URI. No defaults.
-`AIRFLOW_LDAP_SEARCH`: LDAP search base. No defaults.
-`AIRFLOW_LDAP_BIND_USER`: LDAP user name. No defaults.
-`AIRFLOW_LDAP_BIND_PASSWORD`: LDAP user password. No defaults.
-`AIRFLOW_LDAP_UID_FIELD`: LDAP field used for uid. Default: **uid**.
-`AIRFLOW_LDAP_USE_TLS`: Use LDAP SSL. Defaults: **False**.
-`AIRFLOW_LDAP_ALLOW_SELF_SIGNED`: Allow self signed certicates in LDAP ssl. Default: **True**.
-`AIRFLOW_LDAP_TLS_CA_CERTIFICATE`: File that store the CA for LDAP ssl. No defaults.
-`AIRFLOW_USER_REGISTRATION_ROLE`: Role for the created user. Default: **Public**
> In addition to the previous environment variables, all the parameters from the configuration file can be overwritten by using environment variables with this format: `AIRFLOW__{SECTION}__{KEY}`. Note the double underscores.
> In addition to the previous environment variables, all the parameters from the configuration file can be overwritten by using environment variables with this format: `AIRFLOW__{SECTION}__{KEY}`. Note the double underscores.
- The size of the container image has been decreased.
- The size of the container image has been decreased.
- The configuration logic is now based on Bash scripts in the *rootfs/* folder.
- The configuration logic is now based on Bash scripts in the *rootfs/* folder.
# Contributing
# Contributing
We'd love for you to contribute to this container. You can request new features by creating an [issue](https://github.com/bitnami/bitnami-docker-airflow/issues), or submit a [pull request](https://github.com/bitnami/bitnami-docker-airflow/pulls) with your contribution.
We'd love for you to contribute to this container. You can request new features by creating an [issue](https://github.com/bitnami/bitnami-docker-airflow-worker/issues), or submit a [pull request](https://github.com/bitnami/bitnami-docker-airflow-worker/pulls) with your contribution.
# Issues
# Issues
If you encountered a problem running this container, you can file an [issue](https://github.com/bitnami/bitnami-docker-airflow/issues/new). For us to provide better support, be sure to include the following information in your issue:
If you encountered a problem running this container, you can file an [issue](https://github.com/bitnami/bitnami-docker-airflow-worker/issues/new). For us to provide better support, be sure to include the following information in your issue: