flink icon indicating copy to clipboard operation
flink copied to clipboard

[FLINK-34487][ci] Adds Python Wheels nightly GHA workflow

Open morazow opened this issue 11 months ago • 24 comments

What is the purpose of the change

Integrates Python Wheels build into the GitHub Actions (GHA) nightly workflow.

Brief change log

  • Adds Python Wheels GHA workflow, template.python-wheels-ci.yml
  • Integrates the Python Wheels workflow to the nightly GHA workflow

Verifying this change

This changes does not change code.

But the successful nightly GHA run should verify the change.

Does this pull request potentially affect one of the following parts:

  • Dependencies (does it add or upgrade a dependency): no
  • The public API, i.e., is any changed class annotated with @Public(Evolving): no
  • The serializers: no
  • The runtime per-record code paths (performance sensitive): no
  • Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Kubernetes/Yarn, ZooKeeper: no
  • The S3 file system connector: no

Documentation

  • Does this pull request introduce a new feature? no

morazow avatar Mar 01 '24 10:03 morazow

CI report:

  • 38ac752c1e8abce741850b4b4b852311946b18c1 UNKNOWN
  • 874064f5cd38098cfd55ac584c589fe7cf297d63 Azure: SUCCESS
Bot commands The @flinkbot bot supports the following commands:
  • @flinkbot run azure re-run the last Azure build

flinkbot avatar Mar 01 '24 10:03 flinkbot

fyi: I won't be responsive till the end of April at least

XComp avatar Apr 03 '24 07:04 XComp

Thanks @XComp, I am going to address your suggestions. Please have a look once you are back

morazow avatar Apr 08 '24 03:04 morazow

@flinkbot run azure

morazow avatar May 18 '24 15:05 morazow

Thanks @XComp, going through your suggestions, I will address them, thanks 👍

No indeed, I am going to squash them, it should be single commit in the end

morazow avatar May 22 '24 11:05 morazow

Thanks @XComp, I have addressed your findings, please have a look.

I used Python version 3.9 since it was in the Azure pipelines, let me know if we need to change it. Separated also the workflow stringify to another action, please have a look

morazow avatar May 22 '24 12:05 morazow

Test run of Python wheel build: https://github.com/morazow/flink/actions/runs/9207285570

morazow avatar May 23 '24 12:05 morazow

Artifacts from new nightly run:

Screenshot 2024-05-23 at 17 21 10

morazow avatar May 23 '24 15:05 morazow

Hey @XComp, @HuangXingBo ,

What do you think of the latest commit changes for migration?

This way both Linux & MacOS platform use similar build system, we also don't depend on bash script on Linux. All the wheel build requirements are defined in the pyproject.toml (python versions, architecture, etc) that are used for both platforms.

For Linux I had to add manylinux2014 version since manylinux1 does not support python3.10+ versions.

Please let me know what you think

morazow avatar May 24 '24 12:05 morazow

Test run built wheel artifacts: https://github.com/morazow/flink/actions/runs/9224143298

morazow avatar May 24 '24 13:05 morazow

Hey @XComp, could you please have look to the PR?

morazow avatar May 27 '24 12:05 morazow

I downloaded the wheel package from https://github.com/morazow/flink/actions/runs/9224143298 and found that the wheel package for Linux is manylinux2014, not manylinux1, which may cause it to fail to install on some old machines. I used dev/glibc_version_fix.sh and patchelf in build-wheels.sh to solve this problem previously.

HuangXingBo avatar Jun 07 '24 08:06 HuangXingBo

Thanks @HuangXingBo for the update!

I have changed the GitHub actions to run the auditwheel repair after installing patchelf in Linux. Could you please have another look?

You can find the build wheel artifacts for this change here: https://github.com/morazow/flink/actions/runs/9464510932

morazow avatar Jun 11 '24 11:06 morazow

Thanks @morazow for the update. I downloaded the wheel package and found that the wheel package after repair is manylinux_2_5. It may be related to not using dev/glibc_version_fix.sh. If the version of glibc is too new, it is impossible to generate manylinux1 package.

HuangXingBo avatar Jun 14 '24 01:06 HuangXingBo

Thanks @HuangXingBo for the feedback!

Should we still support manylinux1? It seems already end of life for some years

morazow avatar Jun 14 '24 10:06 morazow

@morazow Since a lot of our dependencies are manyLinux2014, I think we can indeed build manyLinux2014.

HuangXingBo avatar Jun 16 '24 02:06 HuangXingBo

Hello @HuangXingBo, thanks for the feedback!

Is the current state fine? It uses the manylinux2014 for Linux:

[tool.cibuildwheel.linux]
archs = ["x86_64"]
manylinux-x86_64-image = "manylinux2014"

Should I also keep the auditwheel steps?

morazow avatar Jun 18 '24 07:06 morazow

@morazow I am not sure whether our wheel package can be manylinux2014 without auditwheel. We can try to remove auditwheel to see the effect

HuangXingBo avatar Jun 18 '24 09:06 HuangXingBo

Hey @HuangXingBo,

I think one of the runs above was with manylinux2014 and without auditwheel step. But I will do another workflow run to create the wheels. I'll let you know

morazow avatar Jun 18 '24 10:06 morazow

Hey @HuangXingBo,

I have run two builds, one is with default using auditwheel (together with patchelf) and another without auditwheel. Both on the manylinux2014 on Linux.

  • With auditwheel: https://github.com/morazow/flink/actions/runs/9566314731
  • Without auditwheel: https://github.com/morazow/flink/actions/runs/9566526379

I also updated the build workflow to make explicit some of the steps, previously it was running auditwheel by default on linux.

morazow avatar Jun 18 '24 20:06 morazow

@morazow Thanks a lot for the experiment. It seems that we really need auditwheel, otherwise we can't generate manylinux packages.

HuangXingBo avatar Jun 19 '24 02:06 HuangXingBo

Hey @HuangXingBo, thanks for looking into it 👍

I have added the auditwheel repair step and rebased. Please have a final look if all is fine.

morazow avatar Jun 19 '24 12:06 morazow

Thanks for your help @HuangXingBo and @morazow for your persistence. :-) Code-wise, I'm fine after @HuangXingBo approved the functionality. 👍

@morazow can we get a final test run of the workflow in your fork (feel free to comment the extraneous parts of the workflow out in the debug commit)? We have to wait for the release branch cutting anyway.

XComp avatar Jun 20 '24 06:06 XComp

Hey all,

Indeed, it took many conversations :)) But it was helpful collaborations! Thank a lot!

@XComp yes, this is the run with only Python wheel build: https://github.com/morazow/flink/actions/runs/9595245039. I will drop the comment commit and rebase once it is okay from your side also 👍

morazow avatar Jun 20 '24 10:06 morazow

Thanks for the contribution, @morazow . I removed the extra commit and will go ahead with merging the PR. I guess we don't need to create backports for this kind of change because the nightlies are triggered from master. 🤔

But let's verify this with the nightly runs tomorrow.

XComp avatar Jul 02 '24 15:07 XComp

Great, thanks @XComp, @HuangXingBo for the help 👍

morazow avatar Jul 03 '24 06:07 morazow