summaryrefslogtreecommitdiffhomepage
path: root/public/v4/apps/airflow.yml
blob: 75fc43b59fc0ff767c29624e9738be47203e3560 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
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