Skip to content

Commit

Permalink
Fix choosing backend versions in breeze's command line (#24228)
Browse files Browse the repository at this point in the history
Choosing version of backend were broken when command line switches
were used. The _VERSION variables were "hard-coded" to defaults
rather than taken from command line. This is a remnant of initial
implementation and converting the parameters to "cacheable" ones.

While looking at the versions we also found that PARAM_NAME_FLAG
is not used any more so we took the opportunity to remove it.
  • Loading branch information
potiuk authored Jun 7, 2022
1 parent c3a9ef1 commit 4482eae
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 21 deletions.
15 changes: 0 additions & 15 deletions dev/breeze/src/airflow_breeze/global_constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,18 +102,6 @@
"MSSQL_VERSION": "MSSql version",
}

PARAM_NAME_FLAG = {
"BACKEND": "--backend",
"MYSQL_VERSION": "--mysql-version",
"KUBERNETES_MODE": "--kubernetes-mode",
"KUBERNETES_VERSION": "--kubernetes-version",
"KIND_VERSION": "--kind-version",
"HELM_VERSION": "--helm-version",
"EXECUTOR": "--executor",
"POSTGRES_VERSION": "--postgres-version",
"MSSQL_VERSION": "--mssql-version",
}

EXCLUDE_DOCS_PACKAGE_FOLDER = [
'exts',
'integration-logos',
Expand Down Expand Up @@ -165,9 +153,6 @@ def get_default_platform_machine() -> str:
CURRENT_POSTGRES_VERSIONS = ['10', '11', '12', '13', '14']
CURRENT_MYSQL_VERSIONS = ['5.7', '8']
CURRENT_MSSQL_VERSIONS = ['2017-latest', '2019-latest']
POSTGRES_VERSION = CURRENT_POSTGRES_VERSIONS[0]
MYSQL_VERSION = CURRENT_MYSQL_VERSIONS[0]
MSSQL_VERSION = CURRENT_MSSQL_VERSIONS[0]
DB_RESET = False
START_AIRFLOW = "false"
LOAD_EXAMPLES = False
Expand Down
9 changes: 3 additions & 6 deletions dev/breeze/src/airflow_breeze/utils/docker_command_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,8 @@
MOUNT_ALL,
MOUNT_SELECTED,
MSSQL_HOST_PORT,
MSSQL_VERSION,
MYSQL_HOST_PORT,
MYSQL_VERSION,
POSTGRES_HOST_PORT,
POSTGRES_VERSION,
REDIS_HOST_PORT,
SSH_PORT,
WEBSERVER_HOST_PORT,
Expand Down Expand Up @@ -566,9 +563,12 @@ def update_expected_environment_variables(env: Dict[str, str]) -> None:
"ISSUE_ID": "issue_id",
"LOAD_EXAMPLES": "load_example_dags",
"LOAD_DEFAULT_CONNECTIONS": "load_default_connections",
"MYSQL_VERSION": "mysql_version",
"MSSQL_VERSION": "mssql_version",
"NUM_RUNS": "num_runs",
"PACKAGE_FORMAT": "package_format",
"PYTHON_MAJOR_MINOR_VERSION": "python",
"POSTGRES_VERSION": "postgres_version",
"SQLITE_URL": "sqlite_url",
"START_AIRFLOW": "start_airflow",
"SKIP_ENVIRONMENT_INITIALIZATION": "skip_environment_initialization",
Expand All @@ -580,11 +580,8 @@ def update_expected_environment_variables(env: Dict[str, str]) -> None:
DOCKER_VARIABLE_CONSTANTS = {
"FLOWER_HOST_PORT": FLOWER_HOST_PORT,
"MSSQL_HOST_PORT": MSSQL_HOST_PORT,
"MSSQL_VERSION": MSSQL_VERSION,
"MYSQL_HOST_PORT": MYSQL_HOST_PORT,
"MYSQL_VERSION": MYSQL_VERSION,
"POSTGRES_HOST_PORT": POSTGRES_HOST_PORT,
"POSTGRES_VERSION": POSTGRES_VERSION,
"REDIS_HOST_PORT": REDIS_HOST_PORT,
"SSH_PORT": SSH_PORT,
"WEBSERVER_HOST_PORT": WEBSERVER_HOST_PORT,
Expand Down

0 comments on commit 4482eae

Please sign in to comment.