You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by po...@apache.org on 2021/08/28 16:11:59 UTC

[airflow] 02/06: Doc: Fix replacing Airflow version for Docker stack (#17711)

This is an automated email from the ASF dual-hosted git repository.

potiuk pushed a commit to branch v2-1-test
in repository https://gitbox.apache.org/repos/asf/airflow.git

commit 0f3cbb03134d3b4f5d77d909cd04def9be323622
Author: Kaxil Naik <ka...@gmail.com>
AuthorDate: Thu Aug 19 10:02:58 2021 +0100

    Doc: Fix replacing Airflow version for Docker stack (#17711)
    
    currently it shows up as:
    
    ```
    apache/airflow:|version| - the versioned Airflow image with default Python version (3.6 currently)
    ```
    
    Example: http://apache-airflow-docs.s3-website.eu-central-1.amazonaws.com/docs/docker-stack/index.html or even https://airflow.apache.org/docs/docker-stack/index.html
    
    This commit fixes it
    
    (cherry picked from commit 8cdda204e1a25eefbe5c9c05de8b62311c34e4e4)
---
 docs/conf.py                        |  1 +
 docs/docker-stack/build-arg-ref.rst | 78 ++++++++++++++++++-------------------
 docs/docker-stack/build.rst         |  2 +-
 docs/docker-stack/index.rst         | 10 ++---
 4 files changed, 46 insertions(+), 45 deletions(-)

diff --git a/docs/conf.py b/docs/conf.py
index fb5a884..975ed16 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -106,6 +106,7 @@ release = PACKAGE_VERSION
 
 rst_epilog = f"""
 .. |version| replace:: {version}
+.. |airflow-version| replace:: {airflow.__version__}
 """
 
 # -- General configuration -----------------------------------------------------
diff --git a/docs/docker-stack/build-arg-ref.rst b/docs/docker-stack/build-arg-ref.rst
index f2507e0..2175ef7 100644
--- a/docs/docker-stack/build-arg-ref.rst
+++ b/docs/docker-stack/build-arg-ref.rst
@@ -27,45 +27,45 @@ Basic arguments
 
 Those are the most common arguments that you use when you want to build a custom image.
 
-+------------------------------------------+------------------------------------------+------------------------------------------+
-| Build argument                           | Default value                            | Description                              |
-+==========================================+==========================================+==========================================+
-| ``PYTHON_BASE_IMAGE``                    | ``python:3.6-slim-buster``               | Base python image.                       |
-+------------------------------------------+------------------------------------------+------------------------------------------+
-| ``AIRFLOW_VERSION``                      | :subst-code:`|version|`                  | version of Airflow.                      |
-+------------------------------------------+------------------------------------------+------------------------------------------+
-| ``AIRFLOW_EXTRAS``                       | (see Dockerfile)                         | Default extras with which airflow is     |
-|                                          |                                          | installed.                               |
-+------------------------------------------+------------------------------------------+------------------------------------------+
-| ``ADDITIONAL_AIRFLOW_EXTRAS``            |                                          | Optional additional extras with which    |
-|                                          |                                          | airflow is installed.                    |
-+------------------------------------------+------------------------------------------+------------------------------------------+
-| ``AIRFLOW_HOME``                         | ``/opt/airflow``                         | Airflow’s HOME (that’s where logs and    |
-|                                          |                                          | SQLite databases are stored).            |
-+------------------------------------------+------------------------------------------+------------------------------------------+
-| ``AIRFLOW_USER_HOME_DIR``                | ``/home/airflow``                        | Home directory of the Airflow user.      |
-+------------------------------------------+------------------------------------------+------------------------------------------+
-| ``AIRFLOW_PIP_VERSION``                  | ``21.1``                                 | PIP version used.                        |
-+------------------------------------------+------------------------------------------+------------------------------------------+
-| ``PIP_PROGRESS_BAR``                     | ``on``                                   | Progress bar for PIP installation        |
-+------------------------------------------+------------------------------------------+------------------------------------------+
-| ``AIRFLOW_UID``                          | ``50000``                                | Airflow user UID.                        |
-+------------------------------------------+------------------------------------------+------------------------------------------+
-| ``AIRFLOW_GID``                          | ``50000``                                | Airflow group GID. Note that writable    |
-|                                          |                                          | files/dirs, created on behalf of airflow |
-|                                          |                                          | user are set to the ``root`` group (0)   |
-|                                          |                                          | to allow arbitrary UID to run the image. |
-+------------------------------------------+------------------------------------------+------------------------------------------+
-| ``AIRFLOW_CONSTRAINTS_REFERENCE``        |                                          | Reference (branch or tag) from GitHub    |
-|                                          |                                          | where constraints file is taken from     |
-|                                          |                                          | It can be ``constraints-main`` or        |
-|                                          |                                          | ``constraints-2-0`` for                  |
-|                                          |                                          | 2.0.* installation. In case of building  |
-|                                          |                                          | specific version you want to point it    |
-|                                          |                                          | to specific tag, for example             |
-|                                          |                                          | :subst-code:`constraints-|version|`.     |
-|                                          |                                          | Auto-detected if empty.                  |
-+------------------------------------------+------------------------------------------+------------------------------------------+
++------------------------------------------+------------------------------------------+---------------------------------------------+
+| Build argument                           | Default value                            | Description                                 |
++==========================================+==========================================+=============================================+
+| ``PYTHON_BASE_IMAGE``                    | ``python:3.6-slim-buster``               | Base python image.                          |
++------------------------------------------+------------------------------------------+---------------------------------------------+
+| ``AIRFLOW_VERSION``                      | :subst-code:`|airflow-version|`          | version of Airflow.                         |
++------------------------------------------+------------------------------------------+---------------------------------------------+
+| ``AIRFLOW_EXTRAS``                       | (see Dockerfile)                         | Default extras with which airflow is        |
+|                                          |                                          | installed.                                  |
++------------------------------------------+------------------------------------------+---------------------------------------------+
+| ``ADDITIONAL_AIRFLOW_EXTRAS``            |                                          | Optional additional extras with which       |
+|                                          |                                          | airflow is installed.                       |
++------------------------------------------+------------------------------------------+---------------------------------------------+
+| ``AIRFLOW_HOME``                         | ``/opt/airflow``                         | Airflow’s HOME (that’s where logs and       |
+|                                          |                                          | SQLite databases are stored).               |
++------------------------------------------+------------------------------------------+---------------------------------------------+
+| ``AIRFLOW_USER_HOME_DIR``                | ``/home/airflow``                        | Home directory of the Airflow user.         |
++------------------------------------------+------------------------------------------+---------------------------------------------+
+| ``AIRFLOW_PIP_VERSION``                  | ``21.1``                                 | PIP version used.                           |
++------------------------------------------+------------------------------------------+---------------------------------------------+
+| ``PIP_PROGRESS_BAR``                     | ``on``                                   | Progress bar for PIP installation           |
++------------------------------------------+------------------------------------------+---------------------------------------------+
+| ``AIRFLOW_UID``                          | ``50000``                                | Airflow user UID.                           |
++------------------------------------------+------------------------------------------+---------------------------------------------+
+| ``AIRFLOW_GID``                          | ``50000``                                | Airflow group GID. Note that writable       |
+|                                          |                                          | files/dirs, created on behalf of airflow    |
+|                                          |                                          | user are set to the ``root`` group (0)      |
+|                                          |                                          | to allow arbitrary UID to run the image.    |
++------------------------------------------+------------------------------------------+---------------------------------------------+
+| ``AIRFLOW_CONSTRAINTS_REFERENCE``        |                                          | Reference (branch or tag) from GitHub       |
+|                                          |                                          | where constraints file is taken from        |
+|                                          |                                          | It can be ``constraints-main`` or           |
+|                                          |                                          | ``constraints-2-0`` for                     |
+|                                          |                                          | 2.0.* installation. In case of building     |
+|                                          |                                          | specific version you want to point it       |
+|                                          |                                          | to specific tag, for example                |
+|                                          |                                          | :subst-code:`constraints-|airflow-version|`.|
+|                                          |                                          | Auto-detected if empty.                     |
++------------------------------------------+------------------------------------------+---------------------------------------------+
 
 Image optimization options
 ..........................
diff --git a/docs/docker-stack/build.rst b/docs/docker-stack/build.rst
index c469a35..f508b72 100644
--- a/docs/docker-stack/build.rst
+++ b/docs/docker-stack/build.rst
@@ -53,7 +53,7 @@ In the simplest case building your image consists of those steps:
 
 1) Create your own ``Dockerfile`` (name it ``Dockerfile``) where you add:
 
-* information what your image should be based on (for example ``FROM: apache/airflow:|version|-python3.8``
+* information what your image should be based on (for example ``FROM: apache/airflow:|airflow-version|-python3.8``
 
 * additional steps that should be executed in your image (typically in the form of ``RUN <command>``)
 
diff --git a/docs/docker-stack/index.rst b/docs/docker-stack/index.rst
index 46b39dc..96ce305 100644
--- a/docs/docker-stack/index.rst
+++ b/docs/docker-stack/index.rst
@@ -44,12 +44,12 @@ Every time a new version of Airflow is released, the images are prepared in the
 `apache/airflow DockerHub <https://hub.docker.com/r/apache/airflow>`_
 for all the supported Python versions.
 
-You can find the following images there (Assuming Airflow version |version|):
+You can find the following images there (Assuming Airflow version |airflow-version|):
 
-* ``apache/airflow:latest``              - the latest released Airflow image with default Python version (3.6 currently)
-* ``apache/airflow:latest-pythonX.Y``    - the latest released Airflow image with specific Python version
-* ``apache/airflow:|version|``           - the versioned Airflow image with default Python version (3.6 currently)
-* ``apache/airflow:|version|-pythonX.Y`` - the versioned Airflow image with specific Python version
+* :subst-code:`apache/airflow:latest`              - the latest released Airflow image with default Python version (3.6 currently)
+* :subst-code:`apache/airflow:latest-pythonX.Y`    - the latest released Airflow image with specific Python version
+* :subst-code:`apache/airflow:|airflow-version|`           - the versioned Airflow image with default Python version (3.6 currently)
+* :subst-code:`apache/airflow:|airflow-version|-pythonX.Y` - the versioned Airflow image with specific Python version
 
 Those are "reference" images. They contain the most common set of extras, dependencies and providers that are
 often used by the users and they are good to "try-things-out" when you want to just take airflow for a spin,