Skip to content

Add Python 3.10 drop 3.5#26074

Merged
lidizheng merged 13 commits intogrpc:masterfrom
lidizheng:python-3.10.0
Sep 2, 2021
Merged

Add Python 3.10 drop 3.5#26074
lidizheng merged 13 commits intogrpc:masterfrom
lidizheng:python-3.10.0

Conversation

@lidizheng
Copy link
Copy Markdown
Contributor

@lidizheng lidizheng commented Apr 23, 2021

This PR includes:

  1. Adding Python 3.10 binary wheels to macOS/Linux/Windows
  2. Install 3.10 in Windows and macOS, and use a newer "manylinux2014" (I didn't noticed a tag was added, causing the script content hash mismatch with my local build, and failing artifacts build job)
  3. Dropping Python 3.5 binary wheel compilation, and updating READMEs
  4. Updating Python build script to avoid using the wrong pip
  5. Remove ubuntu1604 from our distribtests since its default Python 3 is 3.5
  6. Fix the invalid command: bdist_wheel error on macOS with 3.10
  7. Use "manylinux_2_17" instead of "manylinux2014" since it has higher priority in latest auditwheel (one is just an alias of another)
  8. In latest wheel, "manylinux2014" has higher priority than "manylinux_2_17". This PR let auditwheel decide the wheel name, and let wheel be a tool to pack/unpack wheels.
  9. Upgraded the Debian image from stretch to buster for binary wheel installation test (the compile-from-source test is still jessie)

Given the complex details generated around changing supported Python versions, we might not in a stage of automating this once-per-year task.


This change is Reviewable

@lidizheng lidizheng added lang/Python release notes: yes Indicates if PR needs to be in release notes labels Apr 23, 2021
@stale
Copy link
Copy Markdown

stale bot commented Jul 23, 2021

This issue/PR has been automatically marked as stale because it has not had any update (including commits, comments, labels, milestones, etc) for 30 days. It will be closed automatically if no further update occurs in 7 day. Thank you for your contributions!

@lidizheng
Copy link
Copy Markdown
Contributor Author

Compiling with a manylinux2014 image but the binary wheel demands manylinux_2_17 or above?

+ auditwheel show dist/grpcio-1.41.0.dev0-cp36-cp36m-linux_x86_64.whl
+ tee /dev/stderr
+ grep -E -w manylinux2014_x86_64

grpcio-1.41.0.dev0-cp36-cp36m-linux_x86_64.whl is consistent with the
following platform tag: "manylinux_2_17_x86_64".

The wheel references external versioned symbols in these
system-provided shared libraries: librt.so.1 with versions
{'GLIBC_2.2.5'}, libm.so.6 with versions {'GLIBC_2.2.5'},
libpthread.so.0 with versions {'GLIBC_2.2.5', 'GLIBC_2.12'},
libstdc++.so.6 with versions {'GLIBCXX_3.4.18', 'GLIBCXX_3.4.11',
'GLIBCXX_3.4.9', 'GLIBCXX_3.4.15', 'GLIBCXX_3.4.14', 'CXXABI_1.3.5',
'GLIBCXX_3.4', 'CXXABI_1.3', 'GLIBCXX_3.4.17'}, libc.so.6 with
versions {'GLIBC_2.9', 'GLIBC_2.3.2', 'GLIBC_2.2.5', 'GLIBC_2.3',
'GLIBC_2.6', 'GLIBC_2.10', 'GLIBC_2.16', 'GLIBC_2.7', 'GLIBC_2.4'}

This constrains the platform tag to "manylinux_2_17_x86_64". In order
to achieve a more compatible tag, you would need to recompile a new
wheel from source on a system with earlier versions of these
libraries, such as a recent manylinux image.

@lidizheng lidizheng marked this pull request as ready for review August 31, 2021 23:45
Copy link
Copy Markdown
Contributor

@gnossen gnossen left a comment

Choose a reason for hiding this comment

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

Nice work!

# Thanks to that, wheel build with this image aren't actually
# compliant with manylinux2014, but only with manylinux_2_24
FROM dockcross/manylinux2014-aarch64:20200929-608e6ac
FROM dockcross/manylinux2014-aarch64:20210826-19322ba
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It definitely sounds like updating the the image tag here would require updating the above comment as well.
Based on my knowledge, if you used a newer version of image than 20200929-608e6ac, you won't be able to build (precisely because of what's decribed in the comment).

Copy link
Copy Markdown
Contributor Author

@lidizheng lidizheng Sep 1, 2021

Choose a reason for hiding this comment

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

Currently, all artifacts building jobs are green. The Linux Python artifacts build includes the aarch64 platform. Does this mean by using this tag (20210826-19322ba) we are free from the commented issue?

We might still need the AUDITWHEEL_PLAT override. I don't have enough context around this issue. What do you think I should update in the comment section?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Ok, so the background is a bit complicated.

So, as a result:

  • what you currently have works, just the comment "We use an older version of dockcross image..." is now out of date.
  • the wheels generated by this image now are actually manylinux_2_17 compliant (not just manylinux_2_24). So in a followup PR, we could actually update the docker image name and some other details. But let's not do this here as what you currently have seems to be working just fine.

# Use a tagged version to use Python 3.5
FROM quay.io/pypa/manylinux2014_x86_64:2021-05-01-28d233a
# Use a tagged version to use Python 3.10
FROM quay.io/pypa/manylinux2014_x86_64:2021-08-26-12e5da0
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Lidi, you don't need to use a tag version here. Just quay.io/pypa/manylinux2014_x86_64 would be better because we can get the latest image once actual python 3.10 is released.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Doesn't this open us up to non-hermetic breakage?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@veblush I think when a newer upstream Docker image is released, it would be better if we can write a PR for it. We still need to manually build and push the images.

As Richard mentioned, if a certain image version introduce a breakage, it could be hard to debug.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

+1 to tagging the version and making tests more hermetic that way.

Copy link
Copy Markdown
Contributor

@veblush veblush left a comment

Choose a reason for hiding this comment

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

Thank you for taking care of this!

Copy link
Copy Markdown
Contributor

@jtattermusch jtattermusch left a comment

Choose a reason for hiding this comment

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

Added some clarifications, the aarch64 wheel seems to be working fine, but we might want a small followup cleanup PR after this gets merged.

# Use a tagged version to use Python 3.5
FROM quay.io/pypa/manylinux2014_x86_64:2021-05-01-28d233a
# Use a tagged version to use Python 3.10
FROM quay.io/pypa/manylinux2014_x86_64:2021-08-26-12e5da0
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

+1 to tagging the version and making tests more hermetic that way.

# Thanks to that, wheel build with this image aren't actually
# compliant with manylinux2014, but only with manylinux_2_24
FROM dockcross/manylinux2014-aarch64:20200929-608e6ac
FROM dockcross/manylinux2014-aarch64:20210826-19322ba
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Ok, so the background is a bit complicated.

So, as a result:

  • what you currently have works, just the comment "We use an older version of dockcross image..." is now out of date.
  • the wheels generated by this image now are actually manylinux_2_17 compliant (not just manylinux_2_24). So in a followup PR, we could actually update the docker image name and some other details. But let's not do this here as what you currently have seems to be working just fine.

@lidizheng lidizheng merged commit 4729f6f into grpc:master Sep 2, 2021
@copybara-service copybara-service bot added the imported Specifies if the PR has been imported to the internal repository label Sep 2, 2021
lidizheng added a commit to lidizheng/grpc that referenced this pull request Sep 23, 2021
* Add Python 3.10.0rc1 binary wheels

* Drop Python 3.5 artifacts

* Document the drop of 3.5

* Fix the wrong pip pointer

* Update manylinux2014 to a newer version, remove 3.5 distribtest

* Update manylinux aarch64 to see if the absl error go away

* Use the preferred alias

* Allow different wheel library to produce different tag order

* Remove unused shell var and log produced wheels

* Use copy instead of move

* Make bash happy about the wildcard

* Upgrade the debian image to use 3.5+ Python

* Polish the comments for the Dockerfiles
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

disposition/never stale imported Specifies if the PR has been imported to the internal repository lang/Python release notes: yes Indicates if PR needs to be in release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants