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/07/18 11:20:36 UTC

[airflow] 19/29: Fixes passing variables via docker --env-file command (#16959)

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 e3ef80de9e4736e55ca5de0e687413b58aa8f13b
Author: Jarek Potiuk <ja...@potiuk.com>
AuthorDate: Tue Jul 13 08:51:53 2021 +0200

    Fixes passing variables via docker --env-file command (#16959)
    
    The #16950 aimed to fix an incompatibility introduced by
    beta version of docker-compose v2 (which is automatically pushed
    to MacOS users now).
    
    The issue is documented in
    https://github.com/docker/compose-cli/issues/1917
    
    Unfortunately it has an undesired side-effect that the same file
    cannot be used to specify list of variables for docker command
    (the variables come empty).
    
    Until the problem is solved, we need to keep two copies of those
    variable files. Not ideal, but hopefully the issue will be solved
    soon and we can go back to original env file in docker-compose v2.
    
    (cherry picked from commit 72781c0b4548d35a37fbbef9c2417f94d2025f8f)
---
 scripts/ci/docker-compose/_docker.env              | 96 +++++++++++-----------
 .../{_docker.env => _docker_compose.env}           |  6 ++
 scripts/ci/docker-compose/base.yml                 |  2 +-
 3 files changed, 55 insertions(+), 49 deletions(-)

diff --git a/scripts/ci/docker-compose/_docker.env b/scripts/ci/docker-compose/_docker.env
index c88300a..6e8a5c5 100644
--- a/scripts/ci/docker-compose/_docker.env
+++ b/scripts/ci/docker-compose/_docker.env
@@ -14,51 +14,51 @@
 # KIND, either express or implied.  See the License for the
 # specific language governing permissions and limitations
 # under the License.
-AIRFLOW_CI_IMAGE=
-AIRFLOW_EXTRAS=
-BACKEND=
-BREEZE=
-CI=
-CI_BUILD_ID=
-CI_JOB_ID=
-CI_EVENT_TYPE=
-CI_TARGET_REPO=
-CI_TARGET_BRANCH=
-COMMIT_SHA=
-DB_RESET=
-DEFAULT_CONSTRAINTS_BRANCH=
-ENABLED_INTEGRATIONS=
-ENABLED_SYSTEMS=
-GITHUB_ACTIONS=
-GITHUB_REGISTRY_PULL_IMAGE_TAG=
-HOST_USER_ID=
-HOST_GROUP_ID=
-HOST_OS=
-HOST_HOME=
-INIT_SCRIPT_FILE=
-INSTALL_AIRFLOW_VERSION=
-GENERATE_CONSTRAINTS_MODE=
-INSTALL_PROVIDERS_FROM_SOURCES=
-USE_AIRFLOW_VERSION=
-USE_PACKAGES_FROM_DIST=
-ISSUE_ID=
-LOAD_DEFAULT_CONNECTIONS=
-LOAD_EXAMPLES=
-MYSQL_VERSION=
-NUM_RUNS=
-PACKAGE_FORMAT=
-POSTGRES_VERSION=
-PRINT_INFO_FROM_SCRIPTS=
-PYTHONDONTWRITEBYTECODE=
-PYTHON_MAJOR_MINOR_VERSION=
-RUN_TESTS=
-RUN_INTEGRATION_TESTS=
-RUN_SYSTEM_TESTS=
-START_AIRFLOW=
-TEST_TYPE=
-UPGRADE_TO_NEWER_DEPENDENCIES=
-VERBOSE=
-VERBOSE_COMMANDS=
-VERSION_SUFFIX_FOR_PYPI=
-VERSION_SUFFIX_FOR_SVN=
-WHEEL_VERSION=
+AIRFLOW_CI_IMAGE
+AIRFLOW_EXTRAS
+BACKEND
+BREEZE
+CI
+CI_BUILD_ID
+CI_JOB_ID
+CI_EVENT_TYPE
+CI_TARGET_REPO
+CI_TARGET_BRANCH
+COMMIT_SHA
+DB_RESET
+DEFAULT_CONSTRAINTS_BRANCH
+ENABLED_INTEGRATIONS
+ENABLED_SYSTEMS
+GITHUB_ACTIONS
+GITHUB_REGISTRY_PULL_IMAGE_TAG
+HOST_USER_ID
+HOST_GROUP_ID
+HOST_OS
+HOST_HOME
+INIT_SCRIPT_FILE
+INSTALL_AIRFLOW_VERSION
+GENERATE_CONSTRAINTS_MODE
+INSTALL_PROVIDERS_FROM_SOURCES
+USE_AIRFLOW_VERSION
+USE_PACKAGES_FROM_DIST
+ISSUE_ID
+LOAD_DEFAULT_CONNECTIONS
+LOAD_EXAMPLES
+MYSQL_VERSION
+NUM_RUNS
+PACKAGE_FORMAT
+POSTGRES_VERSION
+PRINT_INFO_FROM_SCRIPTS
+PYTHONDONTWRITEBYTECODE
+PYTHON_MAJOR_MINOR_VERSION
+RUN_TESTS
+RUN_INTEGRATION_TESTS
+RUN_SYSTEM_TESTS
+START_AIRFLOW
+TEST_TYPE
+UPGRADE_TO_NEWER_DEPENDENCIES
+VERBOSE
+VERBOSE_COMMANDS
+VERSION_SUFFIX_FOR_PYPI
+VERSION_SUFFIX_FOR_SVN
+WHEEL_VERSION
diff --git a/scripts/ci/docker-compose/_docker.env b/scripts/ci/docker-compose/_docker_compose.env
similarity index 85%
copy from scripts/ci/docker-compose/_docker.env
copy to scripts/ci/docker-compose/_docker_compose.env
index c88300a..b842270 100644
--- a/scripts/ci/docker-compose/_docker.env
+++ b/scripts/ci/docker-compose/_docker_compose.env
@@ -14,6 +14,12 @@
 # KIND, either express or implied.  See the License for the
 # specific language governing permissions and limitations
 # under the License.
+#
+# Until https://github.com/docker/compose-cli/issues/1917 is resolved
+# we need to keep this docker_compose.env separately to accoun for different
+# behaviour of Docker-Compose V2 Beta (which became default for MacOS users updating
+# their Docker Desktop to a newer version
+#
 AIRFLOW_CI_IMAGE=
 AIRFLOW_EXTRAS=
 BACKEND=
diff --git a/scripts/ci/docker-compose/base.yml b/scripts/ci/docker-compose/base.yml
index 34cc100..d01368c 100644
--- a/scripts/ci/docker-compose/base.yml
+++ b/scripts/ci/docker-compose/base.yml
@@ -26,7 +26,7 @@ services:
       - KUBECONFIG=/files/.kube/config
       - HOST_HOME=${HOME}
     env_file:
-      - _docker.env
+      - _docke_compose.env
     volumes:
       # Pass docker to inside of the container so that Kind and Moto tests can use it.
       - /var/run/docker.sock:/var/run/docker.sock