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

potiuk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/master by this push:
     new 4a46f43  Allows to build production images for 1.10.2 and 1.10.1 
Airflow (#10983)
4a46f43 is described below

commit 4a46f4368b948403fee1c360aee802234ce35908
Author: Jarek Potiuk <[email protected]>
AuthorDate: Thu Sep 17 14:25:34 2020 +0200

    Allows to build production images for 1.10.2 and 1.10.1 Airflow (#10983)
    
    Airflow below 1.10.2 required SLUGIFY_USES_TEXT_UNIDECODE env
    variable to be set to yes.
    
    Our production Dockerfile and Breeze supports building images
    for any version of airflow >= 1.10.1 but it failed on
    1.10.2 and 1.10.1 because this variable was not set.
    
    You can now set the variable when building image manually
    and Breeze does it automatically if image is 1.10.1 or 1.10.2
    
    Fixes #10974
---
 Dockerfile                            | 3 +++
 IMAGES.rst                            | 4 ++++
 scripts/ci/libraries/_build_images.sh | 5 +++++
 3 files changed, 12 insertions(+)

diff --git a/Dockerfile b/Dockerfile
index 6dd1680..462ddef 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -191,6 +191,9 @@ ENV AIRFLOW_INSTALL_SOURCES=${AIRFLOW_INSTALL_SOURCES}
 ARG AIRFLOW_INSTALL_VERSION=""
 ENV AIRFLOW_INSTALL_VERSION=${AIRFLOW_INSTALL_VERSION}
 
+ARG SLUGIFY_USES_TEXT_UNIDECODE=""
+ENV SLUGIFY_USES_TEXT_UNIDECODE=${SLUGIFY_USES_TEXT_UNIDECODE}
+
 WORKDIR /opt/airflow
 
 RUN pip install --user 
"${AIRFLOW_INSTALL_SOURCES}[${AIRFLOW_EXTRAS}]${AIRFLOW_INSTALL_VERSION}" \
diff --git a/IMAGES.rst b/IMAGES.rst
index 4992ab7..ae47255 100644
--- a/IMAGES.rst
+++ b/IMAGES.rst
@@ -458,6 +458,10 @@ production image. There are three types of build:
 |                                   | point to specific varsion         |
 |                                   | ``constraints-1.10.12             |
 +-----------------------------------+-----------------------------------+
+| ``SLUGIFY_USES_TEXT_UNIDECODE``   | In case of of installing airflow  |
+|                                   | 1.10.2 or 1.10.1 you need to      |
+|                                   | set this arg to ``yes``.          |
++-----------------------------------+-----------------------------------+
 | ``AIRFLOW_WWW``                   | In case of Airflow 2.0 it should  |
 |                                   | be "www", in case of Airflow 1.10 |
 |                                   | series it should be "www_rbac".   |
diff --git a/scripts/ci/libraries/_build_images.sh 
b/scripts/ci/libraries/_build_images.sh
index 2af46fc..29a41aa 100644
--- a/scripts/ci/libraries/_build_images.sh
+++ b/scripts/ci/libraries/_build_images.sh
@@ -596,6 +596,11 @@ function build_images::prepare_prod_build() {
             "--build-arg" 
"AIRFLOW_INSTALL_VERSION===${INSTALL_AIRFLOW_VERSION}"
         )
         export AIRFLOW_VERSION="${INSTALL_AIRFLOW_VERSION}"
+        if [[ ${AIRFLOW_VERSION} == "1.10.2" || ${AIRFLOW_VERSION} == "1.10.1" 
]]; then
+            EXTRA_DOCKER_PROD_BUILD_FLAGS+=(
+                "--build-arg" "SLUGIFY_USES_TEXT_UNIDECODE=yes"
+            )
+        fi
         build_images::add_build_args_for_remote_install
     else
         # When no airflow version/reference is specified, production image is 
built from local sources

Reply via email to