This is an automated email from the ASF dual-hosted git repository.
potiuk pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/main by this push:
new bc27355b605 Make building PROD image using sources requirements
(#46440)
bc27355b605 is described below
commit bc27355b6053a35ea6e0e8bc58f21937e67f7942
Author: Jarek Potiuk <[email protected]>
AuthorDate: Tue Feb 4 23:10:49 2025 +0100
Make building PROD image using sources requirements (#46440)
When PROD image is build using sources, it should use source
requireents rather than pip requirements - they might be conflicting
if the main providers are different than released prividers.
---
.../src/airflow_breeze/commands/production_image_commands.py | 10 +++++++++-
dev/breeze/src/airflow_breeze/global_constants.py | 8 ++++++--
2 files changed, 15 insertions(+), 3 deletions(-)
diff --git
a/dev/breeze/src/airflow_breeze/commands/production_image_commands.py
b/dev/breeze/src/airflow_breeze/commands/production_image_commands.py
index 0f5e95f54b7..3076b677c6a 100644
--- a/dev/breeze/src/airflow_breeze/commands/production_image_commands.py
+++ b/dev/breeze/src/airflow_breeze/commands/production_image_commands.py
@@ -81,7 +81,11 @@ from
airflow_breeze.commands.common_package_installation_options import (
option_airflow_constraints_location,
option_airflow_constraints_mode_prod,
)
-from airflow_breeze.global_constants import ALLOWED_INSTALLATION_METHODS,
DEFAULT_EXTRAS
+from airflow_breeze.global_constants import (
+ ALLOWED_INSTALLATION_METHODS,
+ CONSTRAINTS_SOURCE_PROVIDERS,
+ DEFAULT_EXTRAS,
+)
from airflow_breeze.params.build_prod_params import BuildProdParams
from airflow_breeze.utils.ci_group import ci_group
from airflow_breeze.utils.click_utils import BreezeGroup
@@ -330,6 +334,10 @@ def build(
get_console().print(f"[error]Error when building image! {info}")
sys.exit(return_code)
+ if not install_airflow_version and not airflow_constraints_location:
+ get_console().print(f"[yellow]Using {CONSTRAINTS_SOURCE_PROVIDERS}
constraints mode[/]")
+ airflow_constraints_mode = CONSTRAINTS_SOURCE_PROVIDERS
+
perform_environment_checks()
check_remote_ghcr_io_commands()
base_build_params = BuildProdParams(
diff --git a/dev/breeze/src/airflow_breeze/global_constants.py
b/dev/breeze/src/airflow_breeze/global_constants.py
index 7df3b551a5b..0296c996b9c 100644
--- a/dev/breeze/src/airflow_breeze/global_constants.py
+++ b/dev/breeze/src/airflow_breeze/global_constants.py
@@ -148,9 +148,13 @@ START_AIRFLOW_ALLOWED_EXECUTORS = [LOCAL_EXECUTOR,
CELERY_EXECUTOR, EDGE_EXECUTO
START_AIRFLOW_DEFAULT_ALLOWED_EXECUTOR = START_AIRFLOW_ALLOWED_EXECUTORS[0]
ALLOWED_CELERY_EXECUTORS = [CELERY_EXECUTOR, CELERY_K8S_EXECUTOR]
+CONSTRAINTS_SOURCE_PROVIDERS = "constraints-source-providers"
+CONSTRAINTS = "constraints"
+CONSTRAINTS_NO_PROVIDERS = "constraints-no-providers"
+
ALLOWED_KIND_OPERATIONS = ["start", "stop", "restart", "status", "deploy",
"test", "shell", "k9s"]
-ALLOWED_CONSTRAINTS_MODES_CI = ["constraints-source-providers", "constraints",
"constraints-no-providers"]
-ALLOWED_CONSTRAINTS_MODES_PROD = ["constraints", "constraints-no-providers",
"constraints-source-providers"]
+ALLOWED_CONSTRAINTS_MODES_CI = [CONSTRAINTS_SOURCE_PROVIDERS, CONSTRAINTS,
CONSTRAINTS_NO_PROVIDERS]
+ALLOWED_CONSTRAINTS_MODES_PROD = [CONSTRAINTS, CONSTRAINTS_NO_PROVIDERS,
CONSTRAINTS_SOURCE_PROVIDERS]
ALLOWED_CELERY_BROKERS = ["rabbitmq", "redis"]
DEFAULT_CELERY_BROKER = ALLOWED_CELERY_BROKERS[1]