airflow-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [airflow] potiuk commented on a change in pull request #6423: [AIRFLOW-5748] Remove python auto-detection
Date Thu, 24 Oct 2019 22:59:47 GMT
potiuk commented on a change in pull request #6423: [AIRFLOW-5748] Remove python auto-detection
URL: https://github.com/apache/airflow/pull/6423#discussion_r338826933
 
 

 ##########
 File path: common/_autodetect_variables.sh
 ##########
 @@ -63,38 +63,13 @@ echo
 echo "Branch: ${AIRFLOW_CONTAINER_BRANCH_NAME}"
 echo
 
-# You can override AUTODETECT_PYTHON_BINARY if you want to use different version but for
now we assume
-# that the binary used will be the default python 3 version available on the path
-# unless it is overridden with PYTHON_VERSION variable in the next step
-if ! AUTODETECT_PYTHON_BINARY=${AUTODETECT_PYTHON_BINARY:=$(command -v python3)}; then
-    echo >&2
-    echo >&2 "Error: You must have python3 in your PATH"
-    echo >&2
-    exit 1
-fi
-
-# Determine python version. This can be either specified by AUTODETECT_PYTHON_VERSION variable
or it is
-# auto-detected from the version of the python3 binary (or AUTODETECT_PYTHON_BINARY you specify
as
-# environment variable).
-# Note that even if we auto-detect it here, it can be further overridden in case IMAGE_NAME
is speecified
-# as environment variable. The reason is that IMAGE_NAME is the only differentiating factor
we can have
-# in the DockerHub build. We cannot specify different environment variables for different
image names
-# so we use IMAGE_NAME to determine which PYTHON_VERSION is actually used for this particular
build.
-# It's cumbersome - we can improve it in the future by swtching away from DockerHub builds
- only use
-# DockerHub to store the images but not to run it to build the images. If we switch to another
CI that
-# will let us build images outside of DockerHub and push them there, we will be able to get
rid of this.
-# This will probably be necessary as we scale up becasue DockerHub build are very slow and
they are
-# already queueing a lot.
-export AUTODETECT_PYTHON_VERSION=${PYTHON_VERSION:=$(${AUTODETECT_PYTHON_BINARY} -c \
- 'import sys;print("%s.%s" % (sys.version_info.major, sys.version_info.minor))')}
-
 # IMAGE_NAME might come from DockerHub and we decide which PYTHON_VERSION to use based on
it (see below)
 # In case IMAGE_NAME is not set we determine PYTHON_VERSION based on the default python on
the path
 # So in virtualenvs it will use the virtualenv's PYTHON_VERSION and in DockerHub it will
determine
-# PYTHHON_VERSION from the IMAGE_NAME set in the DockerHub build.
+# PYTHON_VERSION from the IMAGE_NAME set in the DockerHub build.
 # See comment above in PYTHON_VERSION - we will be able to get rid of this cumbersomness
when we switch
 # to a different CI system and start pushing images to DockerHub rather than build it there.
-export BASE_IMAGE_NAME=${IMAGE_NAME:=${DOCKERHUB_USER}/${DOCKERHUB_REPO}:${AIRFLOW_CONTAINER_BRANCH_NAME}-python${AUTODETECT_PYTHON_VERSION}}
+export BASE_IMAGE_NAME=${IMAGE_NAME:=${DOCKERHUB_USER}/${DOCKERHUB_REPO}:${AIRFLOW_CONTAINER_BRANCH_NAME}-python${PYTHON_VERSION=3.5}}
 
 Review comment:
   Yeah. Good catch - but it was supposed to be :- :)

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message