From 00d2a3c9319af6e145b8e03f5ac33a95fa8acd66 Mon Sep 17 00:00:00 2001 From: Jarek Potiuk Date: Sun, 12 Jun 2022 17:14:09 +0200 Subject: [PATCH] Better diagnostics for ARM for MySQL and MSSQL (#24185) Until we have debian suppor tof MySQL and MSSQL ARM, runnign those on ARM platform is not supported. However error about it was not clear (pulling docker image failed). This PR adds platform checking also in breeze and fails fast without even attempting to enter breeze shell when you are on ARM and wants to run MsSQL or MySQL breeze shell. Also some errors with running different backend versions via breeze have been removed. --- .../src/airflow_breeze/commands/developer_commands.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/dev/breeze/src/airflow_breeze/commands/developer_commands.py b/dev/breeze/src/airflow_breeze/commands/developer_commands.py index e10e79d0a8126..a8ad686c708c5 100644 --- a/dev/breeze/src/airflow_breeze/commands/developer_commands.py +++ b/dev/breeze/src/airflow_breeze/commands/developer_commands.py @@ -25,6 +25,7 @@ from airflow_breeze.commands.main_command import main from airflow_breeze.global_constants import ( DEFAULT_PYTHON_MAJOR_MINOR_VERSION, + DOCKER_DEFAULT_PLATFORM, MOUNT_SELECTED, get_available_packages, ) @@ -601,7 +602,13 @@ def run_shell(verbose: bool, dry_run: bool, shell_params: ShellParams) -> RunCom env_variables = get_env_variables_for_docker_commands(shell_params) if cmd_added is not None: cmd.extend(['-c', cmd_added]) - + if "arm64" in DOCKER_DEFAULT_PLATFORM: + if shell_params.backend == "mysql": + get_console().print('\n[error]MySQL is not supported on ARM architecture.[/]\n') + sys.exit(1) + if shell_params.backend == "mssql": + get_console().print('\n[error]MSSQL is not supported on ARM architecture[/]\n') + sys.exit(1) command_result = run_command( cmd, verbose=verbose, dry_run=dry_run, env=env_variables, text=True, check=False )