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

Bump underlying ubuntu to 22.04 LTS #5030

Merged
merged 4 commits into from
Aug 22, 2023
Merged

Conversation

jeffwidman
Copy link
Member

@jeffwidman jeffwidman commented Apr 22, 2022

22.04 LTS dropped yesterday: https://ubuntu.com/blog/ubuntu-22-04-lts-released

I'm not sure of the GitHub internal infra, there may be security/infra reasons blocking
this upgrade that are not visible to external contributors, but thought I'd at least open
this PR to see what CI thinks.

For the Erlang issue, I had to install Erlang from Ubuntu Universe rather than Erlang Solutions.
Unfortunately that means we will probably lag on Erlang versions in the future.

While this isn't ideal from an Erlang perspective, this unblocks the
22.04 upgrade, which is a bigger deal for the other ecosystems.

I'm hopeful this is only a temporary state of affairs and someone from
the community steps up to provide a PR switching to installing from
either the Erlang Solutions PPA or the RabbitMQ PPA.

Related:

@jeffwidman jeffwidman requested a review from a team as a code owner April 22, 2022 18:52
@jeffwidman jeffwidman mentioned this pull request May 21, 2022
@mattt
Copy link
Contributor

mattt commented Jul 12, 2022

@jeffwidman I just merged #5356, which should unblock us from upgrading to LTS. Can you rebase and try again with this PR?

@jeffwidman
Copy link
Member Author

Thanks @mattt, just saw your comment.

Rebased!

jeffwidman added a commit that referenced this pull request Jul 27, 2022
We've been running on `20.04` since #4394, I just didn't realize this actions workflow also pinned the version. So this bumps to our current base image.

Unfortunately, this will likely be outdated in the future again, once #5030 lands... and likely to be an ongoing issue.

I wish there was an easy way to extract this value from the Dockerfile, but everything I come up with seems quite hacky/brittle.
@jeffwidman
Copy link
Member Author

jeffwidman commented Jul 27, 2022

CI failures are because Ubuntu 22.04 uses OpenSSL 3.0, which requires Ruby >= 3.1... see ruby/setup-ruby#333 (comment).

The workaround is to manually compile openssl lib before installing Ruby... but that turns into quite the implementation rabbit-hole: rbenv/ruby-build#1974

Dockerfile Outdated Show resolved Hide resolved
@jeffwidman
Copy link
Member Author

jeffwidman commented Jul 27, 2022

So at this point, due to the problems with Ruby < 3.1 requiring an older OpenSSL than Ubuntu 22.04 ships, we have several options:

  1. manually compile the relevant OpenSSL lib, and then somehow tell our downloaded Ruby how to use it... example: Cannot build rubies 2.6.x, 2.7.x and 3.0.x on Ubuntu 22.04 because they relies on openssl1.1 and Ubuntu now provides openssl3 rvm/rvm#5209 (comment)
  2. Manually add a PPA with a pre-compiled OpenSSL (example), downgrade libSSL, then use that... feels very brittle though... esp given https://bugs.ruby-lang.org/issues/18658#note-2.
  3. bump to Ruby 3.1, we need to do this anyway at some point, not sure how much work it is, or if we'd run into problems with GitHub internal infra... but we might be okay on the infra part since we're silo'd into our own docker image, IDK.
  4. switch to using rbenv/ruby-build since at first glance it will "just work" due to Install openssl whenever the system openssl version is not supported by a Ruby rbenv/ruby-build#1974. However, we originally went with ruby-install instead of ruby-build for some good reasons.
  5. Wait a while, and see what shakes out further in the Ruby ecosystem... most of the open source discussions I've seen are within the past month, so I have a hunch waiting another 3-6 months will result in a bit more clarity/standardization on how others are dealing with this problem. Since I doubt most folks jumping to 22.04 will be willing/able to drop Ruby < 3.1...

Everything I've read so far makes it seem very brittle/painful to manage old OpenSSL versions, so I vote for working towards option 3 which will implicitly result in also picking option 5.

Thoughts?

@jurre
Copy link
Member

jurre commented Jul 27, 2022

I'm all for bumping the ruby version, @mattt's work on using ruby-install unblocks us, I think that's the main reason that we haven't done it yet, it should be a doable upgrade from my experience.

@jeffwidman
Copy link
Member Author

Sounds good to me, I opened #5447 to bump to 3.1.

I think my main concern was that something internal within GitHub tooling that we may use now or in the near future may not be ready to support Ruby 3.1... but I suppose we can always try it and if we run into problems we can revert or push those teams to start providing support for 3.1... Anyway, we'll see how that PR goes.

@jurre
Copy link
Member

jurre commented Jul 29, 2022

GitHub tooling that we may use now or in the near future may not be ready to support Ruby 3.

Most internal things are on the latest or even pre-release versions of ruby and rails, dependabot, a bot that updates your dependencies, being on older versions is a cruel paradox

@jeffwidman jeffwidman self-assigned this Aug 3, 2023
@jeffwidman jeffwidman force-pushed the patch-4 branch 2 times, most recently from 6fb060e to f6887d3 Compare August 22, 2023 05:58
@jeffwidman jeffwidman marked this pull request as ready for review August 22, 2023 05:58
Copy link
Contributor

@deivid-rodriguez deivid-rodriguez left a comment

Choose a reason for hiding this comment

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

Awesome job!

@@ -90,14 +90,14 @@ WORKDIR $DEPENDABOT_HOME/dependabot-updater

# Install Ruby from official Docker image
# When bumping Ruby minor, need to also add the previous version to `bundler/helpers/v{1,2}/monkey_patches/definition_ruby_version_patch.rb`
COPY --from=ruby:3.1.4-bullseye --chown=dependabot:dependabot /usr/local /usr/local
COPY --from=ruby:3.1.4-bookworm --chown=dependabot:dependabot /usr/local /usr/local
Copy link
Member

Choose a reason for hiding this comment

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

We could base the image off of the ruby image and delete this line, and then get Dependabot bumps for it.

Copy link
Member Author

Choose a reason for hiding this comment

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

It's an interesting idea for sure, but I'd rather do it after this PR lands. I considered switching to --from=ruby:3.1.4 since today it's the same as ruby:3.1.4-bookworm but we used to do that and ran into problems when it switched its base debian image under our feet to one that conflicted with our version of Ubuntu used elsewhere... it'd probably be okay if it were the base image, but still let's postpone looking at that to a later PR and here just catch us up to a newer Ubuntu.

@jakecoffman
Copy link
Member

Should we update the Swift Dockerfile to install the 22.04 version?


# When bumping Bundler, need to also regenerate `updater/Gemfile.lock` via `bundle update --lock --bundler`
# Generally simplest to match the bundler version to the one that comes by default with whatever Ruby version we install.
# This way other projects that import this library don't have to futz around with installing new / unexpected bundler versions.
ARG BUNDLER_V2_VERSION=2.4.17

# We had to explicitly bump this as the bundled version `0.2.2` in ubuntu 20.04 has a bug.
# We had to explicitly bump this as the bundled version `0.2.2` in ubuntu 22.04 has a bug.
Copy link
Member

Choose a reason for hiding this comment

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

Does the new version of Ubuntu handle the yaml parsing now? And can we therefore undo this PR

Copy link
Contributor

Choose a reason for hiding this comment

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

Not yet, unfortunately.

Copy link
Member Author

Choose a reason for hiding this comment

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

I wish we could, but we'll need Ubuntu 23.04 before we get a new enough version:

We have a :dependabot: PR to bump to 23.04, but probably should land this PR first, and then also have a conversation about do we even want to bump to non-LTS versions:

@abdulapopoola
Copy link
Member

@abdulapopoola
Copy link
Member

And this spec file too?

@github-actions github-actions bot added the L: swift Swift packages label Aug 22, 2023
@@ -25,7 +25,7 @@ USER dependabot

# https://www.swift.org/download/
ARG SWIFT_VERSION=5.8.1
ARG SWIFT_UBUNTU_VERSION=ubuntu20.04
ARG SWIFT_UBUNTU_VERSION=ubuntu22.04
Copy link
Member Author

Choose a reason for hiding this comment

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

Great catch @jakecoffman , this crept in the last few months, and I completely forgot to re-grep for any new 20.04 references.

@jeffwidman
Copy link
Member Author

Would this need to be updated too?

No, this is just testing a docker tag. In fact better if it test for a tag that isn't our image just to ensure there's no coupling.

And this spec file too?

Same as above, this is just a spec of a user's manifest... so their Ubuntu version shouldn't matter relative to our Ubuntu version.

That said, I really appreciate you and Jake for grep'ing for other references and double-checking this. I completely forgot to look for any others that crept in over the past year.

Install Erlang from Ubuntu Universe rather than Erlang Solutions.
Unfortunately that means we will probably lag on Erlang versions in the
future.

While this isn't ideal from an Erlang perspective, this unblocks the
`22.04` upgrade, which is a bigger deal for the other ecosystems.

I'm hopeful this is only a temporary state of affairs and someone from
the community steps up to provide a PR switching to installing from
either the Erlang Solutions PPA or the RabbitMQ PPA.

See also:
* esl/packages#15
* dependabot#7865
* https://erlangforums.com/t/erlang-solutions-apt-package-for-otp-25/1552/1
* https://erlangforums.com/t/the-eef-is-looking-for-volunteers-to-take-over-esls-build-packages/2238/1
@jeffwidman
Copy link
Member Author

And a year and a half later I can finally hit the 🟢 button! 😁

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Ecosystems Used by the maintainer team for internal-facing project tracking L: elixir:hex Elixir packages via hex L: swift Swift packages
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants