Skip to content

Commit

Permalink
Update docs about baking DAGs in docker image (#14648)
Browse files Browse the repository at this point in the history
Co-authored-by: Kamil Breguła <[email protected]>
  • Loading branch information
mik-laj and mik-laj authored Mar 7, 2021
1 parent a152f80 commit 6d087fb
Showing 1 changed file with 31 additions and 3 deletions.
34 changes: 31 additions & 3 deletions docs/helm-chart/manage-dags-files.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,48 @@
Manage DAGs files
=================

When you create new or modify existing DAG files, it is necessary to implement them into the environment. This section will describe some basic techniques you can use.
When you create new or modify existing DAG files, it is necessary to deploy them into the environment. This section will describe some basic techniques you can use.

Bake DAGs in Docker image
-------------------------

The recommended way to update your DAGs with this chart is to build a new docker image with the latest DAG code (``docker build -t my-company/airflow:8a0da78 . ``), push it to an accessible registry ```docker push my-company/airflow:8a0da78``), then update the Airflow pods with that image:
The recommended way to update your DAGs with this chart is to build a new docker image with the latest DAG code:

.. code-block:: bash
docker build --tag "my-company/airflow:8a0da78" . -f - <<EOF
FROM apache/airflow:2.0.1
USER root
COPY --chown=airflow:root ./dags/ \${AIRFLOW_HOME}/dags/
USER airflow
EOF
Then publish it in the accessible registry:
.. code-block:: bash
docker push my-company/airflow:8a0da78
Finally, update the Airflow pods with that image:
.. code-block:: bash
helm upgrade airflow . \
--set images.airflow.repository=my-company/airflow \
--set images.airflow.tag=8a0da78
For local development purpose you can also build the image locally and use it via deployment method described by Breeze.
If you are deploying an image with a constant tag, you need to make sure that the image is pulled every time.
.. code-block:: bash
helm upgrade airflow . \
--set images.airflow.repository=my-company/airflow \
--set images.airflow.tag=8a0da78 \
--set images.airflow.pullPolicy=Always
Mounting DAGs using Git-Sync sidecar with Persistence enabled
-------------------------------------------------------------
Expand Down

0 comments on commit 6d087fb

Please sign in to comment.