Skip to content
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

Use matrix to add Bookworm jobs to CI #1555

Merged
merged 5 commits into from
Sep 26, 2022
Merged

Use matrix to add Bookworm jobs to CI #1555

merged 5 commits into from
Sep 26, 2022

Conversation

legoktm
Copy link
Member

@legoktm legoktm commented Sep 1, 2022

Description

🔮 Reviewers: Taking a look at the CI pipelines for each commit should give you context on the next commit. 🙂

Add bookworm jobs to CI. These jobs will not be marked as required, as it is expected that they will sometimes fail.

Closes #1545

Test plan

  • CI looks reasonable (Bookworm jobs are not necessarily passing, but Bullseye jobs must be passing)
  • It is OK to update PyQt5-sip from 12.8.1 to 12.9.0 (Do we need to match the system version?)
  • It is OK to update alembic from 1.0.2 to 1.1.0

@legoktm
Copy link
Member Author

legoktm commented Sep 1, 2022

Most of the bookworm failures are because we are currently pinned to an old version of pyqt5-sip that did not upload Python 3.10 wheels: https://pypi.org/project/PyQt5-sip/12.8.1/#files

Either we install a build toolchain in each job (build-essential python3-dev) so we can build this from source, or we update to a newer version of pyqt5-sip that has 3.10 wheels. The very next version, 12.9.0, looks to be the first that will work.

@gonzalo-bulnes
Copy link
Contributor

Thank you for troubleshooting @legoktm!

My personal inclination would be to upgrade dependencies (in this case pyqt5-sip) in the spirit of reducing complexity and more generally following upstream updates.

That being said, I think @creviera may have thoughts on this and pyqt5-sip in particular? (Maybe I'm wrong!)

Copy link
Contributor

@gonzalo-bulnes gonzalo-bulnes left a comment

Choose a reason for hiding this comment

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

The CI config is looking great! Thank you for also DRYing the nightlies definition significantly.

I take note that blocks can be named inline where they're used for the first time! 💡

In the package upgrade, I'm thinking of performing the necessary upgrades in a separate PR once we've got them identified, so that this PR doesn't get cluttered by package changes. I'm happy to look into that from the pyqt5-sip pointer next week. : )

@gonzalo-bulnes
Copy link
Contributor

Heads up @legoktm, I've added one job in #1556. It stands alone, so shouldn't b difficult to integrate to the matrix.

@legoktm
Copy link
Member Author

legoktm commented Sep 6, 2022

Ack, rebasing on top of that now...

@gonzalo-bulnes
Copy link
Contributor

gonzalo-bulnes commented Sep 6, 2022

I started looking into which dependencies need upgrade for Bookworm jobs to pass.

  • Using pyqt5-sip==12.9.0 makes some good progress...
  • ...but Alembic migrations don't seem happy for some reason in Bookworm. (example in CircleCI)

Edited to add:

  • Using alembic==1.1.0 clears the remaining test suite errors 👍 (example in CircleCI)
  • It requires building wheels (both in Bullseye and Bookworm)
  • I haven't checked the change log or assessed suitability for the Client ⚠️

Back to pyqt5-sip: the current version was chosen to match the one shipped with Bullseye. I'm not sure if that is a convenience choice or a actual requirement. I believe we rely on system packages, and that it's the latter, in which case we might want to create separate requirement files for Bookworm. 🌵

@legoktm
Copy link
Member Author

legoktm commented Sep 7, 2022

Re: alembic, we probably need this fix: https://alembic.sqlalchemy.org/en/latest/changelog.html#change-5681bfa8b70eb750d3060b4541fa1662

@gonzalo-bulnes
Copy link
Contributor

The testing requirements in Bookworm has to do with differing Python versions. I've added make targets for Bookworm... but I realize that goes against the idea of using a matrix to run the same list of jobs under different Python versions : / (That means maybe we'll want to remove the dev-bookworm-requirements target from the Makefile.)

With that in mind, and looking at the CI failure: maybe we should ignore the comments when comparing requirements files, what do you think @legoktm ?

@gonzalo-bulnes
Copy link
Contributor

gonzalo-bulnes commented Sep 21, 2022

Re-running the CI pipeline after freedomofpress/securedrop-builder#379 has been merged should make it green 🍏

I think our automated testing coverage of the database aspects of the code should be enough to upgrade alembic with confidence. With that being said, we should still perform a diff review on the package shouldn't we @creviera @rocodes ?

@gonzalo-bulnes
Copy link
Contributor

@legoktm Let's clean up this branch before marking it as ready for review:

  • we've got your commit labelled as WIP
  • and a few of mine can be squashed (e.g. I added then removed Bookworm-specific files)

@gonzalo-bulnes
Copy link
Contributor

I'll take on the opportunity of updating the PR to do the cleaning.

@gonzalo-bulnes gonzalo-bulnes force-pushed the matrix-ci branch 2 times, most recently from 2c662ad to 02e5ef6 Compare September 21, 2022 06:28
@gonzalo-bulnes gonzalo-bulnes changed the title WIP: Use matrix to add bookworm jobs to CI Use matrix to add Bookworm jobs to CI Sep 21, 2022
@gonzalo-bulnes gonzalo-bulnes marked this pull request as ready for review September 21, 2022 07:07
@gonzalo-bulnes gonzalo-bulnes requested a review from a team as a code owner September 21, 2022 07:07
Copy link
Contributor

@gonzalo-bulnes gonzalo-bulnes left a comment

Choose a reason for hiding this comment

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

A couple of question for you @creviera (and maybe @rocodes too!):

  • We're updating PyQt5-sip from 12.8.1 to 12.9.0 - which is the first to support Python 3.10 but is not the system version under Debian Bullseye. Any thoughts?
  • Should we perform a diff review for alembic that we upgraded too? (From 1.0.2 to 1.1.0, which doesn't worry me functionally, I think our automated test suite covers that well.)

Subsidiary question: what stops us from shipping the Qt dependencies like any other? Why do we use system packages? (I know you've told me but I forgot! 😬) Related to #1562

@gonzalo-bulnes
Copy link
Contributor

I had a chat with @creviera.

We use system PyQt because:

  • PyQt version needs to be very closely matched with the underlying Qt (C++) version
  • the underlying Qt (C++) library is large, and wasn't easy to compile, which made shipping it with the Client unappealiing

With that in mind @legoktm, I think we've got a few options:

  1. Ship this PR without the PyQt5-sip upgrade, and have the Bookworm jobs fail for the foreseeable future 💀
  2. Ship custom requirements files for Bookworm like we used to for Buster (and loose the matrix config improvements 💀)
  3. Ship distinct requirements files for Bookworm/Bullseye and make the specific jobs that require them aware of the distinction, like you suggested yesterday @legoktm. That's my favorite option. (We could even base the Bookworm file on the Bullseye ones to avoid duplication where possible.)

Any of these options would allow us to ship this PR with a green pipeline. 🍏


We also should have performed a diff review of alembic 1.1.0 before adding the wheel! (I'm following up on that in the relevant repo.)

@legoktm
Copy link
Member Author

legoktm commented Sep 21, 2022

All makes sense. In your list 3 is my preferred option as well, but I'd also be okay with 1 in the short-term while we work on 3.

@gonzalo-bulnes
Copy link
Contributor

I'll remove the commit that upgrades PyQt5-sip so that @creviera can review this PR. And we can manage the Bookworm failures in a separate PR 🙂

Different versions of Python generate different comments in
the requirement files, either because some indirect dependencies
may change or because the version of Python itself is recorded.

Those changes have no effect on the reproduction of the environment
and can be safely ignored.
@gonzalo-bulnes
Copy link
Contributor

(removed) To be clear: the CI pipeline will be read, but all the required jobs (a.k.a the "Bullseye"" jobs) will be green. 🍏

@gonzalo-bulnes gonzalo-bulnes added the ⚙️ Tooling Improving maintainability and increasing maintainer joy : ) label Sep 26, 2022
Copy link
Contributor

@sssoleileraaa sssoleileraaa left a comment

Choose a reason for hiding this comment

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

Accepting the failing tests temporarily as you work on a separate bookworm requirements PR works for me too. I see you did a diff review for alembic (freedomofpress/securedrop-builder#379 (comment)) ✔️, code changes look good to me ✔️, and the config file looks much cleaner now 🎉. Nice teamwork @gonzalo-bulnes and @legoktm :) 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
⚙️ Tooling Improving maintainability and increasing maintainer joy : )
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Our CI pipeline should include jobs for the next Debian release
3 participants