Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions dev/breeze/src/airflow_breeze/utils/docker_command_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
from airflow_breeze.utils.host_info_utils import get_host_group_id, get_host_os, get_host_user_id
from airflow_breeze.utils.path_utils import (
AIRFLOW_SOURCES_ROOT,
SCRIPTS_DOCKER_DIR,
cleanup_python_generated_files,
create_mypy_volume_if_needed,
)
Expand Down Expand Up @@ -481,10 +482,30 @@ def prepare_broker_url(params, env_variables):
env_variables["AIRFLOW__CELERY__BROKER_URL"] = url_map[params.celery_broker]


def check_executable_entrypoint_permissions(quiet: bool = False):
"""
Checks if the user has executable permissions on the entrypoints in checked-out airflow repository..
"""
for entrypoint in SCRIPTS_DOCKER_DIR.glob("entrypoint*.sh"):
if get_verbose() and not quiet:
get_console().print(f"[info]Checking executable permissions on {entrypoint.as_posix()}[/]")
if not os.access(entrypoint.as_posix(), os.X_OK):
get_console().print(
f"[error]You do not have executable permissions on {entrypoint}[/]\n"
f"You likely checked out airflow repo on a filesystem that does not support executable "
f"permissions (for example on a Windows filesystem that is mapped to Linux VM). Airflow "
f"repository should only be checked out on a filesystem that is POSIX compliant."
)
sys.exit(1)
if not quiet:
get_console().print("[success]Executable permissions on entrypoints are OK[/]")


def perform_environment_checks(quiet: bool = False):
check_docker_is_running()
check_docker_version(quiet)
check_docker_compose_version(quiet)
check_executable_entrypoint_permissions(quiet)


def get_docker_syntax_version() -> str:
Expand Down
1 change: 1 addition & 0 deletions dev/breeze/src/airflow_breeze/utils/path_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,7 @@ def find_airflow_sources_root_to_operate_on() -> Path:
GENERATED_PROVIDER_PACKAGES_DIR = DIST_DIR / "provider_packages"
DOCS_DIR = AIRFLOW_SOURCES_ROOT / "docs"
SCRIPTS_CI_DIR = AIRFLOW_SOURCES_ROOT / "scripts" / "ci"
SCRIPTS_DOCKER_DIR = AIRFLOW_SOURCES_ROOT / "scripts" / "docker"
SCRIPTS_CI_DOCKER_COMPOSE_DIR = SCRIPTS_CI_DIR / "docker-compose"
SCRIPTS_CI_DOCKER_COMPOSE_LOCAL_YAML_FILE = SCRIPTS_CI_DOCKER_COMPOSE_DIR / "local.yml"
GENERATED_DOCKER_COMPOSE_ENV_FILE = SCRIPTS_CI_DOCKER_COMPOSE_DIR / "_generated_docker_compose.env"
Expand Down