Skip to content

Update Python packages in ingestion images - #36011

Merged
ulixius9 merged 5 commits into
mainfrom
chore/update-python-image-packages
Oct 23, 2026
Merged

ulixius9 merged 5 commits into
mainfrom
chore/update-python-image-packages

Conversation

@IceS2

@IceS2 IceS2 commented Oct 22, 2026 •

Copy link
Copy Markdown
Collaborator

Describe your changes

Update pip to 26.2.2, certifi to >=2026.10.19, uv to >=0.13.4 and virtualenv to >=21.14.12 in ingestion images, with matching CI recipes and a certifi floor in package metadata.

Type of change

  • Improvement

High-level design

Install pip directly from its fixed wheel URL with the published SHA256 checksum, then use the updated pip to upgrade certifi and uv. Apply this to both root and Airflow-user installations; update the separate uv installation in Airflow's existing prek environment. Refresh OS certificate packages and use the OS bundle for gRPC and prek.

Airflow stays on 3.3.2/Python 3.12 and uses the checked-in constraints with updated certifi, uv, virtualenv and python-discovery pins. The standalone scripts/verify_python_tls.py checks installed packages and runtime certificate bundles. The change does not modify Python or virtualenv internals.

Rebuild with docker build --pull --no-cache and replace deployed images. Publish the OpenMetadata images before rebuilding their Collate derivatives.

Tests

  • Final implementation: two focused native ARM64 builds from current Python 3.12 slim/trixie and Airflow 3.3.2/Python 3.12 parents, using --pull --no-cache. Hashed pip installation and package upgrades pass. Runtime TLS checks pass for Python root and Airflow root/default user, including pip, certifi, OS and applicable botocore/httplib2/gRPC bundles and the isolated uv version. Python's ensurepip files remain byte-identical.
  • All six bootstrap Dockerfiles pass hashed-install and shell-syntax checks. The runtime verifier passes Ruff lint/format; diffs pass whitespace checks.
  • Earlier full ARM64 ingestion/ingestion-base builds exercised metadata CLI startup and Airflow SQLite migration, as part of the five-production-image run across both repositories. Those builds used local SDK/managed-API wheel fixtures and preceded the final bootstrap cleanup; full images were not rebuilt for this last change.
  • AMD64, slim extras and separate CI builds were not run locally. Connector suites, Java tests, Playwright and UI recording are not applicable to these package/Docker changes. Coverage was not measured.

Existing pip check findings remain: huggingface-hub requires click >=8.4.2 while Airflow resolves 8.3.3; pydoris declares mysqlclient despite the intentional PyMySQL migration. Dependency checks are not reported as clean.

Manual reproduction: rebuild with refreshed parents and caching disabled; run docker run --rm -i --entrypoint python IMAGE - --network < scripts/verify_python_tls.py as default user and root, then exercise metadata CLI and Airflow migration as applicable.

UI screen recording

Not applicable: no UI changes.

Checklist

  • Final diff reviewed against REVIEW.md.
  • Runtime validation and build limitations recorded above.
  • Decision check: routine package updates; no additional decision record needed.
  • Schema migrations and backend/UI checks are not applicable.

Self-review: f94454096856630c75518514f9e9f57228e9ca2d; no unresolved blocking findings.

Collate counterpart: https://github.com/open-metadata/openmetadata-collate/pull/7720


Summary by Gitar

  • Python seed patching:
    • Replaces ensurepip's bundled pip wheel and removes older virtualenv pip seeds via patch_python_seeds.py
    • Build fails if ensurepip's _PIP_VERSION layout changes unexpectedly
  • Build and constraints:
    • Adds BASE_IMAGE build arg to ingestion Dockerfiles for Collate derivatives
    • Airflow installs use in-tree airflow-constraints-3.3.2.txt with security overrides
  • TLS trust:
    • Sets GRPC_DEFAULT_SSL_ROOTS_FILE_PATH to the OS CA bundle and installs ca-certificates
    • Sets PREK_NATIVE_TLS and upgrades uv in the isolated prek environment
  • Verification:
    • Adds verify_python_tls.py checking package floors, CA bundles, and fresh-venv pip

This will update automatically on new commits.

RetriggerView in GreptileConfidence Score: 5/5

The latest change appears safe to merge; no new blocking issue was found.

Summary

Updates Python packages and certificate bundles in ingestion images.

  • Ingestion images carry newer Python packages and seed them into new environments.
  • Ingestion image TLS clients use the refreshed OS certificate bundle.
  • Operators can check Python package versions and TLS trust in an image.

No new issues were found since the previous review. The earlier unnumbered finding is addressed: all four Dockerfiles patch bundled seeds, and the verifier checks newly created environments.

Reviews (4) · Last reviewed commit: "docs: state that the ingestion image TLS..." · Reviewed by Greptile

@IceS2
IceS2 requested a review from a team as a code owner October 22, 2026 22:04
@IceS2
IceS2 requested review from mohittilala and a balanced review from Copilot October 22, 2026 22:04
@github-actions

Copy link
Copy Markdown
Contributor

❌ PR checklist incomplete

This PR cannot be merged until the following are addressed on its linked issue:

  • No GitHub issue is linked. Link an issue in the Development section of the PR (or add Fixes #12345 to the description). For a same-org cross-repo issue, add Fixes open-metadata/<repo>#123 to the description.

The fields live on the linked issue in the Shipping project (open the issue → right sidebar → Projects). After you set them, re-run this check (or push a commit) — issue/project changes do not re-trigger it automatically.

Maintainers can bypass this check by adding the skip-pr-checks label.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions github-actions Bot added Ingestion safe to test Add this label to run secure Github workflows on PRs labels Oct 22, 2026
Comment thread ingestion/Dockerfile Resolved
Comment thread ingestion/Dockerfile Resolved
Comment thread ingestion/scripts/verify_python_tls.py Resolved
Copilot AI balanced review requested due to automatic review settings October 22, 2026 22:09

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Copilot AI balanced review requested due to automatic review settings October 22, 2026 22:20

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Comment thread ingestion/Dockerfile Resolved
@ulixius9
ulixius9 added this pull request to the merge queue Oct 23, 2026
@ulixius9
ulixius9 removed this pull request from the merge queue due to a manual request Oct 23, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🚦 Removed from the merge queue — manual (2026-10-23T04:23:12Z)

The entry left the queue before it was built, so no checks ran against it.

- Restore patch_python_seeds.py so ensurepip and virtualenv seed pip 26.2.2
  into fresh environments, and restore the verifier's fresh-venv checks
- Move verify_python_tls.py under ingestion/scripts/ to match its license
- Set a TLS 1.2 floor in the verifier's SSL context
- Record the BASE_IMAGE contract, in-tree constraints overrides and seed
  patch in a decision record
Copilot AI balanced review requested due to automatic review settings October 23, 2026 04:39

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Copilot AI balanced review requested due to automatic review settings October 23, 2026 05:10

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@gitar-bot

gitar-bot Bot commented Oct 23, 2026

Copy link
Copy Markdown
Code Review ✅ Approved 4 closed / 4 findings

🟡 Medium risk · Updating ingestion-image package pins, pip seeds, and CA trust bundles changes dependency and TLS behavior; incompatibilities could disrupt ingestion builds or connections.

Updates pip, certifi, uv and virtualenv pins across ingestion images, adds a BASE_IMAGE build arg and OS CA bundle wiring for gRPC and prek, and adds scripts/verify_python_tls.py for runtime TLS checks. Resolved this session: the undocumented BASE_IMAGE build-order contract, the undocumented in-tree constraints rule, the license header on verify_python_tls.py, and the verifier not being run in any image build. No open findings remain.

✅ 4 closed
✅ Quality: Undocumented contract: BASE_IMAGE arg and OSS-before-Collate build order

📄 ingestion/Dockerfile:1-4 📄 ingestion/operators/docker/Dockerfile:1-2
Both production recipes now expose ARG BASE_IMAGE (ingestion/Dockerfile:1-4, ingestion/operators/docker/Dockerfile:1-2), and the description says Collate's derivative images rebuild on top of them: "Build OpenMetadata images before rebuilding their Collate derivatives. Existing deployed images require a rebuild and replacement." That makes the build-arg name and the build order a contract with open-metadata/openmetadata-collate#7720. Nothing in this repository enforces either one, and no record in docs/decisions/ states them. The repo squash-merges, so this rule will only exist in the PR body. The record should say: "The ingestion and ingestion-base Dockerfiles accept their base image as the BASE_IMAGE build arg, which Collate's derivative images rely on, and OpenMetadata images are built before the Collate images derived from them." The checklist's "no additional decision record needed" does not cover this, because it is a cross-repo ordering and interface, not a routine package bump.

✅ Quality: Undocumented rule: images use the in-tree constraints with security overrides

📄 ingestion/Dockerfile:12 📄 ingestion/Dockerfile:134 📄 ingestion/airflow-constraints-3.3.2.txt:3
ingestion/Dockerfile:134 switches the production install of openmetadata-managed-apis from Airflow's tagged upstream constraints-3.3.2/constraints-3.12.txt to the checked-in ingestion/airflow-constraints-3.3.2.txt. That file is now hand-edited away from the generated upstream content (line 3: "Security overrides update certifi, uv, virtualenv and its python-discovery dependency"). This is a new rule: the in-tree file, not the upstream tag, is the source of truth for production and CI, and security pins must be applied there by hand. Anyone regenerating the file from upstream would silently undo those pins, and no record says this must not happen. The description states it only in prose ("Production builds now use the checked-in Airflow constraints, with updated certifi, uv, virtualenv and python-discovery pins"). The record should say: "Ingestion production and CI images install Airflow-coupled packages against ingestion/airflow-constraints-<version>.txt, and security overrides of upstream pins are applied in that file and listed in its header."

✅ Quality: verify_python_tls.py uses ingestion's license, not root scripts/ header

📄 scripts/verify_python_tls.py:1-10
The new scripts/verify_python_tls.py is in the root scripts/ module, but its header is the Collate Community License pointing at ingestion/LICENSE. Its sibling Python files with headers (e.g. scripts/datamodel_generation.py, scripts/html_to_pdf.py) use the Apache License 2.0 header. The repository rule is that license headers are per-module and copied from a sibling file. Either copy the Apache header from a sibling, or move the script under ingestion/scripts/ next to patch_python_seeds.py, where the Collate header is correct.

✅ Quality: ADR's guard script verify_python_tls.py is never run in any image build

📄 docs/decisions/2026-10-23-ingestion-images-pin-python-security-packages-in-tree.md:6 📄 ingestion/scripts/verify_python_tls.py:112-126 📄 ingestion/Dockerfile:197-199 📄 ingestion/Dockerfile.ci:215-217 📄 ingestion/operators/docker/Dockerfile:13-18 📄 ingestion/operators/docker/Dockerfile.ci:12-17
The new ADR names ingestion/scripts/verify_python_tls.py, "run inside the built image", as the guard for the package floors, the ensurepip patch and the pip that fresh venvs get. Nothing in the tree actually runs it. No Dockerfile copies or bind-mounts it (only patch_python_seeds.py is mounted), and no workflow or Makefile target calls it. So if a later base image or virtualenv release breaks the seed patch, or a regenerated constraints file brings back the vulnerable pins, the build still passes. Either add a RUN step that bind-mounts ingestion/scripts/verify_python_tls.py and runs it with python at the end of each ingestion Dockerfile (or as a CI step against the built image), or change the ADR's Guard line to say the check is only run by hand.

Verification

Rules No rules evaluated

Functional validation Not enabled

Set up

Auto-approval Not enabled

Set up

For more verification details, comment gitar display:verbose.

Options

Display: compact → Showing compact verification results.

Comment with these commands to change the behavior for this request:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source

@ulixius9
ulixius9 added this pull request to the merge queue Oct 23, 2026
@sonarqubecloud

Copy link
Copy Markdown

Merged via the queue into main with commit ec964e1 Oct 23, 2026
82 of 84 checks passed
@ulixius9
ulixius9 deleted the chore/update-python-image-packages branch October 23, 2026 06:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Ingestion safe to test Add this label to run secure Github workflows on PRs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants