jupyterhub / systemdspawner

Spawn JupyterHub single-user notebook servers with systemd
BSD 3-Clause "New" or "Revised" License
92 stars 45 forks source link

Require a minimum systemd version ? #116

Closed consideRatio closed 1 year ago

consideRatio commented 1 year ago

As part of releasing 1.0.0, I think we should check the systemd version and fail if its not above a lower limit. If we for example require systemd 235+ then all SystemdSpawner's existing config features are supported, and we have a lower version to run test againsts.

List of systemd versions with various linux distributions: https://repology.org/project/systemd/versions

I suggest we declare a lower bound on 237 at least and slim down the readme file to just say that is required at least, then we also test against ubuntu 18.04's systemd versioned 237.

Related

Current README notes

Systemd Spawner requires you to use a Linux Distro that ships with at least systemd v211. The security related features require systemd v228 or v227. We recommend running with at least systemd v228. You can check which version of systemd is running with:

$ systemctl --version | head -1
systemd 231
manics commented 1 year ago

Can we add Centos or other RHEL clone to that list?

yuvipanda commented 1 year ago

+1 to 237

consideRatio commented 1 year ago

@manics I added centos and rocky, where their v8 v9 aligned with the systemd version used.

If we require 237+, then systemdspawner 1.0.0 would work in ubuntu 18+ centos/rocky 8+, fedora 28+, debian 10+. I think this is acceptable.

behrmann commented 1 year ago

I'd recommend being less conservative.

Old Fedora releases don't matter, since Fedora only supports an old release for a few months after a new release is made. Anything older than Fedora 36 go into the calculation. Debian 10 has reached EoL last August and is currently in LTS until next June. Since the release of Debian 12 will be in two weeks, I'd recommend looking at that either.

The pertinent point pushing you to 237 would be Ubuntu 18.04 LTS, though. It reached EoL last month.

While 239 is ancient, it's still better than 237. :)

consideRatio commented 1 year ago

Happy to see you chime in @behrmann!!

Okay here are some lower bounds of relevance:

For reference, note that the TLJH distribution of jupyterhub is helping out testing systemdspawner, and does so with what its compatible with - debian 11+ and ubuntu 20.04+.

I think if we increase the requirement, the key value is that we can more easily ensure we successfully test the lower bound. Setting up very old test environments are far harder than setting up new ones based on my experience doing this for centos7 etc in the dask/dask-gateway project.

Not being a user of this project besides via being a maintainer for the TLJH distribution of jupyterhub that makes use of it, i favor a high lower bound overall.

Suggestion

We fail on <237 (EDIT: <235 is known to not support all features, lets go with that), and warn on <245 that this project is only ensuring support for 245+.

behrmann commented 1 year ago

Sounds sensible to me.

consideRatio commented 1 year ago

@manics @yuvipanda @behrmann wdyt?

  1. Documented like below in the README
  2. We setup tests against 245 in ubuntu 20.04, and 249 in ubuntu 22.04
  3. We emit a warning if the version is undetected or between 235 and 244
  4. We fail hard if the version is below 235

Requirements

Systemd and Linux distributions

SystemdSpawner 1 is recommended to be used with systemd version 245 or higher, but may work with systemd version 235-244 as well. Below are examples of Linux distributions that use systemd and has a recommended version.

The command systemctl --version can be used to verify that systemd is used, and what version is used.

manics commented 1 year ago

Seems fine. I'd drop Fedora from the docs and just mention the LTS distros. However if someone reports a bug with Fedora (because it's got a newer version of systemd) we should fix it since it'll hit the more stable distros.

consideRatio commented 1 year ago

In https://github.com/jupyterhub/systemdspawner/issues/106#issuecomment-1547342025 @yuvipanda suggested:

"Last but one Ubuntu LTS" is perhaps what to test. So that would be Ubuntu 20.04 now, and Ubuntu 22.04 once 24.04 comes out. That should give us a nice 'minimum systemd version' to test against.

This matches testing against systemd 245 as in #117!

consideRatio commented 1 year ago

I've concluded that systemdspawner is broken in systemd 243 or lower because OOMPolicy is used since v0.17 but but introduced with systemd 243+

See https://github.com/jupyterhub/systemdspawner/issues/105 about that. I suggest we fail explicitly on 243 or lower due to that and recommend 245. This is done in #117 now.