Skip to content

build(ingestion): trim runtime dependencies and update clients - #35445

Merged
IceS2 merged 1 commit into
mainfrom
docker-assess-images
Oct 16, 2026
Merged

IceS2 merged 1 commit into
mainfrom
docker-assess-images

Conversation

@IceS2

@IceS2 IceS2 commented Oct 14, 2026 •

Copy link
Copy Markdown
Collaborator

Describe your changes

Fixes open-metadata/openmetadata-collate#5955

Ingestion images install PostgreSQL server packages and diagnostic tools that the connectors do not invoke, and retain build dependencies after native Python extensions have been compiled. Remove those packages while explicitly retaining the shared libraries needed by the installed drivers.

Also align the AWS SDK dependencies and replace the versioned Elasticsearch 8 alias with one standard Elasticsearch 8 client shared with Airflow's provider dependencies.

Type of change

  • Bug fix
  • Improvement
  • New feature
  • Breaking change
  • Documentation

High-level design

  • Keep the four existing Dockerfiles, base-image families, users and installation layout. Remove PostgreSQL server/contrib and FreeTDS command-line tools; stop explicitly installing PostgreSQL client/common in the job images.
  • Keep compilers and headers through the final native package installation, then purge the selected build dependencies. Protect libpq5, MariaDB and compiler/OpenMP runtime libraries from automatic removal, and check native imports afterward. Preserve current main's optional classification-model installation.
  • Keep Airflow's required SMTP provider. Remove the orphaned redshift-connector package after Amazon-provider pruning; OpenMetadata's Redshift path uses psycopg2.
  • Update boto3 to >=1.43.101,<2 and aiobotocore to ~=3.9.2 together. Replace elasticsearch8~=8.9.0 with elasticsearch>=8.19.3,<9 and update the two datasource imports. Add a search-test package marker to prevent the test directory from shadowing the standard Elasticsearch module during collection.
  • Defer shared builders and Dockerfile consolidation. Late purges reduce the installed footprint but do not recover bytes from earlier image layers; no new compressed-size or vulnerability-reduction figures are claimed.

History checks confirmed that the PostgreSQL dependency upgrade addressed Redshift performance in #12002: its libpq runtime remains installed. Compiler cleanup extends the existing approach in #34839, including the upstream DB2 driver-swap implementation. No IBM dialect adaptation is changed.

Validation

Checks on the prepared diff: git diff --cached --check, Python syntax checks, four-Dockerfile cleanup/model-install checks, and pre-commit hooks passed. The branch starts from main d099f6f553.

Focused ingestion suites: 402 passed, 2 skipped and 4 subtests passed, exit 0, in the experimental ARM64 Airflow image; the same selection previously passed in the job image. Selection under ingestion/tests/unit/:

source/search/elasticsearch/test_connection.py
topology/search/test_elasticsearch.py
topology/database/test_redshift_connection.py
topology/database/test_redshift_serverless.py
topology/database/test_redshift_utils.py
source/database/test_redshift_iam.py
source/database/redshift/test_connection.py
clients/test_aws_client.py
test_credentials.py
source/database/bigquery/test_connection_url.py
topology/database/test_bigquery_impersonation.py
readers/test_parquet_reader.py
readers/test_parquet_batches.py
readers/test_s3_reader_credentials.py
topology/database/test_datalake_s3_client.py
airflow/test_lineage_parser.py
lineage/test_sql_lineage.py
lineage/queries/

An additional focused AWS run passed 67 tests in each image, exit 0: existing credential tests plus six temporary contract cases covering provisioned/serverless credential issuance, caching/refresh and expiry, STS assume-role session creation, and actual S3fs/aiobotocore CSV/Parquet HTTP reads against local Moto. IAM/STS service responses were stubbed; this is not real AWS authorization validation. Coverage percentage was not measured.

Local runtime integration: experimental ARM64 Airflow/job images were tested against OpenMetadata 2.0.4. PostgreSQL/MySQL, Oracle thick/thin modes, four SQL Server driver paths, cold English PII model installation/classification, and ES8/ES9 datasource ingestion were exercised. API/source comparisons checked catalog and search consistency, profiles, samples, and table/column lineage. Security probes covered Oracle wallet/mTLS, SQL Server ODBC TLS/Kerberos, and ES TLS/basic auth/API keys/mTLS proxy paths.

Real password-authenticated Redshift metadata and classification succeeded; all five configured pipelines were rerun. Profiler selected zero assets because of its classification filter, and usage persisted no positive counts. Existing lineage was retained. Those three results do not certify metric execution, positive usage persistence or new lineage discovery.

No repository Elasticsearch integration directory exists; live datasource workflows supplied that integration coverage. The complete repository integration suite was not run. Java/backend, UI/Playwright and UI recording are not applicable: no backend, schema or UI changes.

Experimental dependency boundary: these runtime images use Click 8.4.2 and an unpublished SQLFluff metadata patch. Separate SQLFluff suites passed 9,314 tests with 1 skipped on each of Python 3.10 and 3.12; 15 SQL lineage cases matched Click 8.3.3. Those experiments are not shipping changes in this PR. OpenMetadata's CLI uses argparse, so its successful execution is not direct Click command validation.

Remaining gates before merge/release

  • Rebuild the final source/release images from this updated branch across supported AMD64/ARM64 and all/slim profiles; refresh size measurements and vulnerability scans. The runtime evidence above used snapshot cbd9538d0c plus the cleanup, before carrying it onto current main.
  • Complete the properly versioned SQLFluff/SQLLineage release chain and clean-install dependency validation. No patched wheel or forced Click override is committed here. Experimental images report only the existing IBM i SQLAlchemy metadata exception.
  • Validate real S3 authentication/streaming and Redshift provisioned/serverless IAM, STS and reconnect after credential expiry. Exercise one selected Redshift profile and a known query with expected usage/new lineage.
  • Validate Collate's generated-model/runtime path before adopting the cleaned upstream image. Collate source changes are outside this PR. Windows SQL Server NTLM and deployment-specific authentication remain untested.

Checklist

  • Read the contribution guidance and linked the existing cross-repository issue.
  • Documented the approach, executed validation and remaining gaps.
  • Preserved the existing native-driver and IBM exceptions.
  • Excluded local plans, credentials, source data, runtime logs and experimental wheels.
  • Schema changes, Java integration tests, UI tests and recording: not applicable.
  • Decision record: not applicable; no new cross-component contract or build architecture.

Draft pending the remaining release and integration gates above.

RetriggerView in GreptileConfidence Score: 4/5

The reviewed code appears safe to merge, with a non-blocking improvement to the Airflow native-driver check.

Findings

  1. P2 Native driver checks miss modules ▶

Summary

This PR removes unused database packages and adds late build-tool cleanup while retaining native drivers’ shared libraries. It also:

  • Ingestion images keep driver libraries and drop packages used only for builds or local servers.
  • Airflow images keep SMTP support and drop an unused Redshift connector.
  • AWS ingestion dependencies use updated boto3 and aiobotocore versions.
  • Elasticsearch ingestion uses the standard Elasticsearch 8 client package.

One non-blocking improvement remains: broaden the new Airflow native-driver import check to match the job images.

IceS2 explicitly defers final image builds, clean-install release checks, and real AWS authentication coverage. IceS2 also acknowledges that late cleanup does not recover bytes from earlier image layers.

Reviews (1) · Last reviewed commit: "build(ingestion): trim runtime packages ..." · Reviewed by Greptile

@github-actions github-actions Bot added Ingestion safe to test Add this label to run secure Github workflows on PRs labels Oct 14, 2026
@gitar-bot

gitar-bot Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Code Review ✅ Approved

🟡 Medium risk · Removing image packages and changing AWS/Elasticsearch client versions could disrupt database, cloud-storage, or search ingestion if runtime dependencies are incompatible.

Trims ingestion image runtime packages by removing PostgreSQL server tools, FreeTDS CLI and leftover build dependencies while keeping required shared libraries, and aligns boto3/aiobotocore and switches to the standard Elasticsearch 8 client. No issues found during review.

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

@IceS2
IceS2 marked this pull request as ready for review October 16, 2026 07:52
@IceS2
IceS2 requested a review from a team as a code owner October 16, 2026 07:52
@IceS2
IceS2 requested review from mohittilala and a balanced review from Copilot October 16, 2026 07:52

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

Copy link
Copy Markdown
Contributor

❌ PR checklist incomplete

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

  • Linked issue open-metadata/openmetadata-collate#5955 does not exist or is not accessible.

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.

Comment thread ingestion/Dockerfile
&& apt-get -qq purge -y --autoremove build-essential gcc default-libmysqlclient-dev libpq-dev freetds-bin \
&& rm -rf /var/lib/apt/lists/*
USER airflow
RUN python -c "import MySQLdb, psycopg2"

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.

P2 Native driver checks miss modules

The new post-cleanup check only imports MySQLdb and psycopg2. The Airflow images also install native drivers such as kerberos and, on AMD64, ibm_db. A missing shared library for those drivers would pass this check and reach users.

As a non-blocking improvement, conditionally import the same native modules checked by the job images. Apply this to both Airflow Dockerfiles.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

@sonarqubecloud

Copy link
Copy Markdown

@IceS2
IceS2 enabled auto-merge October 16, 2026 08:27
@IceS2
IceS2 added this pull request to the merge queue Oct 16, 2026
Merged via the queue into main with commit 9a1a399 Oct 16, 2026
155 of 157 checks passed
@IceS2
IceS2 deleted the docker-assess-images branch October 16, 2026 13:25
ulixius9 added a commit that referenced this pull request Oct 23, 2026
…om operator images (#35940) (#36052)

* Run the Doris connector on PyMySQL and drop MariaDB from the operator images

pydoris builds on SQLAlchemy's mysqldb dialect, so the operator (ingestion-base)
images shipped mysqlclient and, through it, Debian's libmariadb3 and
mariadb-common. Those two packages carry every MariaDB server CVE (26
High/Critical findings in the 2.0.6 runner scan) although no server is
installed. Doris was the only runtime consumer: every other MySQL-family
connector already uses PyMySQL.

Register a pydoris dialect on PyMySQL for the doris:// scheme, uninstall
mysqlclient in the operator images, purge the MariaDB client packages and fail
the build if any src:mariadb binary survives. The Airflow image keeps
mysqlclient for its own mysql+mysqldb metadata database.

ADR:2026-10-22-doris-connects-through-pymysql-and-images-ship-no-mariadb-client

* Purge libxml2, the Cyrus SASL plugins and librdkafka from the operator images

Debian files 10 more High findings in the 2.0.6 runner scan against packages
nothing in the image loads, with no trixie fix: libxml2 (7; lxml bundles its
own), libsasl2-dev/-modules/-modules-gssapi-mit (3; Hive and Impala use
pure-sasl + kerberos, and the confluent_kafka wheel bundles its own
librdkafka). libsasl2-2 and its sasldb plugin stay for libpq5 -> libldap2;
the DIGEST-MD5 plugin the SASL CVE is in leaves with libsasl2-modules.

dpkg --purge refuses to remove a package something still depends on, where
apt-get -y would remove the dependent silently. A new build step fails if
any native library under site-packages, /opt or /instantclient links one
of the purged libraries.

* Suppress pydoris's inherited reflection-signature mismatch in the PyMySQL Doris dialect

basedpyright (py3.10 static checks) flags 10 reportIncompatibleMethodOverride
errors on DorisPyMySQLDialect: pydoris's DorisDialect declares untyped
reflection methods that clash with SQLAlchemy 2.0's typed MySQLDialect ones.
pydoris's methods are meant to win in the MRO, so the mismatch is inherited,
not ours to fix.

(cherry picked from commit 2765a37)

2.0 backport note: libxml2 and shared-mime-info are not purged here. 2.0's
operator images still install the postgresql server packages, which depend on
libxml2, so dpkg --purge would fail the build (that install was trimmed on main
by #35445). cx_Oracle stays in the import check because 2.0 still ships it.
mohittilala added a commit that referenced this pull request Nov 12, 2026
…37615)

- Ports the operator image part of #35445 to 2.0: only libpq-dev comes from pgdg, and postgresql and postgresql-contrib leave the Debian package list
- The server packages were all that kept libxml2 installed on 2.0, so libxml2 and shared-mime-info are purged again as on main (#35940), with libxml2 back in the ldd check
- libpq-dev stays for the psycopg2 source build and keeps libpq5 installed
- The Airflow images are left as they are, since they install libxml2 directly

This branch was previously deployed

1 inactive deployment
test — bd1037c0 Deployed Oct 16, 2026 by ulixius9 via py-cli-e2e-tests (mysql) #1895
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.

3 participants