Skip to content

Fix PostCommit Python Xlang IO Dataflow job#37712

Open
Amar3tto wants to merge 3 commits intomasterfrom
fix-cibuildwheel
Open

Fix PostCommit Python Xlang IO Dataflow job#37712
Amar3tto wants to merge 3 commits intomasterfrom
fix-cibuildwheel

Conversation

@Amar3tto
Copy link
Collaborator

Fixes #33253
Successful run: https://github.com/apache/beam/actions/runs/22408286727/job/64874345301


Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:

  • Mention the appropriate issue in your description (for example: addresses #123), if applicable. This will automatically add a link to the pull request in the issue. If you would like the issue to automatically close on merging the pull request, comment fixes #<ISSUE NUMBER> instead.
  • Update CHANGES.md with noteworthy changes.
  • If this contribution is large, please file an Apache Individual Contributor License Agreement.

See the Contributor Guide for more tips on how to make review process smoother.

To check the build health, please visit https://github.com/apache/beam/blob/master/.test-infra/BUILD_STATUS.md

GitHub Actions Tests Status (on master branch)

Build python source distribution and wheels
Python tests
Java tests
Go tests

See CI.md for more information about GitHub Actions CI or the workflows README to see a list of phrases to trigger workflows.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @Amar3tto, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request refactors the Python wheel build process by isolating the cibuildwheel setup into its own dedicated virtual environment. This change aims to resolve build inconsistencies and improve the reliability of the PostCommit Python Xlang IO Dataflow job by ensuring cibuildwheel operates within a controlled and pre-configured environment.

Highlights

  • Dedicated Cibuildwheel Virtual Environment: Introduced a new Gradle task, setupCibuildwheelVirtualenv, to create and manage a dedicated Python 3.13 virtual environment specifically for cibuildwheel operations, ensuring consistent tooling versions.
  • Refactored Python Wheel Build Process: Modified the Python wheel distribution (bdistPy) tasks to depend on the newly created setupCibuildwheelVirtualenv task, centralizing the cibuildwheel setup and removing redundant installation commands from the build script.
  • Issue Fix: This pull request addresses and fixes issue The PostCommit Python Xlang IO Dataflow job is flaky #33253, related to the PostCommit Python Xlang IO Dataflow job.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • buildSrc/src/main/groovy/org/apache/beam/gradle/BeamModulePlugin.groovy
    • Added a new project extension cibwEnvdir to define the path for the cibuildwheel virtual environment.
    • Implemented setupCibuildwheelVirtualenv Gradle task to create a Python 3.13 virtual environment and install specific versions of pip, setuptools, and cibuildwheel.
  • sdks/python/build.gradle
    • Removed the cibuildwheel_version variable as its installation is now handled by the new setup task.
    • Updated bdistPy tasks to depend on setupCibuildwheelVirtualenv instead of the general setupVirtualenv.
    • Modified the cibuildwheel execution command to activate the new dedicated virtual environment and removed the inline pip install cibuildwheel step.
Ignored Files
  • Ignored by pattern: .github/workflows/** (1)
    • .github/workflows/beam_PostCommit_Python_Xlang_IO_Dataflow.yml
Activity
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@Abacn
Copy link
Contributor

Abacn commented Feb 25, 2026

Thanks. Do we know which PR has caused

Could not find a version that satisfies the requirement cibuildwheel==3.3.1

Can we simply install it back?

If not possible, could we install the dependency in place, e.g.

def setupCibuildwheelVirtualenv = project.tasks.register('setupCibuildwheelVirtualenv')  {
  project.exec {
            executable 'sh'
            args '-c', ". ${project.ext.envdir}/bin/activate && " +
              "pip install --pre --retries 10 --upgrade pip==25.0.1 --no-cache-dir && " +
              "pip install --retries 10 --upgrade setuptools --no-cache-dir && " +
              "pip install --retries 10 cibuildwheel==3.3.1 --no-cache-dir"
          }
}
setupCibuildwheelVirtualenv.mustRunAfter setupVirtualenv

Maintaining two virtualenv for a single task sounds adding more overhead.

@Amar3tto
Copy link
Collaborator Author

Thanks. Do we know which PR has caused

Could not find a version that satisfies the requirement cibuildwheel==3.3.1

Can we simply install it back?

If not possible, could we install the dependency in place, e.g.

def setupCibuildwheelVirtualenv = project.tasks.register('setupCibuildwheelVirtualenv')  {
  project.exec {
            executable 'sh'
            args '-c', ". ${project.ext.envdir}/bin/activate && " +
              "pip install --pre --retries 10 --upgrade pip==25.0.1 --no-cache-dir && " +
              "pip install --retries 10 --upgrade setuptools --no-cache-dir && " +
              "pip install --retries 10 cibuildwheel==3.3.1 --no-cache-dir"
          }
}
setupCibuildwheelVirtualenv.mustRunAfter setupVirtualenv

Maintaining two virtualenv for a single task sounds adding more overhead.

PR that caused: #37504

@Amar3tto
Copy link
Collaborator Author

I changed dependsOn setupVirtualEnv to dependsOn setupCibuildwheelVirtualenv.
My understanding was that this way we would maintain a single virtual environment. Am I missing something?
Also, setupCibuildwheelVirtualenv is only used here

@Abacn
Copy link
Contributor

Abacn commented Feb 25, 2026

> Task :sdks:python:bdistPy310linux
  INFO:auditwheel.wheeltools:Previous filename tags: linux_x86_64
  INFO:auditwheel.wheeltools:New filename tags: manylinux_2_17_x86_64, manylinux2014_x86_64
  INFO:auditwheel.wheeltools:Previous WHEEL info tags: cp310-cp310-linux_x86_64
  INFO:auditwheel.wheeltools:New WHEEL info tags: cp310-cp310-manylinux_2_17_x86_64, cp310-cp310-manylinux2014_x86_64
  INFO:auditwheel.main_repair:
  Fixed-up wheel written to /tmp/cibuildwheel/repaired_wheel/apache_beam-2.73.0.dev0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
  ERROR: Ignored the following yanked versions: 1.5.3, 1.5.4, 1.10.1, 2.1.0, 2.2.0
  
  ERROR: Could not find a version that satisfies the requirement cibuildwheel==3.3.1 (from versions: 0.1.0, 0.1.2, 0.1.3, 0.2.0, 0.2.1, 0.3.0, 0.4.0, 0.4.1, 0.5.0, 0.5.1, 0.6.0, 0.7.0, 0.7.1, 0.7.2, 0.8.0, 0.9.0, 0.9.1, 0.9.2, 0.9.3, 0.9.4, 0.10.0, 0.10.1, 0.10.2, 0.11.0, 0.11.1, 0.12.0, 1.0.0, 1.1.0, 1.2.0, 1.3.0, 1.4.0, 1.4.1, 1.4.2, 1.5.0, 1.5.1, 1.5.2, 1.5.5, 1.6.0, 1.6.1, 1.6.2, 1.6.3, 1.6.4, 1.7.0, 1.7.1, 1.7.2, 1.7.3, 1.7.4, 1.8.0, 1.9.0, 1.10.0, 1.11.0, 1.11.1, 1.11.1.post1, 1.12.0, 2.0.0a2, 2.0.0a3, 2.0.0a4, 2.0.0b1, 2.0.0b2, 2.0.0, 2.0.1, 2.1.1, 2.1.2, 2.1.3, 2.2.0a1, 2.2.0b1, 2.2.1b1, 2.2.1, 2.2.2, 2.3.0, 2.3.1, 2.4.0, 2.5.0, 2.6.0, 2.6.1, 2.7.0, 2.8.0, 2.8.1, 2.9.0, 2.10.0, 2.10.1, 2.10.2, 2.11.0, 2.11.1, 2.11.2, 2.11.3, 2.11.4, 2.12.0, 2.12.1, 2.12.2, 2.12.3, 2.13.0, 2.13.1, 2.14.0, 2.14.1, 2.15.0, 2.16.0, 2.16.1, 2.16.2, 2.16.3, 2.16.4, 2.16.5, 2.17.0, 2.18.0, 2.18.1, 2.19.0, 2.19.1, 2.19.2, 2.20.0, 2.21.0, 2.21.1, 2.21.2, 2.21.3, 2.22.0, 2.23.0, 2.23.1, 2.23.2, 2.23.3)

I see, this suggests version selection for Python 3.10 https://github.com/apache/beam/pull/37504/changes#diff-538277aecfad235f4cd18a6a6b521b1bea96d34c5a89e8d3b769e766f38e3f14R203 is not working as intended. We should be able to patch there

I would suggest reverting that PR for now.

cc: @jrmccluskey

@jrmccluskey
Copy link
Contributor

There's a reversion out at #37713 now, looks like the 3.10 case isn't working right here. I'd prefer we fix forward since that split has to happen for 3.14 support but if that's going to be a bigger effort we can just put the reversion through

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The PostCommit Python Xlang IO Dataflow job is flaky

3 participants