From 2b9d250c29c7d671bdd9339c53ce2ea934e97943 Mon Sep 17 00:00:00 2001 From: Chakru <161002324+chakru-r@users.noreply.github.com> Date: Tue, 14 Oct 2025 16:13:37 +0530 Subject: [PATCH] fix(build): add ability to specificy constraints for bundled-venvs (#14999) pydantic v2.41.3 released on oct 7th seems to have uploaded a corrupt whl. pydantic/pydantic-core#1841 Adding the ability to specify constraints to exclude this and in future, any other package that we may need to skip for bundled_venvs. --- docker/datahub-actions/Dockerfile | 1 + docker/snippets/ingestion/build_bundled_venvs_unified.py | 3 ++- docker/snippets/ingestion/constraints.txt | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 docker/snippets/ingestion/constraints.txt diff --git a/docker/datahub-actions/Dockerfile b/docker/datahub-actions/Dockerfile index 43d867c3ed..b2638e1878 100644 --- a/docker/datahub-actions/Dockerfile +++ b/docker/datahub-actions/Dockerfile @@ -147,6 +147,7 @@ RUN mkdir -p $DATAHUB_BUNDLED_VENV_PATH && \ # Copy the self-contained venv build scripts COPY --chown=datahub:datahub ./docker/snippets/ingestion/build_bundled_venvs_unified.py /tmp/ COPY --chown=datahub:datahub ./docker/snippets/ingestion/build_bundled_venvs_unified.sh /tmp/ +COPY --chown=datahub:datahub ./docker/snippets/ingestion/constraints.txt ${DATAHUB_BUNDLED_VENV_PATH}/ # Make scripts executable RUN chmod +x /tmp/build_bundled_venvs_unified.sh && \ diff --git a/docker/snippets/ingestion/build_bundled_venvs_unified.py b/docker/snippets/ingestion/build_bundled_venvs_unified.py index d6075185da..e38cebc314 100644 --- a/docker/snippets/ingestion/build_bundled_venvs_unified.py +++ b/docker/snippets/ingestion/build_bundled_venvs_unified.py @@ -43,7 +43,8 @@ def create_venv(plugin: str, venv_name: str, bundled_cli_version: str, venv_base # Install DataHub with the specific plugin print(f" → Installing datahub with {plugin} plugin...") datahub_package = f'acryl-datahub[datahub-rest,datahub-kafka,file,{plugin}]=={bundled_cli_version}' - install_cmd = f'source {venv_path}/bin/activate && uv pip install "{datahub_package}"' + constraints_path = os.path.join(venv_base_path, "constraints.txt") + install_cmd = f'source {venv_path}/bin/activate && uv pip install "{datahub_package}" --constraints {constraints_path}' subprocess.run(['bash', '-c', install_cmd], check=True, capture_output=True) print(f" ✅ Successfully created {venv_name}") diff --git a/docker/snippets/ingestion/constraints.txt b/docker/snippets/ingestion/constraints.txt new file mode 100644 index 0000000000..c5cb3e3901 --- /dev/null +++ b/docker/snippets/ingestion/constraints.txt @@ -0,0 +1 @@ +pydantic_core!=2.41.3