Skip to content

CASSANDRA-20997: Upgrade testing docker image to Ubuntu 22.04 and add Python 3.12/3.13 support#127

Open
arvindKandpal-ksolves wants to merge 1 commit intoapache:trunkfrom
arvindKandpal-ksolves:CASSANDRA-20997-python3.13-docker
Open

CASSANDRA-20997: Upgrade testing docker image to Ubuntu 22.04 and add Python 3.12/3.13 support#127
arvindKandpal-ksolves wants to merge 1 commit intoapache:trunkfrom
arvindKandpal-ksolves:CASSANDRA-20997-python3.13-docker

Conversation

@arvindKandpal-ksolves
Copy link
Copy Markdown

Motivation and Context

To support Python 3.12 and 3.13 for cqlsh testing (CASSANDRA-20997), the base testing docker image (ubuntu2004_j11.docker) needed an upgrade to Ubuntu 22.04 (Jammy). However, upgrading to Jammy completely broke the legacy Python 3.6 build due to incompatibilities with modern toolchains (OpenSSL 3.0 and Glibc 2.35). Additionally, modern versions of pip and setuptools break the legacy cassandra-driver and ccm dependency installations.

This PR upgrades the image while surgically retaining full support for all older Python environments (including 3.6) so that we don't have to split the testing images between trunk and cassandra-5.0.

Description of Changes

  • Base OS Upgrade: Upgraded base image from ubuntu:20.04 to ubuntu:22.04.
  • Python 3.6 Blockers Resolved: * Installed gcc-9 and compiled OpenSSL 1.1.1w from source to bypass Jammy's OpenSSL 3.0 clash.
    • Applied a sed patch to Modules/faulthandler.c to hardcode SIGSTKSZ, fixing the Glibc 2.35 compilation error.
  • Python 3.12 & 3.13 Support Added: Added modern environments while bypassing the removed distutils library.
  • Dependency Matrix Locked: * Pinned "pip<25.0" and "setuptools==60.8.2" across 3.11+ environments to maintain compatibility with legacy editable installs (setup.py develop) and ccm flat-layout structures.
    • Injected a dummy pkgutil.ImpImporter via a surgical sed patch to fix setuptools internal crashes on Python 3.12+ (where the imp module is entirely removed).

Testing

  • Successfully built the docker image locally.
  • Verified that all virtual environments (env2.7 through env3.13) initialize successfully without hanging.
  • Verified that all dependencies, including cassandra-driver (via git clone) and ccm, install and compile successfully across all environments.

patch by Arvind Kandpal; for CASSANDRA-20997

Copy link
Copy Markdown
Member

@michaelsembwever michaelsembwever left a comment

Choose a reason for hiding this comment

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

would need a new file name and tagging…

@@ -46,13 +73,18 @@ RUN update-alternatives --install /usr/bin/python python /usr/bin/python3.6 2
RUN update-alternatives --install /usr/bin/python python /usr/bin/python3.7 3
RUN update-alternatives --install /usr/bin/python python /usr/bin/python3.8 4
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

missing 3.10

… Python 3.12/3.13 support

Details:
- Upgraded base image from ubuntu:20.04 to ubuntu:22.04.
- Fixed Python 3.6 compilation on Jammy by building OpenSSL 1.1.1w from source with gcc-9.
- Applied sed patch for SIGSTKSZ to fix Glibc 2.35 compatibility for Python 3.6.
- Added Python 3.12 and 3.13 environments.
- Pinned pip<25.0 and setuptools==60.8.2 to maintain compatibility with legacy editable installs and ccm.
- Added dummy pkgutil.ImpImporter injection to fix setuptools crashes on Python 3.12+.
@arvindKandpal-ksolves arvindKandpal-ksolves force-pushed the CASSANDRA-20997-python3.13-docker branch from 8cd92e2 to ec4a897 Compare March 26, 2026 10:28
@arvindKandpal-ksolves
Copy link
Copy Markdown
Author

@michaelsembwever , I completely missed that one.

I just pushed an update with the 3.10 fix. While I was at it, I followed your lead from the in-tree images and renamed the files to be generic (ubuntu_j11.docker and ubuntu_j11_w_dependencies.docker).

I've also updated all the scattered references across the repo (README, Jenkins groovy scripts, etc.) to use the new generic tags, and verified that the image builds cleanly on my end.

Let me know if I missed anything else!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants