Skip to content

Commit

Permalink
Fixes passing variables via docker --env-file command (#16959)
Browse files Browse the repository at this point in the history
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
docker-archive/compose-cli#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.

GitOrigin-RevId: 72781c0b4548d35a37fbbef9c2417f94d2025f8f
  • Loading branch information
potiuk authored and Cloud Composer Team committed Jun 4, 2022
1 parent e3057c5 commit 517690d
Show file tree
Hide file tree
Showing 3 changed files with 119 additions and 49 deletions.
96 changes: 48 additions & 48 deletions scripts/ci/docker-compose/_docker.env
Original file line number Diff line number Diff line change
Expand Up @@ -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
70 changes: 70 additions & 0 deletions scripts/ci/docker-compose/_docker_compose.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# 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=
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=
2 changes: 1 addition & 1 deletion scripts/ci/docker-compose/base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 517690d

Please sign in to comment.