Repository navigation
build(ingestion): trim runtime dependencies and update clients - #35445
Conversation
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. VerificationRules No rules evaluated Functional validation Not enabledAuto-approval Not enabledFor more verification details, comment OptionsDisplay: compact → Showing compact verification results. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
❌ PR checklist incompleteThis PR cannot be merged until the following are addressed on its linked issue:
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 |
| && 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" |
There was a problem hiding this comment.
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!
|
…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.
…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



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
High-level design
libpq5, MariaDB and compiler/OpenMP runtime libraries from automatic removal, and check native imports afterward. Preserve current main's optional classification-model installation.redshift-connectorpackage after Amazon-provider pruning; OpenMetadata's Redshift path uses psycopg2.>=1.43.101,<2and aiobotocore to~=3.9.2together. Replaceelasticsearch8~=8.9.0withelasticsearch>=8.19.3,<9and update the two datasource imports. Add a search-test package marker to prevent the test directory from shadowing the standard Elasticsearch module during collection.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 maind099f6f553.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/: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
cbd9538d0cplus the cleanup, before carrying it onto current main.Checklist
Draft pending the remaining release and integration gates above.
The reviewed code appears safe to merge, with a non-blocking improvement to the Airflow native-driver check.
Findings
Summary
This PR removes unused database packages and adds late build-tool cleanup while retaining native drivers’ shared libraries. It also:
boto3andaiobotocoreversions.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