Skip to content

Commit

Permalink
Python base image version is retrieved in the right place (#9931)
Browse files Browse the repository at this point in the history
When quick-fixing Python 3.8.4 error #9820 PYTHON_BASE_IMAGE_VERSION
variable was added but it was initialized too early in Breeze and
it took the default version of Python rather than the one chosen
by --python switch. This caused the generated requirements
(locally by Breeze only) to generate wrong set of requirements
and images built locally for different python versions were
based on default Python version, not the one chosen by --python
switch.

(cherry picked from commit 7b9e8e0)
  • Loading branch information
potiuk committed Jul 22, 2020
1 parent 0dc20fd commit 29835cd
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
1 change: 1 addition & 0 deletions breeze
Original file line number Diff line number Diff line change
Expand Up @@ -508,6 +508,7 @@ function prepare_command_files() {
export COMPOSE_CI_FILE
export COMPOSE_PROD_FILE

get_base_image_version
# Base python image for the build
export PYTHON_BASE_IMAGE=python:${PYTHON_BASE_IMAGE_VERSION}-slim-buster
export AIRFLOW_CI_IMAGE="${DOCKERHUB_USER}/${DOCKERHUB_REPO}:${BRANCH_NAME}-python${PYTHON_MAJOR_MINOR_VERSION}-ci"
Expand Down
7 changes: 7 additions & 0 deletions scripts/ci/libraries/_build_images.sh
Original file line number Diff line number Diff line change
Expand Up @@ -311,11 +311,17 @@ function print_build_info() {
print_info
}

function get_base_image_version() {
# python image version to use
PYTHON_BASE_IMAGE_VERSION=${PYTHON_BASE_IMAGE_VERSION:=${PYTHON_MAJOR_MINOR_VERSION}}
}



# Prepares all variables needed by the CI build. Depending on the configuration used (python version
# DockerHub user etc. the variables are set so that other functions can use those variables.
function prepare_ci_build() {
get_base_image_version
# We use pulled docker image cache by default for CI images to speed up the builds
export DOCKER_CACHE=${DOCKER_CACHE:="pulled"}
echo
Expand Down Expand Up @@ -591,6 +597,7 @@ Docker building ${AIRFLOW_CI_IMAGE}.
# Prepares all variables needed by the CI build. Depending on the configuration used (python version
# DockerHub user etc. the variables are set so that other functions can use those variables.
function prepare_prod_build() {
get_base_image_version
# We use local docker image cache by default for Production images
export DOCKER_CACHE=${DOCKER_CACHE:="local"}
echo
Expand Down
4 changes: 0 additions & 4 deletions scripts/ci/libraries/_initialization.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@ function initialize_common_environment {
# default python Major/Minor version
PYTHON_MAJOR_MINOR_VERSION=${PYTHON_MAJOR_MINOR_VERSION:="3.6"}

# python image version to use
# shellcheck disable=SC2034
PYTHON_BASE_IMAGE_VERSION=${PYTHON_MAJOR_MINOR_VERSION}

# extra flags passed to docker run for CI image
# shellcheck disable=SC2034
EXTRA_DOCKER_FLAGS=()
Expand Down

0 comments on commit 29835cd

Please sign in to comment.