From 7e5b470e8ee33ae0dfeb4d43e35655dfd36c167d Mon Sep 17 00:00:00 2001 From: Jarek Potiuk Date: Sat, 2 Aug 2025 19:02:56 +0200 Subject: [PATCH] [v3-0-test] Only forward debugger ports when debug components are used (#54051) When debugger option has been added to breeze in #51763 - the ports were added to base-port.yml, but the environment variables were only set when debugging is enabled. This hower caused warnings that the variables are not set and defaulting them to empty string when no debug components were used. Instead - we moved the debugger ports to separate compose file and only use the compose file when debug components are used. (cherry picked from commit 939700f2f3ff98f6c38958396adb9bed576707f2) Co-authored-by: Jarek Potiuk --- .../src/airflow_breeze/params/shell_params.py | 2 ++ scripts/ci/docker-compose/debug-ports.yml | 27 +++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 scripts/ci/docker-compose/debug-ports.yml diff --git a/dev/breeze/src/airflow_breeze/params/shell_params.py b/dev/breeze/src/airflow_breeze/params/shell_params.py index 628001fd111e6..129d05d2ac2b3 100644 --- a/dev/breeze/src/airflow_breeze/params/shell_params.py +++ b/dev/breeze/src/airflow_breeze/params/shell_params.py @@ -380,6 +380,8 @@ def compose_file(self) -> str: sys.exit(1) if self.forward_ports and not self.project_name == "pre-commit": compose_file_list.append(DOCKER_COMPOSE_DIR / "base-ports.yml") + if self.debug_components and not self.project_name == "pre-commit": + compose_file_list.append(DOCKER_COMPOSE_DIR / "debug-ports.yml") if self.mount_sources == MOUNT_SELECTED: compose_file_list.append(DOCKER_COMPOSE_DIR / "local.yml") elif self.mount_sources == MOUNT_ALL: diff --git a/scripts/ci/docker-compose/debug-ports.yml b/scripts/ci/docker-compose/debug-ports.yml new file mode 100644 index 0000000000000..b85c52a5f42b5 --- /dev/null +++ b/scripts/ci/docker-compose/debug-ports.yml @@ -0,0 +1,27 @@ +# 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. +--- +services: + airflow: + ports: + - "${BREEZE_DEBUG_SCHEDULER_PORT}:50231" + - "${BREEZE_DEBUG_DAG_PROCESSOR_PORT}:50232" + - "${BREEZE_DEBUG_TRIGGERER_PORT}:50233" + - "${BREEZE_DEBUG_APISERVER_PORT}:50234" + - "${BREEZE_DEBUG_CELERY_WORKER_PORT}:50235" + - "${BREEZE_DEBUG_EDGE_PORT}:50236" + - "${BREEZE_DEBUG_WEBSERVER_PORT}:50237"