mirror of
https://github.com/bitnami/containers.git
synced 2026-03-15 06:48:04 +08:00
1.10.2-debian-9-r0 release
This commit is contained in:
42
bitnami/airflow-scheduler/1/debian-9/Dockerfile
Normal file
42
bitnami/airflow-scheduler/1/debian-9/Dockerfile
Normal file
@@ -0,0 +1,42 @@
|
||||
FROM bitnami/minideb-extras:stretch-r275
|
||||
LABEL maintainer "Bitnami <containers@bitnami.com>"
|
||||
|
||||
ENV BITNAMI_PKG_CHMOD="-R g+rwX" \
|
||||
HOME="/"
|
||||
|
||||
# Install required system packages and dependencies
|
||||
RUN install_packages libbsd0 libbz2-1.0 libc6 libcomerr2 libedit2 libffi6 libgcc1 libgssapi-krb5-2 libicu57 libk5crypto3 libkeyutils1 libkrb5-3 libkrb5support0 liblzma5 libmariadbclient18 libncurses5 libnss-wrapper libreadline7 libsasl2-2 libsqlite3-0 libssl1.1 libstdc++6 libtinfo5 libxml2 libxslt1.1 zlib1g
|
||||
RUN bitnami-pkg install python-3.6.8-0 --checksum 834c79bfd9ec99af3c72b4fc4e79f699d0c975067c0a40dd9ce35e2b9a6c5ee9
|
||||
RUN bitnami-pkg install postgresql-client-10.6.0-20 --checksum 566509fb3c817cae6bab80d678fe3ee991d04ef508cb7fae552aa4f811373da6
|
||||
RUN bitnami-pkg unpack airflow-scheduler-1.10.2-0 --checksum 5c23b425408a5dea001ef5b7f22a2343dd98510f34b24666f30a1464cd2527ca
|
||||
|
||||
COPY rootfs /
|
||||
ENV AIRFLOW_DATABASE_HOST="postgresql" \
|
||||
AIRFLOW_DATABASE_NAME="bitnami_airflow" \
|
||||
AIRFLOW_DATABASE_PASSWORD="bitnami1" \
|
||||
AIRFLOW_DATABASE_PORT_NUMBER="5432" \
|
||||
AIRFLOW_DATABASE_USERNAME="bn_airflow" \
|
||||
AIRFLOW_DATABASE_USE_SSL="no" \
|
||||
AIRFLOW_EXECUTOR="SequentialExecutor" \
|
||||
AIRFLOW_FERNET_KEY="" \
|
||||
AIRFLOW_HOME="/opt/bitnami/airflow" \
|
||||
AIRFLOW_LOAD_EXAMPLES="yes" \
|
||||
AIRFLOW_REDIS_USE_SSL="no" \
|
||||
AIRFLOW_WEBSERVER_HOST="airflow" \
|
||||
AIRFLOW_WEBSERVER_PORT_NUMBER="8080" \
|
||||
BITNAMI_APP_NAME="airflow-scheduler" \
|
||||
BITNAMI_IMAGE_VERSION="1.10.2-debian-9-r0" \
|
||||
LD_LIBRARY_PATH="/opt/bitnami/airflow/venv/lib/python3.6/site-packages/numpy/.libs/:$LD_LIBRARY_PATH" \
|
||||
LD_PRELOAD="/usr/lib/libnss_wrapper.so" \
|
||||
NAMI_PREFIX="/.nami" \
|
||||
NSS_WRAPPER_GROUP="/opt/bitnami/airflow/nss_group" \
|
||||
NSS_WRAPPER_PASSWD="/opt/bitnami/airflow/nss_passwd" \
|
||||
PATH="/opt/bitnami/python/bin:/opt/bitnami/postgresql/bin:/opt/bitnami/airflow-scheduler/bin:/opt/bitnami/airflow/venv/bin:$PATH" \
|
||||
REDIS_HOST="redis" \
|
||||
REDIS_PASSWORD="" \
|
||||
REDIS_PORT_NUMBER="6379" \
|
||||
REDIS_USER=""
|
||||
|
||||
USER 1001
|
||||
ENTRYPOINT [ "/app-entrypoint.sh" ]
|
||||
CMD [ "/run.sh" ]
|
||||
45
bitnami/airflow-scheduler/1/debian-9/docker-compose.yml
Normal file
45
bitnami/airflow-scheduler/1/debian-9/docker-compose.yml
Normal file
@@ -0,0 +1,45 @@
|
||||
version: '2'
|
||||
services:
|
||||
postgresql:
|
||||
image: bitnami/postgresql:latest
|
||||
volumes:
|
||||
- 'postgresql_data:/bitnami'
|
||||
environment:
|
||||
- POSTGRESQL_DATABASE=bitnami_airflow
|
||||
- POSTGRESQL_USERNAME=bn_airflow
|
||||
- POSTGRESQL_PASSWORD=bitnami1
|
||||
redis:
|
||||
image: bitnami/redis:latest
|
||||
volumes:
|
||||
- 'redis_data:/bitnami'
|
||||
environment:
|
||||
- ALLOW_EMPTY_PASSWORD=yes
|
||||
airflow-scheduler:
|
||||
image: bitnami/airflow-scheduler:1
|
||||
environment:
|
||||
- AIRFLOW_DATABASE_NAME=bitnami_airflow
|
||||
- AIRFLOW_DATABASE_USER=bn_airflow
|
||||
- AIRFLOW_DATABASE_PASSWORD=bitnami1
|
||||
- AIRFLOW_EXECUTOR=CeleryExecutor
|
||||
volumes:
|
||||
- airflow_scheduler_data:/bitnami
|
||||
airflow:
|
||||
image: bitnami/airflow:latest
|
||||
environment:
|
||||
- AIRFLOW_DATABASE_NAME=bitnami_airflow
|
||||
- AIRFLOW_DATABASE_USER=bn_airflow
|
||||
- AIRFLOW_DATABASE_PASSWORD=bitnami1
|
||||
- AIRFLOW_EXECUTOR=CeleryExecutor
|
||||
ports:
|
||||
- '8080:8080'
|
||||
volumes:
|
||||
- airflow_data:/bitnami
|
||||
volumes:
|
||||
airflow_scheduler_data:
|
||||
driver: local
|
||||
airflow_data:
|
||||
driver: local
|
||||
postgresql_data:
|
||||
driver: local
|
||||
redis_data:
|
||||
driver: local
|
||||
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"airflowWebserverHost": "{{$global.env.AIRFLOW_WEBSERVER_HOST}}",
|
||||
"airflowWebserverPort": "{{$global.env.AIRFLOW_WEBSERVER_PORT_NUMBER}}",
|
||||
"databaseName": "{{$global.env.AIRFLOW_DATABASE_NAME}}",
|
||||
"databaseServerHost": "{{$global.env.AIRFLOW_DATABASE_HOST}}",
|
||||
"databaseServerPort": "{{$global.env.AIRFLOW_DATABASE_PORT_NUMBER}}",
|
||||
"databaseUseSSL": "{{$global.env.AIRFLOW_DATABASE_USE_SSL}}",
|
||||
"databaseUser": "{{$global.env.AIRFLOW_DATABASE_USERNAME}}",
|
||||
"databaseUserPassword": "{{$global.env.AIRFLOW_DATABASE_PASSWORD}}",
|
||||
"executor": "{{$global.env.AIRFLOW_EXECUTOR}}",
|
||||
"fernetKey": "{{$global.env.AIRFLOW_FERNET_KEY}}",
|
||||
"loadExamples": "{{$global.env.AIRFLOW_LOAD_EXAMPLES}}",
|
||||
"redisHost": "{{$global.env.REDIS_HOST}}",
|
||||
"redisPassword": "{{$global.env.REDIS_PASSWORD}}",
|
||||
"redisPort": "{{$global.env.REDIS_PORT_NUMBER}}",
|
||||
"redisUseSSL": "{{$global.env.AIRFLOW_REDIS_USE_SSL}}",
|
||||
"redisUser": "{{$global.env.REDIS_USER}}"
|
||||
}
|
||||
21
bitnami/airflow-scheduler/1/debian-9/rootfs/app-entrypoint.sh
Executable file
21
bitnami/airflow-scheduler/1/debian-9/rootfs/app-entrypoint.sh
Executable file
@@ -0,0 +1,21 @@
|
||||
#!/bin/bash -e
|
||||
|
||||
. /opt/bitnami/base/functions
|
||||
. /opt/bitnami/base/helpers
|
||||
|
||||
print_welcome_page
|
||||
|
||||
if [[ "$1" == "nami" && "$2" == "start" ]] || [[ "$1" == "/run.sh" ]]; then
|
||||
if ! getent passwd "$(id -u)" &> /dev/null && [ -e /usr/lib/libnss_wrapper.so ]; then
|
||||
export LD_PRELOAD="/usr/lib/libnss_wrapper.so"
|
||||
export NSS_WRAPPER_PASSWD="/opt/bitnami/airflow/nss_passwd"
|
||||
export NSS_WRAPPER_GROUP="/opt/bitnami/airflow/nss_group"
|
||||
echo "airflow:x:$(id -u):$(id -g):Airflow:$AIRFLOW_HOME:/bin/false" > "$NSS_WRAPPER_PASSWD"
|
||||
echo "airflow:x:$(id -g):" > "$NSS_WRAPPER_GROUP"
|
||||
fi
|
||||
|
||||
nami_initialize airflow-scheduler
|
||||
info "Starting airflow-scheduler... "
|
||||
fi
|
||||
|
||||
exec tini -- "$@"
|
||||
17
bitnami/airflow-scheduler/1/debian-9/rootfs/run.sh
Executable file
17
bitnami/airflow-scheduler/1/debian-9/rootfs/run.sh
Executable file
@@ -0,0 +1,17 @@
|
||||
#!/bin/bash
|
||||
|
||||
. /opt/bitnami/base/functions
|
||||
. /opt/bitnami/base/helpers
|
||||
|
||||
USER=airflow
|
||||
DAEMON=airflow
|
||||
EXEC=$(which $DAEMON)
|
||||
START_COMMAND="${EXEC} scheduler | tee /opt/bitnami/airflow/logs/airflow-scheduler.log"
|
||||
|
||||
info "Starting ${DAEMON}..."
|
||||
# If container is started as `root` user
|
||||
if [ $EUID -eq 0 ]; then
|
||||
exec gosu ${USER} bash -c "${START_COMMAND}"
|
||||
else
|
||||
exec bash -c "${START_COMMAND}"
|
||||
fi
|
||||
451
bitnami/airflow-scheduler/README.md
Normal file
451
bitnami/airflow-scheduler/README.md
Normal file
@@ -0,0 +1,451 @@
|
||||
# What is Apache Airflow Scheduler?
|
||||
|
||||
> Airflow is a platform to programmatically author, schedule and monitor workflows. Airflow Scheduler is one of the required components when the CeleryExecutor is configured.
|
||||
|
||||
https://airflow.apache.org/
|
||||
|
||||
# TL;DR;
|
||||
|
||||
## Docker Compose
|
||||
|
||||
```bash
|
||||
$ curl -LO https://raw.githubusercontent.com/bitnami/bitnami-docker-airflow-scheduler/master/docker-compose.yml
|
||||
$ docker-compose up
|
||||
```
|
||||
|
||||
# Why use Bitnami Images?
|
||||
|
||||
* Bitnami closely tracks upstream source changes and promptly publishes new versions of this image using our automated systems.
|
||||
* With Bitnami images the latest bug fixes and features are available as soon as possible.
|
||||
* Bitnami containers, virtual machines and cloud images use the same components and configuration approach - making it easy to switch between formats based on your project needs.
|
||||
* All our images are based on [minideb](https://github.com/bitnami/minideb) a minimalist Debian based container image which gives you a small base container image and the familiarity of a leading linux distribution.
|
||||
* Bitnami container images are released daily with the latest distribution packages available.
|
||||
|
||||
|
||||
> This [CVE scan report](https://quay.io/repository/bitnami/airflow-scheduler?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
|
||||
|
||||
Learn more about the Bitnami tagging policy and the difference between rolling tags and immutable tags [in our documentation page](https://docs.bitnami.com/containers/how-to/understand-rolling-tags-containers/).
|
||||
|
||||
|
||||
* [`1-debian-9`, `1.10.2-debian-9-r0`, `1`, `1.10.2`, `1.10.2-r0`, `latest` (1/debian-9/Dockerfile)](https://github.com/bitnami/bitnami-docker-airflow-scheduler/blob/1.10.2-debian-9-r0/1/debian-9/Dockerfile)
|
||||
* [`1-ol-7`, `0.0.0-ol-7-r0` (1/ol-7/Dockerfile)](https://github.com/bitnami/bitnami-docker-airflow-scheduler/blob/0.0.0-ol-7-r0/1/ol-7/Dockerfile)
|
||||
|
||||
Subscribe to project updates by watching the [bitnami/airflow GitHub repo](https://github.com/bitnami/bitnami-docker-airflow-scheduler).
|
||||
|
||||
# Prerequisites
|
||||
|
||||
To run this application you need [Docker Engine](https://www.docker.com/products/docker-engine) >= `1.10.0`. [Docker Compose](https://www.docker.com/products/docker-compose) is recommended with a version `1.6.0` or later.
|
||||
|
||||
# How to use this image
|
||||
|
||||
Airflow Scheduler 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), one or more [Airflow Workers](https://www.github.com/bitnami/bitnami-docker-airflow-worker), a [PostgreSQL database](https://www.github.com/bitnami/bitnami-docker-postgresql) and a [Redis server](https://www.github.com/bitnami/bitnami-docker-redis).
|
||||
|
||||
## Using Docker Compose
|
||||
|
||||
The recommended way to run Airflow Scheduler is using Docker Compose using the following `docker-compose.yml` template:
|
||||
|
||||
```yaml
|
||||
version: '2'
|
||||
services:
|
||||
postgresql:
|
||||
image: 'bitnami/postgresql:latest'
|
||||
volumes:
|
||||
- 'postgresql_data:/bitnami'
|
||||
environment:
|
||||
- POSTGRESQL_DATABASE=bitnami_airflow
|
||||
- POSTGRESQL_USERNAME=bn_airflow
|
||||
- POSTGRESQL_PASSWORD=bitnami1
|
||||
redis:
|
||||
image: 'bitnami/redis:latest'
|
||||
volumes:
|
||||
- 'redis_data:/bitnami'
|
||||
environment:
|
||||
- ALLOW_EMPTY_PASSWORD=yes
|
||||
airflow-worker:
|
||||
image: bitnami/airflow-worker:latest
|
||||
environment:
|
||||
- AIRFLOW_FERNET_KEY=46BKJoQYlPPOexq0OhDZnIlNepKFf87WFwLbfzqDDho=
|
||||
- AIRFLOW_EXECUTOR=CeleryExecutor
|
||||
- AIRFLOW_DATABASE_NAME=bitnami_airflow
|
||||
- AIRFLOW_DATABASE_USER=bn_airflow
|
||||
- AIRFLOW_DATABASE_PASSWORD=bitnami1
|
||||
volumes:
|
||||
- airflow_worker_data:/bitnami
|
||||
airflow-scheduler:
|
||||
image: bitnami/airflow-scheduler:latest
|
||||
environment:
|
||||
- AIRFLOW_FERNET_KEY=46BKJoQYlPPOexq0OhDZnIlNepKFf87WFwLbfzqDDho=
|
||||
- AIRFLOW_EXECUTOR=CeleryExecutor
|
||||
- AIRFLOW_DATABASE_NAME=bitnami_airflow
|
||||
- AIRFLOW_DATABASE_USER=bn_airflow
|
||||
- AIRFLOW_DATABASE_PASSWORD=bitnami1
|
||||
- AIRFLOW_LOAD_EXAMPLES=yes
|
||||
volumes:
|
||||
- airflow_scheduler_data:/bitnami
|
||||
airflow:
|
||||
image: bitnami/airflow:latest
|
||||
environment:
|
||||
- AIRFLOW_FERNET_KEY=46BKJoQYlPPOexq0OhDZnIlNepKFf87WFwLbfzqDDho=
|
||||
- AIRFLOW_EXECUTOR=CeleryExecutor
|
||||
- AIRFLOW_DATABASE_NAME=bitnami_airflow
|
||||
- AIRFLOW_DATABASE_USER=bn_airflow
|
||||
- AIRFLOW_DATABASE_PASSWORD=bitnami1
|
||||
- AIRFLOW_PASSWORD=bitnami123
|
||||
- AIRFLOW_USERNAME=user
|
||||
- AIRFLOW_EMAIL=user@example.com
|
||||
ports:
|
||||
- '8080:8080'
|
||||
volumes:
|
||||
- airflow_data:/bitnami
|
||||
volumes:
|
||||
airflow_scheduler_data:
|
||||
driver: local
|
||||
airflow_worker_data:
|
||||
driver: local
|
||||
airflow_data:
|
||||
driver: local
|
||||
postgresql_data:
|
||||
driver: local
|
||||
redis_data:
|
||||
driver: local
|
||||
```
|
||||
|
||||
Launch the containers using:
|
||||
|
||||
```bash
|
||||
$ docker-compose up -d
|
||||
```
|
||||
|
||||
## Using the Docker Command Line
|
||||
|
||||
If you want to run the application manually instead of using `docker-compose`, these are the basic steps you need to run:
|
||||
|
||||
1. Create a network
|
||||
|
||||
```bash
|
||||
$ docker network create airflow-tier
|
||||
```
|
||||
|
||||
2. Create a volume for PostgreSQL persistence and create a PostgreSQL container
|
||||
|
||||
```bash
|
||||
$ docker volume create --name postgresql_data
|
||||
$ docker run -d --name postgresql \
|
||||
-e POSTGRESQL_USERNAME=bn_airflow \
|
||||
-e POSTGRESQL_PASSWORD=bitnami1 \
|
||||
-e POSTGRESQL_DATABASE=bitnami_airflow \
|
||||
--net airflow-tier \
|
||||
--volume postgresql_data:/bitnami \
|
||||
bitnami/postgresql:latest
|
||||
```
|
||||
|
||||
3. Create a volume for Redis persistence and create a Redis container
|
||||
|
||||
```bash
|
||||
$ docker volume create --name redis_data
|
||||
$ docker run -d --name redis \
|
||||
-e ALLOW_EMPTY_PASSWORD=yes \
|
||||
--net airflow-tier \
|
||||
--volume redis_data:/bitnami \
|
||||
bitnami/redis:latest
|
||||
```
|
||||
|
||||
4. Create volumes for Airflow persistence and launch the container
|
||||
|
||||
```bash
|
||||
$ docker volume create --name airflow_data
|
||||
$ docker run -d --name airflow -p 8080:8080 \
|
||||
-e AIRFLOW_FERNET_KEY=46BKJoQYlPPOexq0OhDZnIlNepKFf87WFwLbfzqDDho= \
|
||||
-e AIRFLOW_EXECUTOR=CeleryExecutor \
|
||||
-e AIRFLOW_DATABASE_NAME=bitnami_airflow \
|
||||
-e AIRFLOW_DATABASE_USER=bn_airflow \
|
||||
-e AIRFLOW_DATABASE_PASSWORD=bitnami1 \
|
||||
-e AIRFLOW_PASSWORD=bitnami123 \
|
||||
-e AIRFLOW_USERNAME=user \
|
||||
-e AIRFLOW_EMAIL=user@example.com \
|
||||
--net airflow-tier \
|
||||
--volume airflow_data:/bitnami \
|
||||
bitnami/airflow:latest
|
||||
```
|
||||
|
||||
5. Create volumes for Airflow Scheduler persistence and launch the container
|
||||
|
||||
```bash
|
||||
$ docker volume create --name airflow_scheduler_data
|
||||
$ docker run -d --name airflow-scheduler \
|
||||
-e AIRFLOW_FERNET_KEY=46BKJoQYlPPOexq0OhDZnIlNepKFf87WFwLbfzqDDho= \
|
||||
-e AIRFLOW_EXECUTOR=CeleryExecutor \
|
||||
-e AIRFLOW_DATABASE_NAME=bitnami_airflow \
|
||||
-e AIRFLOW_DATABASE_USER=bn_airflow \
|
||||
-e AIRFLOW_DATABASE_PASSWORD=bitnami1 \
|
||||
-e AIRFLOW_LOAD_EXAMPLES=yes \
|
||||
--net airflow-tier \
|
||||
--volume airflow_scheduler_data:/bitnami \
|
||||
bitnami/airflow-scheduler:latest
|
||||
```
|
||||
|
||||
6. Create volumes for Airflow Worker persistence and launch the container
|
||||
|
||||
```bash
|
||||
$ docker volume create --name airflow_worker_data
|
||||
$ docker run -d --name airflow-worker \
|
||||
-e AIRFLOW_FERNET_KEY=46BKJoQYlPPOexq0OhDZnIlNepKFf87WFwLbfzqDDho= \
|
||||
-e AIRFLOW_EXECUTOR=CeleryExecutor \
|
||||
-e AIRFLOW_DATABASE_NAME=bitnami_airflow \
|
||||
-e AIRFLOW_DATABASE_USER=bn_airflow \
|
||||
-e AIRFLOW_DATABASE_PASSWORD=bitnami1 \
|
||||
--net airflow-tier \
|
||||
--volume airflow_worker_data:/bitnami \
|
||||
bitnami/airflow-worker:latest
|
||||
```
|
||||
|
||||
Access your application at http://your-ip:8080
|
||||
|
||||
## Persisting your application
|
||||
|
||||
If you remove the container all your data and configurations will be lost, and the next time you run the image the database will be reinitialized. To avoid this loss of data, you should mount a volume that will persist even after the container is removed.
|
||||
|
||||
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 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 Scheduler 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.
|
||||
|
||||
### Mount host directories as data volumes with Docker Compose
|
||||
|
||||
The following `docker-compose.yml` template demonstrates the use of host directories as data volumes.
|
||||
|
||||
```yaml
|
||||
version: '2'
|
||||
services:
|
||||
postgresql:
|
||||
image: 'bitnami/postgresql:latest'
|
||||
environment:
|
||||
- POSTGRESQL_DATABASE=bitnami_airflow
|
||||
- POSTGRESQL_USERNAME=bn_airflow
|
||||
- POSTGRESQL_PASSWORD=bitnami1
|
||||
volumes:
|
||||
- /path/to/airflow-persistence:/bitnami
|
||||
redis:
|
||||
image: 'bitnami/redis:latest'
|
||||
environment:
|
||||
- ALLOW_EMPTY_PASSWORD=yes
|
||||
volumes:
|
||||
- /path/to/airflow-persistence:/bitnami
|
||||
airflow-worker:
|
||||
image: bitnami/airflow-worker:latest
|
||||
environment:
|
||||
- AIRFLOW_FERNET_KEY=46BKJoQYlPPOexq0OhDZnIlNepKFf87WFwLbfzqDDho=
|
||||
- AIRFLOW_EXECUTOR=CeleryExecutor
|
||||
- AIRFLOW_DATABASE_NAME=bitnami_airflow
|
||||
- AIRFLOW_DATABASE_USER=bn_airflow
|
||||
- AIRFLOW_DATABASE_PASSWORD=bitnami1
|
||||
volumes:
|
||||
- /path/to/airflow-persistence:/bitnami
|
||||
airflow-scheduler:
|
||||
image: bitnami/airflow-scheduler:latest
|
||||
environment:
|
||||
- AIRFLOW_FERNET_KEY=46BKJoQYlPPOexq0OhDZnIlNepKFf87WFwLbfzqDDho=
|
||||
- AIRFLOW_EXECUTOR=CeleryExecutor
|
||||
- AIRFLOW_DATABASE_NAME=bitnami_airflow
|
||||
- AIRFLOW_DATABASE_USER=bn_airflow
|
||||
- AIRFLOW_DATABASE_PASSWORD=bitnami1
|
||||
- AIRFLOW_LOAD_EXAMPLES=yes
|
||||
volumes:
|
||||
- /path/to/airflow-persistence:/bitnami
|
||||
airflow:
|
||||
image: bitnami/airflow:latest
|
||||
environment:
|
||||
- AIRFLOW_FERNET_KEY=46BKJoQYlPPOexq0OhDZnIlNepKFf87WFwLbfzqDDho=
|
||||
- AIRFLOW_EXECUTOR=CeleryExecutor
|
||||
- AIRFLOW_DATABASE_NAME=bitnami_airflow
|
||||
- AIRFLOW_DATABASE_USER=bn_airflow
|
||||
- AIRFLOW_DATABASE_PASSWORD=bitnami1
|
||||
- AIRFLOW_PASSWORD=bitnami123
|
||||
- AIRFLOW_USERNAME=user
|
||||
- AIRFLOW_EMAIL=user@example.com
|
||||
ports:
|
||||
- '8080:8080'
|
||||
volumes:
|
||||
- /path/to/airflow-persistence:/bitnami
|
||||
```
|
||||
|
||||
### Mount host directories as data volumes using the Docker command line
|
||||
|
||||
1. Create a network (if it does not exist)
|
||||
|
||||
```bash
|
||||
$ docker network create airflow-tier
|
||||
```
|
||||
|
||||
2. Create a volume for PostgreSQL persistence and create a PostgreSQL container
|
||||
|
||||
```bash
|
||||
$ docker volume create --name postgresql_data
|
||||
$ docker run -d --name postgresql \
|
||||
-e POSTGRESQL_USERNAME=bn_airflow \
|
||||
-e POSTGRESQL_PASSWORD=bitnami1 \
|
||||
-e POSTGRESQL_DATABASE=bitnami_airflow \
|
||||
--net airflow-tier \
|
||||
--volume /path/to/postgresql-persistence:/bitnami \
|
||||
bitnami/postgresql:latest
|
||||
```
|
||||
|
||||
3. Create a volume for Redis persistence and create a Redis container
|
||||
|
||||
```bash
|
||||
$ docker volume create --name redis_data
|
||||
$ docker run -d --name redis \
|
||||
-e ALLOW_EMPTY_PASSWORD=yes \
|
||||
--net airflow-tier \
|
||||
--volume /path/to/redis-persistence:/bitnami \
|
||||
bitnami/redis:latest
|
||||
```
|
||||
|
||||
4. Create volumes for Airflow persistence and launch the container
|
||||
|
||||
```bash
|
||||
$ docker volume create --name airflow_data
|
||||
$ docker run -d --name airflow -p 8080:8080 \
|
||||
-e AIRFLOW_FERNET_KEY=46BKJoQYlPPOexq0OhDZnIlNepKFf87WFwLbfzqDDho= \
|
||||
-e AIRFLOW_EXECUTOR=CeleryExecutor \
|
||||
-e AIRFLOW_DATABASE_NAME=bitnami_airflow \
|
||||
-e AIRFLOW_DATABASE_USER=bn_airflow \
|
||||
-e AIRFLOW_DATABASE_PASSWORD=bitnami1 \
|
||||
-e AIRFLOW_PASSWORD=bitnami123 \
|
||||
-e AIRFLOW_USERNAME=user \
|
||||
-e AIRFLOW_EMAIL=user@example.com \
|
||||
--net airflow-tier \
|
||||
--volume /path/to/airflow-persistence:/bitnami \
|
||||
bitnami/airflow:latest
|
||||
```
|
||||
|
||||
5. Create volumes for Airflow Scheduler persistence and launch the container
|
||||
|
||||
```bash
|
||||
$ docker volume create --name airflow_scheduler_data
|
||||
$ docker run -d --name airflow-scheduler \
|
||||
-e AIRFLOW_FERNET_KEY=46BKJoQYlPPOexq0OhDZnIlNepKFf87WFwLbfzqDDho= \
|
||||
-e AIRFLOW_EXECUTOR=CeleryExecutor \
|
||||
-e AIRFLOW_DATABASE_NAME=bitnami_airflow \
|
||||
-e AIRFLOW_DATABASE_USER=bn_airflow \
|
||||
-e AIRFLOW_DATABASE_PASSWORD=bitnami1 \
|
||||
-e AIRFLOW_LOAD_EXAMPLES=yes \
|
||||
--net airflow-tier \
|
||||
--volume /path/to/airflow-scheduler-persistence:/bitnami \
|
||||
bitnami/airflow-scheduler:latest
|
||||
```
|
||||
|
||||
6. Create volumes for Airflow Worker persistence and launch the container
|
||||
|
||||
```bash
|
||||
$ docker volume create --name airflow_worker_data
|
||||
$ docker run -d --name airflow-worker \
|
||||
-e AIRFLOW_FERNET_KEY=46BKJoQYlPPOexq0OhDZnIlNepKFf87WFwLbfzqDDho= \
|
||||
-e AIRFLOW_EXECUTOR=CeleryExecutor \
|
||||
-e AIRFLOW_DATABASE_NAME=bitnami_airflow \
|
||||
-e AIRFLOW_DATABASE_USER=bn_airflow \
|
||||
-e AIRFLOW_DATABASE_PASSWORD=bitnami1 \
|
||||
--net airflow-tier \
|
||||
--volume /path/to/airflow-worker-persistence:/bitnami \
|
||||
bitnami/airflow-worker:latest
|
||||
```
|
||||
|
||||
# Configuration
|
||||
|
||||
## Environment variables
|
||||
|
||||
The Airflow Scheduler instance can be customized by specifying environment variables on the first run. The following environment values are provided to customize Airflow Scheduler:
|
||||
|
||||
##### Airflow Scheduler configuration
|
||||
|
||||
- `AIRFLOW_EXECUTOR`: Airflow Scheduler executor. Default: **SequentialExecutor**
|
||||
- `AIRFLOW_FERNET_KEY`: Airflow Scheduler Fernet key. No defaults
|
||||
- `AIRFLOW_WEBSERVER_HOST`: Airflow Scheduler webserver host. Default: **127.0.0.1**
|
||||
- `AIRFLOW_WEBSERVER_PORT_NUMBER`: Airflow Scheduler webserver port. Default: **8080**
|
||||
- `AIRFLOW_LOAD_EXAMPLES`: To load example tasks into the application. Default: **yes**
|
||||
|
||||
##### Use an existing database
|
||||
|
||||
- `AIRFLOW_DATABASE_HOST`: Hostname for PostgreSQL server. Default: **postgresql**
|
||||
- `AIRFLOW_DATABASE_PORT_NUMBER`: Port used by PostgreSQL server. Default: **5432**
|
||||
- `AIRFLOW_DATABASE_NAME`: Database name that Airflow Scheduler will use to connect with the database. Default: **bitnami_airflow**
|
||||
- `AIRFLOW_DATABASE_USERNAME`: Database user that Airflow Scheduler will use to connect with the database. Default: **bn_airflow**
|
||||
- `AIRFLOW_DATABASE_PASSWORD`: Database password that Airflow Scheduler will use to connect with the database. No defaults.
|
||||
- `AIRFLOW_DATABASE_USE_SSL`: Set to yes if the database uses SSL. Default: **no**
|
||||
- `AIRFLOW_REDIS_USE_SSL`: Set to yes if Redis uses SSL. Default: **no**
|
||||
- `REDIS_HOST`: Hostname for Redis server. Default: **redis**
|
||||
- `REDIS_PORT_NUMBER`: Port used by Redis server. Default: **6379**
|
||||
- `REDIS_USER`: USER that Airflow Scheduler will use to connect with Redis. No defaults.
|
||||
- `REDIS_PASSWORD`: Password that Airflow Scheduler will use to connect with Redis. No defaults.
|
||||
|
||||
> 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.
|
||||
|
||||
### Specifying Environment variables using Docker Compose
|
||||
|
||||
```yaml
|
||||
version: '2'
|
||||
|
||||
services:
|
||||
airflow:
|
||||
image: bitnami/airflow:1
|
||||
environment:
|
||||
- AIRFLOW_FERNET_KEY=46BKJoQYlPPOexq0OhDZnIlNepKFf87WFwLbfzqDDho=
|
||||
- AIRFLOW_EXECUTOR=CeleryExecutor
|
||||
- AIRFLOW_DATABASE_NAME=bitnami_airflow
|
||||
- AIRFLOW_DATABASE_USER=bn_airflow
|
||||
- AIRFLOW_DATABASE_PASSWORD=bitnami1
|
||||
- AIRFLOW_PASSWORD=bitnami123
|
||||
- AIRFLOW_USERNAME=user
|
||||
- AIRFLOW_EMAIL=user@example.com
|
||||
```
|
||||
|
||||
### Specifying Environment variables on the Docker command line
|
||||
|
||||
```bash
|
||||
$ docker run -d --name airflow -p 8080:8080 \
|
||||
-e AIRFLOW_FERNET_KEY=46BKJoQYlPPOexq0OhDZnIlNepKFf87WFwLbfzqDDho= \
|
||||
-e AIRFLOW_EXECUTOR=CeleryExecutor \
|
||||
-e AIRFLOW_DATABASE_NAME=bitnami_airflow \
|
||||
-e AIRFLOW_DATABASE_USER=bn_airflow \
|
||||
-e AIRFLOW_DATABASE_PASSWORD=bitnami1 \
|
||||
-e AIRFLOW_PASSWORD=bitnami123 \
|
||||
-e AIRFLOW_USERNAME=user \
|
||||
-e AIRFLOW_EMAIL=user@example.com \
|
||||
--volume airflow_data:/bitnami \
|
||||
bitnami/airflow:latest
|
||||
```
|
||||
|
||||
# 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-scheduler/issues), or submit a [pull request](https://github.com/bitnami/bitnami-docker-airflow-scheduler/pulls) with your contribution.
|
||||
|
||||
# Issues
|
||||
|
||||
If you encountered a problem running this container, you can file an [issue](https://github.com/bitnami/bitnami-docker-airflow-scheduler/issues). For us to provide better support, be sure to include the following information in your issue:
|
||||
|
||||
- Host OS and version
|
||||
- Docker version (`$ docker version`)
|
||||
- Output of `$ docker info`
|
||||
- Version of this container (`$ echo $BITNAMI_IMAGE_VERSION` inside the container)
|
||||
- The command you used to run the container, and any relevant output you saw (masking any sensitive information)
|
||||
|
||||
# License
|
||||
|
||||
Copyright 2015-2019 Bitnami
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
<http://www.apache.org/licenses/LICENSE-2.0>
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
48
bitnami/airflow-scheduler/circle.yml
Normal file
48
bitnami/airflow-scheduler/circle.yml
Normal file
@@ -0,0 +1,48 @@
|
||||
version: 2
|
||||
jobs:
|
||||
build:
|
||||
working_directory: /workdir
|
||||
docker:
|
||||
- image: docker:17.06.0-ce-git
|
||||
environment:
|
||||
RELEASE_SERIES_LIST: "1"
|
||||
LATEST_STABLE: "1"
|
||||
DISTRIBUTIONS_LIST: "debian-9,ol-7"
|
||||
IMAGE_NAME: airflow-scheduler
|
||||
DOCKER_PROJECT: bitnami
|
||||
QUAY_PROJECT: bitnami
|
||||
GCLOUD_PROJECT: bitnami-containers
|
||||
AZURE_PROJECT: bitnami
|
||||
|
||||
steps:
|
||||
- checkout
|
||||
- setup_remote_docker:
|
||||
version: 17.06.0-ce
|
||||
- run:
|
||||
name: Upgrade system packages (workaround - https://github.com/docker-library/docker/issues/72)
|
||||
command: |
|
||||
apk upgrade --no-cache
|
||||
- run:
|
||||
name: Install dependencies
|
||||
command: |
|
||||
apk add --no-cache curl bash coreutils
|
||||
- run:
|
||||
name: Docker info
|
||||
command: |
|
||||
docker version
|
||||
docker info
|
||||
- deploy:
|
||||
name: Publish docker image
|
||||
command: |
|
||||
if [ -n "${CIRCLE_TAG}" ]; then
|
||||
curl -sL https://raw.githubusercontent.com/bitnami/test-infra/master/circle/docker-release-image.sh | bash -
|
||||
fi
|
||||
|
||||
workflows:
|
||||
version: 2
|
||||
build-and-deploy:
|
||||
jobs:
|
||||
- build:
|
||||
filters:
|
||||
tags:
|
||||
only: /^.*(?<!-rhel-7)-r[0-9]+$/
|
||||
Reference in New Issue
Block a user