Skip to content

[NOGIL] Wheel creation and verification jobs - #2352

Merged
Ojasva Jain (ojasvajain) merged 6 commits into
masterfrom
dev_thread_free_wheels_ci
Sep 22, 2026
Merged

Ojasva Jain (ojasvajain) merged 6 commits into
masterfrom
dev_thread_free_wheels_ci

Conversation

@ojasvajain

@ojasvajain Ojasva Jain (ojasvajain) commented Sep 8, 2026 •

Copy link
Copy Markdown
Member
  1. Modified existing wheel creation jobs to also create wheels for Python 3.14t.
  2. Defined free threaded wheel verification jobs for all supported platforms. Smoke testing, done as part of verification jobs, executes all unit test cases.
  3. Some unit tests were found to be failing/flaky on Windows. Those have also been fixed.

Successful job run with wheel verification passing: https://semaphore.ci.confluent.io/workflows/680a3b0c-18db-4c97-a66a-499158b0e9ad?pipeline_id=8b6d3812-11d5-4a63-abca-121b2a77a14b


Checklist

  • Contains customer facing changes? Including API/behavior changes
  • Did you add sufficient unit test and/or integration test coverage for this PR?
    • If not, please explain why it is not required

References

JIRA:

Test & Review

Open questions / Follow-ups

@confluent-cla-assistant

Copy link
Copy Markdown

🎉 All Contributor License Agreements have been signed. Ready to merge.
Please push an empty commit if you would like to re-run the checks to verify CLA status for all contributors.

@sonarqube-confluent

Copy link
Copy Markdown

Quality Gate failed Quality Gate failed

Failed conditions
6.1% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube

@k-raina Kaushik Raina (k-raina) left a comment

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.

Thanks for PR! Left couple of comments

# framework gets installed and the cpython314t interpreter is
# never created.
py_version_digits = cpython_tag[2:-1]
choicechanges_xml = os.path.join(script_dir, f"free-threaded-enable-{py_version_digits} .xml")

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.

Suggested change
choicechanges_xml = os.path.join(script_dir, f"free-threaded-enable-{py_version_digits} .xml")
choicechanges_xml = os.path.join(script_dir, f"free-threaded-enable-{py_version_digits}.xml")

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Fixed this.

install_args = f"-applyChoiceChangesXML {choicechanges_xml} "
os.system(f"sudo installer -pkg {tmp_pkg_file_name} {install_args}-target /")

os.system(install_command)

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.

Is this command redundant?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yes, fixed.

set CIBW_BUILD=cp38-%BW_ARCH% cp39-%BW_ARCH% cp310-%BW_ARCH% cp311-%BW_ARCH% cp312-%BW_ARCH% cp313-%BW_ARCH% cp314-%BW_ARCH%
set CIBW_BEFORE_BUILD=python -m pip install delvewheel==1.1.4
set CIBW_BUILD=cp38-%BW_ARCH% cp39-%BW_ARCH% cp310-%BW_ARCH% cp311-%BW_ARCH% cp312-%BW_ARCH% cp313-%BW_ARCH% cp314-%BW_ARCH% cp314t-%BW_ARCH%
set CIBW_BEFORE_BUILD=python -m pip install delvewheel==1.10.0

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.

Why is this change needed?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

The new version of delvewheel excludes python314t.dll from getting vendored in the wheel. The change was introduced in v1.7.3: https://github.com/adang1345/delvewheel/blob/master/CHANGELOG.md#173-6-august-2024 but I upgraded it it to 1.10.0 as it is more recent.

"$PYTHON" -c "import sys, sysconfig; assert sysconfig.get_config_var('Py_GIL_DISABLED'), sys.executable + ' is not a free-threaded build'"

echo "# Importing must not re-enable the GIL"
"$PYTHON" -W error::RuntimeWarning -c "import sys, confluent_kafka; assert not sys._is_gil_enabled(), 'import re-enabled the GIL'"

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.

-W error::RuntimeWarning Will it check all warnings or just GIL warning?

@ojasvajain Ojasva Jain (ojasvajain) Sep 21, 2026 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

All warnings (including GIL). But that should be fine as there are only 2 lines of code that we are executing.

Comment thread .semaphore/semaphore.yml Outdated
- uv venv _venv314t --python 3.14t && source _venv314t/bin/activate
- uv pip install -r requirements/requirements-tests-install-nogil.txt
- artifact pull workflow artifacts
- cd artifacts && ls *.tgz |xargs -n1 tar -xvf && cd ..

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.

Should we fail loudly if there are no artifacts?

@ojasvajain Ojasva Jain (ojasvajain) Sep 21, 2026 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I have added a check for no artifacts in all free-threaded verify jobs.

Comment thread tests/test_Admin.py Outdated
a.elect_leaders(correct_election_type, [correct_partitions]).result(timeout=1)


def _poll_until_callback_raises(admin, timeout_s=5.0, step_s=0.2, ignore=()):

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.

Should we move this to helper? Currently used in test_Consumer.py also

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Thanks, added a helper.

Comment thread .semaphore/semaphore.yml
- export ARCH=x64
# sem-version only provides a pip to bootstrap uv; the wheel runs in the 3.14t venv uv creates.
- sem-version python 3.11
- pip install uv

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.

Should we move common steps to helper script to reduce future maintenance?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Thanks. I created a helper script for linux and macos free threaded verify jobs.

@airlock-confluentinc
airlock-confluentinc Bot force-pushed the dev_thread_free_wheels_ci branch from 90791ad to 0f7c552 Compare September 21, 2026 06:36
Base automatically changed from dev_thread_free_support to master September 21, 2026 10:53
@airlock-confluentinc
airlock-confluentinc Bot force-pushed the dev_thread_free_wheels_ci branch from c394eb1 to a93a0e6 Compare September 22, 2026 06:00

@k-raina Kaushik Raina (k-raina) left a comment

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.

LGTM! Thanks Ojasva Jain (@ojasvajain)
On Nit

Comment thread .semaphore/semaphore.yml Outdated
- artifact pull workflow artifacts
- cd artifacts && ls *.tgz |xargs -n1 tar -xvf && cd ..
- tools/test-wheels.sh artifacts/wheelhouse
- name: Verify (free-threaded)

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.

nit:

Suggested change
- name: Verify (free-threaded)
- name: Verify free threaded

Comment thread .semaphore/semaphore.yml Outdated
- artifact pull workflow artifacts
- cd artifacts && ls *.tgz |xargs -n1 tar -xvf && cd ..
- tools/test-wheels.sh artifacts/wheelhouse
- name: Verify (free-threaded)

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.

Same as above

@sonarqube-confluent

Copy link
Copy Markdown

@ojasvajain
Ojasva Jain (ojasvajain) merged commit d9f08ba into master Sep 22, 2026
4 checks passed
@ojasvajain
Ojasva Jain (ojasvajain) deleted the dev_thread_free_wheels_ci branch September 22, 2026 09:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants