-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Set up GitHub release token for Travis CI #7485
Comments
@aclark4life Please could you look into this? It needs to be done by someone with admin permissions. Thanks! |
@hugovk Sure, level of urgency? |
It would be nice (but not essential) to have it ready for the next quarterly release. |
Actually, we do need this before the next release, otherwise we'll need to do a similar hack to last time by uploading the files to a third-party site instead, and from a security perspective it would be better to avoid that. |
@hugovk OK I'll work on it this week |
@hugovk When you say stuck do you mean this or something else? It's possible I need to make a better token for this task with the appropriate permissions … I have not done that yet. |
Yes, I also got |
I cannot unsee what I've seen here today in working on this … but good news: progress!!
|
@hugovk OK more progress, although I'm not entirely sure why or how, I got
Unfortunately, That said, I did manage to update Pillow's .travis.yml with an encrypted token. If you think that would help, I can commit it on a branch. I ask because
So maybe all it does is edit |
Okay, we might be nearly there... Rather than committing the token, save it in the Travis UI like this:
|
Done, although I didn't escape any of the characters in the secure token string … |
Thanks! Now to figure out how to test it... |
Is it reasonable to test it by just pushing a tag, letting Travis run and then deleting the tag afterwards? |
Yeah, that's sounds good, it will check we trigger on tags properly. Some people might be watching this repo for new tags and releases, so let's use something to make it clear it's a test. |
Ok, I tried, and it "failed to deploy" - more specifically with an error that
I found a suggestion to downgrade to focal, and if I reverted dea5bbe, then I made it to
This is an error that might be generated if the API key is wrong. |
In reviewing the syntax for the various configuration files, I noticed when encrypted tokens were listed, they were listed within a
It was:
Or something like that. I'm not sure if that's an issue here, but it may be worth looking into and trying just to rule it out. |
Instead of Lines 43 to 46 in 0a66b98
I tried
but to no avail. |
Changing tack, we could cut out the middle steps:
And instead upload directly to PyPI from Travis:
This would require creating an API token on PyPI and setting it as a
https://docs.travis-ci.com/user/environment-variables/#defining-variables-in-repository-settings Then use We could try it with TestPyPI first. Travis CI usually finishes before the GitHub Actions wheel build, so the Travis wheels will be uploaded before the sdist and other wheels. This should be fine. What do you think? |
Sure, sounds good if it works. |
I've made an API token on TestPyPI, saved it in our 1Password vault ("Pillow TestPyPI API token"), and tried saving it as Maybe it needs an admin to do it. @aclark4life Please could you add it? |
It doesn't sound that great to me … but I may be missing something. (E.g. things that sound good to me: "No more Travis!") But let me take another close look over the next few days and report back, thanks all. |
I was going to say:
Then I decided to try it out, to see how long it takes now we have cibuildwheel. First, Travis takes ~40 minutes for the longest job: https://app.travis-ci.com/github/python-pillow/Pillow/builds/268090488 The first two creates manylinux wheels for 7 versions (3.8-3.12 + 2xPyPy) and the last musllinux for 5 versions (3.8-3.12). The current GitHub Actions wheel build takes ~10 to ~40 minutes: https://github.com/python-pillow/Pillow/actions/runs/7383669755 I added manylinux and musllinux to GitHub Actions using QEMU emulation. I forgot that Travis actually does two manylinux builds (manylinux_2_17 (aka manylinux2014) and manylinux_2_28), so we're actually missing some in this experiment, but let's come back to that. I used a matrix, so each job ran for a single Python version and created 1 manylinux (by default manylinux_2_17) and 1 musllinx wheel (except PyPy which doesn't have musllinux so had a single manylinux). The 7 QEMU jobs took 2-3 hours: https://github.com/hugovk/Pillow/actions/runs/7387963337 Next, also split so each job does a single Python version and manylinux OR musllinux (except only manylinux for PyPy). The 12 QEMU jobs took 1.5-2 hours: https://github.com/hugovk/Pillow/actions/runs/7390943205 Is this an acceptable cost? We ditch Travis CI (40 minutes) and use GitHub Actions (2 hours)? Note this the human waiting time, making use of parallel builds, the actually CPU time used is much greater. As mentioned, I forgot manylinux_2_28 in this experiment. Do we actually need wheels for both manylinux_2_17 and manylinux_2_28? If so, this would add another 7 jobs to GHA, I expect also taking 1.5-2 hours. We'd have 19 QEMU jobs taking 1.5-2 hours + 7 native jobs taking 10-40 mins. We get max 20 parallel jobs, so it would be fully saturated meaning some have to wait to be started, and so maybe take 2.5-3 hours for the whole thing. |
I'm willing to deal with the additional time, sure.
manylinux_2_28 was added in python-pillow/pillow-wheels#301, to allow for zlib 1.2.12 on newer operating systems, whereas manylinux_2_17 only allowed for zlib 1.2.8. The reason for keeping manylinux_2_17 around was to support CentOS 7 (EOL June 30) and Amazon Linux 2 (EOL June 30, 2025). |
AL2 is what we'd need for Lambda and Elastic Beanstalk. |
Off-topic aside: I'm in favour of waiting until Amazon Linux 2 (and CentOS 7) are EOL - but there is a more recent AWS alternative for users in the form of Amazon Linux 2023. |
It looks like 3.8 and below are AL2, and 3.9+ are AL2023 for EB (https://docs.aws.amazon.com/elasticbeanstalk/latest/platforms/platform-history-python.html) , and 3.11 and below are AL2 for Lambda (https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html) |
So, given CentOS 7 EOL is 2024-06-30, potentially we can forget about AL2 when Python 3.8 is EOL (2024-10-14), meaning we can drop manylinux_2_17 at the same time. That would mean we have both manylinuxes for the next release in July, and just one for the following release in October. |
No, because Lambda is using AL2 for 3.11. And we certainly get enough questions about how to install on Lambda to know that it's something that people use. |
RIP AL2. Long live AL2023. (AL2 stops at Python 3.8. AL2023 supports up to 3.11) |
Please see PR #7690 to replace Travis native builds with GHA emulated builds. |
For #7390.
Re: #7348 (comment), python-pillow/pillow-wheels#156 (comment).
We need to set up a token for Travis CI to be able to upload wheels to this repo's release section.
GITHUB_RELEASE_TOKEN
at https://app.travis-ci.com/github/python-pillow/pillow/settings.The text was updated successfully, but these errors were encountered: