Add airflow one click app (#704)
* Add Airflow as one click app - All using bitnami's docker images - Most environment variables supported - Alll it needs is the app name and it will work - All services have passwords, all of them autogenerated on build - only the webserver is exposed as webapp * Add airflow logo * Run prettier on airflow.yml * remove explicit port definition on capp_appname service
This commit is contained in:
parent
bd28102aba
commit
217592aa18
|
|
@ -0,0 +1,216 @@
|
|||
captainVersion: 4
|
||||
caproverOneClickApp:
|
||||
instructions:
|
||||
start: |-
|
||||
Apache Airflow is a tool to express and execute workflows as directed acyclic graphs (DAGs).
|
||||
It includes utilities to schedule tasks, monitor task progress and handle task dependencies.
|
||||
This instance uses the Bitnami images
|
||||
end: >
|
||||
Airflow is deployed is deployed, it might take few moments before it's fully started.
|
||||
Initial user is: $$cap_airflow_user with password $$cap_airflow_password.
|
||||
Login on $$cap_appname.$$cap_root_domain after $$cap_appname has finished starting.
|
||||
|
||||
displayName: Airflow
|
||||
isOfficial: false
|
||||
description: A tool to express and execute workflows as directed acyclic graphs (DAGs).
|
||||
documentation: |-
|
||||
Based on https://github.com/bitnami/bitnami-docker-airflow#readme
|
||||
|
||||
variables:
|
||||
# Postgress
|
||||
- id: $$cap_postgresql_version
|
||||
label: Bitnami's Posgresql Version
|
||||
defaultValue: '12.12.0'
|
||||
description: Check the tag version on https://hub.docker.com/r/bitnami/postgresql
|
||||
- id: $$cap_postgresql_name
|
||||
label: Postresql database name
|
||||
defaultValue: airflow_db
|
||||
description: Name of the postgresql db
|
||||
- id: $$cap_postgresql_user
|
||||
label: Postresql database user
|
||||
defaultValue: airflow_db_user
|
||||
description: Password to the postgresql db
|
||||
- id: $$cap_postgresql_password
|
||||
label: Postresql password
|
||||
defaultValue: $$cap_gen_random_hex(16)
|
||||
description: Password to the postgresql db
|
||||
# Redis
|
||||
- id: $$cap_redis_version
|
||||
label: Bitnami's redis Version
|
||||
defaultValue: '7.0.4'
|
||||
description: Check the tag version on https://hub.docker.com/r/bitnami/redis
|
||||
- id: $$cap_redis_password
|
||||
label: Redis password
|
||||
defaultValue: $$cap_gen_random_hex(16)
|
||||
description: Password to redis db
|
||||
# Airflow
|
||||
- id: $$cap_airflow_version
|
||||
label: Bitnami's airflow Version
|
||||
defaultValue: '2.3.3'
|
||||
description: Check the tag version on https://hub.docker.com/r/bitnami/airflow
|
||||
- id: $$cap_airflow_worker_version
|
||||
label: Bitnami's airflow worker Version
|
||||
defaultValue: '2.3.3'
|
||||
description: Check the tag version on https://hub.docker.com/r/bitnami/airflow-worker
|
||||
- id: $$cap_airflow_scheduler_version
|
||||
label: Bitnami's airflow scheduler Version
|
||||
defaultValue: '2.3.3'
|
||||
description: Check the tag version on https://hub.docker.com/r/bitnami/airflow-scheduler
|
||||
- id: $$cap_airflow_user
|
||||
label: Airflow user
|
||||
defaultValue: 'airflow_user'
|
||||
description: Airflow's Admin user name
|
||||
- id: $$cap_airflow_password
|
||||
label: Airflow password
|
||||
defaultValue: $$cap_gen_random_hex(16)
|
||||
description: Airflow Admin's password
|
||||
- id: $$cap_airflow_email
|
||||
label: Airflow email
|
||||
description: Email address that will receive notifications from airflow (need SMPT details)
|
||||
- id: $$cap_airflow_examples
|
||||
label: Load Airflow DAG Examples?
|
||||
defaultValue: 'no'
|
||||
description: Wheter to load or not load sample DAGs (yes/no)
|
||||
- id: $$cap_airflow_secret_key
|
||||
label: Airflow Secret Key
|
||||
defaultValue: $$cap_gen_random_hex(16)
|
||||
description: Secret key used to run your flask app. It should be as random as possible.
|
||||
- id: $$cap_airflow_dag_path
|
||||
label: DAGs Volume
|
||||
defaultValue: airflow-dags
|
||||
description: Name of the DAG volume or Path to the custom DAGs folder, make sure the folder is accesible
|
||||
- id: $$cap_airflow_py_requirements
|
||||
label: Path or volume to a requirements.txt file
|
||||
defaultValue: airflow-requstxt
|
||||
description: Installation of additional python modules at start-up time, make sure the file is accesible
|
||||
# SMTP datails
|
||||
- id: $$cap_smtp_host
|
||||
label: SMTP Host
|
||||
description: Host for SMPT connection
|
||||
- id: $$cap_smtp_port
|
||||
label: SMTP Port
|
||||
description: Port for SMPT connection
|
||||
- id: $$cap_smtp_starttls
|
||||
label: Use startTLS?
|
||||
defaultValue: 'no'
|
||||
description: Do you want to use startTLS? (yes/no)
|
||||
- id: $$cap_smtp_ssl
|
||||
label: Use SSL?
|
||||
defaultValue: 'no'
|
||||
description: Check the tag version on https://hub.docker.com/r/bitnami/airflow-scheduler
|
||||
- id: $$cap_smtp_user
|
||||
label: SMTP User
|
||||
description: Check the tag version on https://hub.docker.com/r/bitnami/airflow-scheduler
|
||||
- id: $$cap_smtp_password
|
||||
label: SMTP Password
|
||||
description: Check the tag version on https://hub.docker.com/r/bitnami/airflow-scheduler
|
||||
- id: $$cap_smtp_mail_from
|
||||
label: Mail from address
|
||||
description: Specofy who the email is from
|
||||
|
||||
services:
|
||||
$$cap_appname-db:
|
||||
restart: always
|
||||
image: 'bitnami/postgresql:$$cap_postgresql_version'
|
||||
user:
|
||||
environment:
|
||||
POSTGRESQL_DATABASE: $$cap_postgresql_name
|
||||
POSTGRESQL_USERNAME: $$cap_postgresql_user
|
||||
POSTGRESQL_PASSWORD: $$cap_postgresql_password
|
||||
volumes:
|
||||
- $$cap_appname-postgresql-persistance:/bitnami
|
||||
caproverExtra:
|
||||
notExposeAsWebApp: true
|
||||
|
||||
$$cap_appname-redis:
|
||||
restart: always
|
||||
image: 'bitnami/redis:$$cap_redis_version'
|
||||
user:
|
||||
environment:
|
||||
REDIS_PASSWORD: $$cap_redis_password
|
||||
volumes:
|
||||
- $$cap_appname-redis-persistance:/bitnami
|
||||
caproverExtra:
|
||||
notExposeAsWebApp: true
|
||||
|
||||
$$cap_appname:
|
||||
restart: always
|
||||
depends_on:
|
||||
- $$cap_appname-db
|
||||
- $$cap_appname-redis
|
||||
image: 'bitnami/airflow:$$cap_airflow_version'
|
||||
user:
|
||||
environment:
|
||||
AIRFLOW_EXECUTOR: CeleryExecutor
|
||||
AIRFLOW_DATABASE_HOST: srv-captain--$$cap_appname-db
|
||||
AIRFLOW_DATABASE_NAME: $$cap_postgresql_name
|
||||
AIRFLOW_DATABASE_USERNAME: $$cap_postgresql_user
|
||||
AIRFLOW_DATABASE_PASSWORD: $$cap_postgresql_password
|
||||
REDIS_HOST: srv-captain--$$cap_appname-redis
|
||||
REDIS_PASSWORD: $$cap_redis_password
|
||||
AIRFLOW_WEBSERVER_HOST: srv-captain--$$cap_appname
|
||||
AIRFLOW_BASE_URL: https://$$cap_appname.$$cap_root_domain/
|
||||
AIRFLOW_SECRET_KEY: $$cap_airflow_secret_key
|
||||
AIRFLOW_LOAD_EXAMPLES: $$cap_airflow_examples
|
||||
AIRFLOW_USERNAME: $$cap_airflow_user
|
||||
AIRFLOW_PASSWORD: $$cap_airflow_password
|
||||
AIRFLOW_EMAIL: $$cap_airflow_email
|
||||
AIRFLOW__SMTP__SMTP_HOST: $$cap_smtp_host
|
||||
AIRFLOW__SMTP__SMTP_PORT: $$cap_smtp_port
|
||||
AIRFLOW__SMTP__SMTP_STARTTLS: $$cap_smtp_starttls
|
||||
AIRFLOW__SMTP__SMTP_SSL: $$cap_smtp_ssl
|
||||
AIRFLOW__SMTP__SMTP_USER: $$cap_smtp_user
|
||||
AIRFLOW__SMTP__SMTP_PASSWORD: $$cap_smtp_password
|
||||
AIRFLOW__SMTP__SMTP_MAIL_FROM: $$cap_smtp_mail_from
|
||||
volumes:
|
||||
- $$cap_airflow_dag_path:/opt/bitnami/airflow/dags
|
||||
- $$cap_airflow_py_requirements:/bitnami/python/requirements.txt
|
||||
caproverExtra:
|
||||
containerHttpPort: '8080'
|
||||
|
||||
$$cap_appname-worker:
|
||||
image: bitnami/airflow-worker:$$cap_airflow_worker_version
|
||||
depends_on:
|
||||
- $$cap_appname
|
||||
environment:
|
||||
AIRFLOW_EXECUTOR: CeleryExecutor
|
||||
AIRFLOW_DATABASE_HOST: srv-captain--$$cap_appname-db
|
||||
AIRFLOW_DATABASE_NAME: $$cap_postgresql_name
|
||||
AIRFLOW_DATABASE_USERNAME: $$cap_postgresql_user
|
||||
AIRFLOW_DATABASE_PASSWORD: $$cap_postgresql_password
|
||||
REDIS_HOST: srv-captain--$$cap_appname-redis
|
||||
REDIS_PASSWORD: $$cap_redis_password
|
||||
AIRFLOW_WEBSERVER_HOST: srv-captain--$$cap_appname
|
||||
AIRFLOW_BASE_URL: https://$$cap_appname.$$cap_root_domain/
|
||||
AIRFLOW_SECRET_KEY: $$cap_airflow_secret_key
|
||||
AIRFLOW_LOAD_EXAMPLES: $$cap_airflow_examples
|
||||
volumes:
|
||||
- $$cap_appname-data:/opt/bitnami/airflow/data
|
||||
- $$cap_airflow_dag_path:/opt/bitnami/airflow/dags
|
||||
- $$cap_airflow_py_requirements:/bitnami/python/requirements.txt
|
||||
caproverExtra:
|
||||
notExposeAsWebApp: true
|
||||
|
||||
$$cap_appname-scheduler:
|
||||
restart: always
|
||||
depends_on:
|
||||
- $$cap_appname
|
||||
image: 'bitnami/airflow-scheduler:$$cap_airflow_scheduler_version'
|
||||
user:
|
||||
environment:
|
||||
AIRFLOW_EXECUTOR: CeleryExecutor
|
||||
AIRFLOW_DATABASE_HOST: srv-captain--$$cap_appname-db
|
||||
AIRFLOW_DATABASE_NAME: $$cap_postgresql_name
|
||||
AIRFLOW_DATABASE_USERNAME: $$cap_postgresql_user
|
||||
AIRFLOW_DATABASE_PASSWORD: $$cap_postgresql_password
|
||||
REDIS_HOST: srv-captain--$$cap_appname-redis
|
||||
REDIS_PASSWORD: $$cap_redis_password
|
||||
AIRFLOW_WEBSERVER_HOST: srv-captain--$$cap_appname
|
||||
AIRFLOW_BASE_URL: https://$$cap_appname.$$cap_root_domain/
|
||||
AIRFLOW_SECRET_KEY: $$cap_airflow_secret_key
|
||||
AIRFLOW_LOAD_EXAMPLES: $$cap_airflow_examples
|
||||
volumes:
|
||||
- $$cap_airflow_dag_path:/opt/bitnami/airflow/dags
|
||||
- $$cap_airflow_py_requirements:/bitnami/python/requirements.txt
|
||||
caproverExtra:
|
||||
notExposeAsWebApp: true
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 62 KiB |
Loading…
Reference in New Issue