Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use puckel/docker-airflow image #14

Merged
merged 18 commits into from
Mar 2, 2018
Merged

Use puckel/docker-airflow image #14

merged 18 commits into from
Mar 2, 2018

Conversation

jpds
Copy link

@jpds jpds commented Feb 21, 2018

Use puckel/docker-airflow image, allows everything to be configured via environment variables and deploy redis too.

bootstrap.sh: |
#!/usr/bin/env bash

cp -fv /usr/local/airflow-cm/airflow.cfg /usr/local/airflow/airflow.cfg
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why have you removed it? Did you found a way to specify the cfg file without this kung foo?

@gsemet
Copy link
Owner

gsemet commented Feb 21, 2018

won't accept this patch sorry. Why do you get rid of the custom configuration file?

@jpds
Copy link
Author

jpds commented Feb 21, 2018

Because all of Airflow can be configured through environment variables instead: https://airflow.apache.org/configuration.html

You can also set options with environment variables by using this format: $AIRFLOW__{SECTION}__{KEY}

I'll look into adding a option in the values so that envs can be dynamically set.

@jpds
Copy link
Author

jpds commented Feb 21, 2018

Added airflow.config to values.yaml, which let's one do:

-  config: {}
+  config:
+    AIRFLOW__CORE__SQL_ALCHEMY_CONN: my_conn_string

Which results in:

$ helm install --namespace testing-airflow ./airflow  --debug --dry-run
...
          env:
            - name: POSTGRES_HOST
              value: ...
            ...
            - name: AIRFLOW__CORE__SQL_ALCHEMY_CONN
              value: my_conn_string

I'm not sure if we need to split out variables between the different services, though this will be easy.

command: ["bash", "/usr/local/airflow-cm/bootstrap.sh"]
{{- end }}
protocol: TCP
env:
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe we can put all these env var in a configmap ?

@gsemet
Copy link
Owner

gsemet commented Feb 21, 2018

ok, this anwser suits me. I actually prefer to configure using environment variable. Can you add a few words on this feature on the main README?

For the configmap, I prefere using them for readability sake, but their update do not trigger a new deployment without some hacks. What is you opinion on it?

@@ -21,9 +14,10 @@ airflow:
# set the max number of retries during container initialization
init_retry_loop:
# base image for webserver/scheduler/workers
image: mumoshu/kube-airflow:1.8.0.0-1.6.1
image: puckel/docker-airflow
imageTag: 1.9.0
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note: we need to use a more recent version of airflow to support mount in subpath (apache/airflow#2952). Since airflow 2.0 is not released yet, we are stuck with custom build for this feature. Until then, only root path is supported.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I wasn't aware of custom features in the other docker image build.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't worry, I'll document the limitations.
Also, I think we should, at one point, move to the official helm repository. I'll be glad if you can help me on this :)

@jpds
Copy link
Author

jpds commented Feb 22, 2018

ok, this anwser suits me. I actually prefer to configure using environment variable. Can you add a few words on this feature on the main README?

Will do.

For the configmap, I prefere using them for readability sake, but their update do not trigger a new deployment without some hacks. What is you opinion on it?

I have come across a few charts that have this issue. They don't usually leverage the feature at:

But the helm upgrade command has a --recreate-pods option to force it.

@gsemet
Copy link
Owner

gsemet commented Feb 22, 2018

I like this annotation trick!

@gsemet gsemet merged commit 74059f2 into gsemet:helm_chart Mar 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants