Re: [systemd-devel] Feedback sought: can we drop cgroupv1 support soon?

2023-07-19 Thread Dimitri John Ledkov
Some deployments that switch back their modern v2 host to hybrid or v1, are
the ones that need to run old workloads that contain old systemd. Said old
systemd only has experimental incomplete v2 support that doesn't work with
v2-only (the one before current stable magick mount value).

Specifically that is trying to run sustemd v229 in a container:

https://bugs.launchpad.net/ubuntu/xenial/+source/systemd/+bug/1962332

When cgroupsv2 got added in the kernel doesn't matter, as much as, when
systemd started to correctly support cgroupsv2.
https://github.com/systemd/systemd/commit/099619957a0/

This shipped in v230 in May 2016, and I failed to backport this to v229 and
make it work in a container on an otherwise v2-only host - it still failed
to start for me.

230 was one month too late, and hence v229 shipped in Xenial Ubuntu 16.04
LTS, which will be supported through to 2026, including as a container on
newer hosts. Which for now only works if host is in hybrid or v1 modes.

To me, 6 years support is too short for the case of old container on a new
host.

And I wish to resolve inability for v229 to start as a container on v2-only
host and open to ship any minimal backport fix to unblock this.

The inverse problem of running newer containers on older systems also
exists, but usually such deployments find a way to also get newer hosts
easily.

Has anyone else managed to run v229 in a container on a v2-only host?



On Thu, 21 Jul 2022, 10:04 Lennart Poettering, 
wrote:

> Heya!
>
> It's currently a terrible mess having to support both cgroupsv1 and
> cgroupsv2 in our codebase.
>
> cgroupsv2 first entered the kernel in 2014, i.e. *eight* years ago
> (kernel 3.16). We soon intend to raise the baseline for systemd to
> kernel 4.3 (because we want to be able to rely on the existance of
> ambient capabilities), but that also means, that all kernels we intend
> to support have a well-enough working cgroupv2 implementation.
>
> hence, i'd love to drop the cgroupv1 support from our tree entirely,
> and simplify and modernize our codebase to go cgroupv2-only. Before we
> do that I'd like to seek feedback on this though, given this is not
> purely a thing between the kernel and systemd — this does leak into
> some userspace, that operates on cgroups directly.
>
> Specifically, legacy container infra (i.e. docker/moby) for the
> longest time was cgroupsv1-only. But as I understand it has since been
> updated, to cgroupsv2 too.
>
> Hence my question: is there a strong community of people who insist on
> using newest systemd while using legacy container infra? Anyone else
> has a good reason to stick with cgroupsv1 but really wants newest
> systemd?
>
> The time where we'll drop cgroupv1 support *will* come eventually
> either way, but what's still up for discussion is to determine
> precisely when. hence, please let us know!
>
> Thanks,
>
> Lennart
>
> --
> Lennart Poettering, Berlin
>


Re: [systemd-devel] Feedback sought: can we drop cgroupv1 support soon?

2023-07-19 Thread Daniel Walsh

On 7/19/23 08:59, Neal Gompa wrote:

On Wed, Jul 19, 2023 at 8:52 AM Luca Boccassi  wrote:

On Wed, 19 Jul 2023 at 13:45, Neal Gompa  wrote:

On Thu, Jul 21, 2022 at 6:15 AM Lennart Poettering
 wrote:

Heya!

It's currently a terrible mess having to support both cgroupsv1 and
cgroupsv2 in our codebase.

cgroupsv2 first entered the kernel in 2014, i.e. *eight* years ago
(kernel 3.16). We soon intend to raise the baseline for systemd to
kernel 4.3 (because we want to be able to rely on the existance of
ambient capabilities), but that also means, that all kernels we intend
to support have a well-enough working cgroupv2 implementation.

hence, i'd love to drop the cgroupv1 support from our tree entirely,
and simplify and modernize our codebase to go cgroupv2-only. Before we
do that I'd like to seek feedback on this though, given this is not
purely a thing between the kernel and systemd — this does leak into
some userspace, that operates on cgroups directly.

Specifically, legacy container infra (i.e. docker/moby) for the
longest time was cgroupsv1-only. But as I understand it has since been
updated, to cgroupsv2 too.

Hence my question: is there a strong community of people who insist on
using newest systemd while using legacy container infra? Anyone else
has a good reason to stick with cgroupsv1 but really wants newest
systemd?

The time where we'll drop cgroupv1 support *will* come eventually
either way, but what's still up for discussion is to determine
precisely when. hence, please let us know!


The main concern I have about cgroup v1 removal is that some major
Kubernetes distributions don't support cgroup v2 yet. Upstream
Kubernetes only started fully supporting cgroup v2 with Kubernetes
1.25, as noted in their documentation:
https://kubernetes.io/docs/concepts/architecture/cgroups/

OpenShift just added support in 4.13 (but didn't enable it by default
yet): https://cloud.redhat.com/blog/cgroups-v2-goes-ga-in-openshift-4.13

AKS seems to only support cgroup v2 with Ubuntu 22.04:
https://learn.microsoft.com/en-us/azure/aks/supported-kubernetes-versions?tabs=azure-cli#aks-components-breaking-changes-by-version

(No mention of Azure Linux? I'm pretty sure CBL-Mariner is cgroup v2 only)

It is unclear whether EKS supports cgroup v2 at all (I suspect not,
since EKS doesn't yet run on Amazon Linux 2023):
https://docs.aws.amazon.com/eks/latest/userguide/kubernetes-versions.html

It is similarly unclear with GKE:
https://cloud.google.com/kubernetes-engine/docs/concepts/node-images

(The version of Ubuntu is not mentioned in the documentation, if it's
not new enough, it's still cgroup v1)

DigitalOcean Kubernetes Service (DOKS) is still cgroup v1:
https://docs.digitalocean.com/products/kubernetes/details/changelog/

Linode Kubernetes Engine (LKE) is still cgroup v1:
https://www.linode.com/docs/products/compute/kubernetes/release-notes/

It is possible that systemd's deprecation will push things over the
edge, but I wanted to make sure people are aware of this.

Are you sure that in all those cases it's really not supported at all,
vs simply not being the default configuration that can be changed with
a toggle?

If it's not mentioned, it's probably not supported. And especially
with managed Kubernetes, it's pretty rare to allow such kind of
configuration changes.




--
真実はいつも一つ!/ Always, there's only one truth!

I believe it is definitely time to remove support for it. Cgroupv1 never 
worked well, and this is a chance to move forward with a well supported 
solution.




Re: [systemd-devel] Feedback sought: can we drop cgroupv1 support soon?

2023-07-19 Thread Neal Gompa
On Wed, Jul 19, 2023 at 8:52 AM Luca Boccassi  wrote:
>
> On Wed, 19 Jul 2023 at 13:45, Neal Gompa  wrote:
> >
> > On Thu, Jul 21, 2022 at 6:15 AM Lennart Poettering
> >  wrote:
> > >
> > > Heya!
> > >
> > > It's currently a terrible mess having to support both cgroupsv1 and
> > > cgroupsv2 in our codebase.
> > >
> > > cgroupsv2 first entered the kernel in 2014, i.e. *eight* years ago
> > > (kernel 3.16). We soon intend to raise the baseline for systemd to
> > > kernel 4.3 (because we want to be able to rely on the existance of
> > > ambient capabilities), but that also means, that all kernels we intend
> > > to support have a well-enough working cgroupv2 implementation.
> > >
> > > hence, i'd love to drop the cgroupv1 support from our tree entirely,
> > > and simplify and modernize our codebase to go cgroupv2-only. Before we
> > > do that I'd like to seek feedback on this though, given this is not
> > > purely a thing between the kernel and systemd — this does leak into
> > > some userspace, that operates on cgroups directly.
> > >
> > > Specifically, legacy container infra (i.e. docker/moby) for the
> > > longest time was cgroupsv1-only. But as I understand it has since been
> > > updated, to cgroupsv2 too.
> > >
> > > Hence my question: is there a strong community of people who insist on
> > > using newest systemd while using legacy container infra? Anyone else
> > > has a good reason to stick with cgroupsv1 but really wants newest
> > > systemd?
> > >
> > > The time where we'll drop cgroupv1 support *will* come eventually
> > > either way, but what's still up for discussion is to determine
> > > precisely when. hence, please let us know!
> > >
> >
> > The main concern I have about cgroup v1 removal is that some major
> > Kubernetes distributions don't support cgroup v2 yet. Upstream
> > Kubernetes only started fully supporting cgroup v2 with Kubernetes
> > 1.25, as noted in their documentation:
> > https://kubernetes.io/docs/concepts/architecture/cgroups/
> >
> > OpenShift just added support in 4.13 (but didn't enable it by default
> > yet): https://cloud.redhat.com/blog/cgroups-v2-goes-ga-in-openshift-4.13
> >
> > AKS seems to only support cgroup v2 with Ubuntu 22.04:
> > https://learn.microsoft.com/en-us/azure/aks/supported-kubernetes-versions?tabs=azure-cli#aks-components-breaking-changes-by-version
> >
> > (No mention of Azure Linux? I'm pretty sure CBL-Mariner is cgroup v2 only)
> >
> > It is unclear whether EKS supports cgroup v2 at all (I suspect not,
> > since EKS doesn't yet run on Amazon Linux 2023):
> > https://docs.aws.amazon.com/eks/latest/userguide/kubernetes-versions.html
> >
> > It is similarly unclear with GKE:
> > https://cloud.google.com/kubernetes-engine/docs/concepts/node-images
> >
> > (The version of Ubuntu is not mentioned in the documentation, if it's
> > not new enough, it's still cgroup v1)
> >
> > DigitalOcean Kubernetes Service (DOKS) is still cgroup v1:
> > https://docs.digitalocean.com/products/kubernetes/details/changelog/
> >
> > Linode Kubernetes Engine (LKE) is still cgroup v1:
> > https://www.linode.com/docs/products/compute/kubernetes/release-notes/
> >
> > It is possible that systemd's deprecation will push things over the
> > edge, but I wanted to make sure people are aware of this.
>
> Are you sure that in all those cases it's really not supported at all,
> vs simply not being the default configuration that can be changed with
> a toggle?

If it's not mentioned, it's probably not supported. And especially
with managed Kubernetes, it's pretty rare to allow such kind of
configuration changes.




--
真実はいつも一つ!/ Always, there's only one truth!


Re: [systemd-devel] Feedback sought: can we drop cgroupv1 support soon?

2023-07-19 Thread Luca Boccassi
On Wed, 19 Jul 2023 at 13:45, Neal Gompa  wrote:
>
> On Thu, Jul 21, 2022 at 6:15 AM Lennart Poettering
>  wrote:
> >
> > Heya!
> >
> > It's currently a terrible mess having to support both cgroupsv1 and
> > cgroupsv2 in our codebase.
> >
> > cgroupsv2 first entered the kernel in 2014, i.e. *eight* years ago
> > (kernel 3.16). We soon intend to raise the baseline for systemd to
> > kernel 4.3 (because we want to be able to rely on the existance of
> > ambient capabilities), but that also means, that all kernels we intend
> > to support have a well-enough working cgroupv2 implementation.
> >
> > hence, i'd love to drop the cgroupv1 support from our tree entirely,
> > and simplify and modernize our codebase to go cgroupv2-only. Before we
> > do that I'd like to seek feedback on this though, given this is not
> > purely a thing between the kernel and systemd — this does leak into
> > some userspace, that operates on cgroups directly.
> >
> > Specifically, legacy container infra (i.e. docker/moby) for the
> > longest time was cgroupsv1-only. But as I understand it has since been
> > updated, to cgroupsv2 too.
> >
> > Hence my question: is there a strong community of people who insist on
> > using newest systemd while using legacy container infra? Anyone else
> > has a good reason to stick with cgroupsv1 but really wants newest
> > systemd?
> >
> > The time where we'll drop cgroupv1 support *will* come eventually
> > either way, but what's still up for discussion is to determine
> > precisely when. hence, please let us know!
> >
>
> The main concern I have about cgroup v1 removal is that some major
> Kubernetes distributions don't support cgroup v2 yet. Upstream
> Kubernetes only started fully supporting cgroup v2 with Kubernetes
> 1.25, as noted in their documentation:
> https://kubernetes.io/docs/concepts/architecture/cgroups/
>
> OpenShift just added support in 4.13 (but didn't enable it by default
> yet): https://cloud.redhat.com/blog/cgroups-v2-goes-ga-in-openshift-4.13
>
> AKS seems to only support cgroup v2 with Ubuntu 22.04:
> https://learn.microsoft.com/en-us/azure/aks/supported-kubernetes-versions?tabs=azure-cli#aks-components-breaking-changes-by-version
>
> (No mention of Azure Linux? I'm pretty sure CBL-Mariner is cgroup v2 only)
>
> It is unclear whether EKS supports cgroup v2 at all (I suspect not,
> since EKS doesn't yet run on Amazon Linux 2023):
> https://docs.aws.amazon.com/eks/latest/userguide/kubernetes-versions.html
>
> It is similarly unclear with GKE:
> https://cloud.google.com/kubernetes-engine/docs/concepts/node-images
>
> (The version of Ubuntu is not mentioned in the documentation, if it's
> not new enough, it's still cgroup v1)
>
> DigitalOcean Kubernetes Service (DOKS) is still cgroup v1:
> https://docs.digitalocean.com/products/kubernetes/details/changelog/
>
> Linode Kubernetes Engine (LKE) is still cgroup v1:
> https://www.linode.com/docs/products/compute/kubernetes/release-notes/
>
> It is possible that systemd's deprecation will push things over the
> edge, but I wanted to make sure people are aware of this.

Are you sure that in all those cases it's really not supported at all,
vs simply not being the default configuration that can be changed with
a toggle?


Re: [systemd-devel] Feedback sought: can we drop cgroupv1 support soon?

2023-07-19 Thread Neal Gompa
On Thu, Jul 21, 2022 at 6:15 AM Lennart Poettering
 wrote:
>
> Heya!
>
> It's currently a terrible mess having to support both cgroupsv1 and
> cgroupsv2 in our codebase.
>
> cgroupsv2 first entered the kernel in 2014, i.e. *eight* years ago
> (kernel 3.16). We soon intend to raise the baseline for systemd to
> kernel 4.3 (because we want to be able to rely on the existance of
> ambient capabilities), but that also means, that all kernels we intend
> to support have a well-enough working cgroupv2 implementation.
>
> hence, i'd love to drop the cgroupv1 support from our tree entirely,
> and simplify and modernize our codebase to go cgroupv2-only. Before we
> do that I'd like to seek feedback on this though, given this is not
> purely a thing between the kernel and systemd — this does leak into
> some userspace, that operates on cgroups directly.
>
> Specifically, legacy container infra (i.e. docker/moby) for the
> longest time was cgroupsv1-only. But as I understand it has since been
> updated, to cgroupsv2 too.
>
> Hence my question: is there a strong community of people who insist on
> using newest systemd while using legacy container infra? Anyone else
> has a good reason to stick with cgroupsv1 but really wants newest
> systemd?
>
> The time where we'll drop cgroupv1 support *will* come eventually
> either way, but what's still up for discussion is to determine
> precisely when. hence, please let us know!
>

The main concern I have about cgroup v1 removal is that some major
Kubernetes distributions don't support cgroup v2 yet. Upstream
Kubernetes only started fully supporting cgroup v2 with Kubernetes
1.25, as noted in their documentation:
https://kubernetes.io/docs/concepts/architecture/cgroups/

OpenShift just added support in 4.13 (but didn't enable it by default
yet): https://cloud.redhat.com/blog/cgroups-v2-goes-ga-in-openshift-4.13

AKS seems to only support cgroup v2 with Ubuntu 22.04:
https://learn.microsoft.com/en-us/azure/aks/supported-kubernetes-versions?tabs=azure-cli#aks-components-breaking-changes-by-version

(No mention of Azure Linux? I'm pretty sure CBL-Mariner is cgroup v2 only)

It is unclear whether EKS supports cgroup v2 at all (I suspect not,
since EKS doesn't yet run on Amazon Linux 2023):
https://docs.aws.amazon.com/eks/latest/userguide/kubernetes-versions.html

It is similarly unclear with GKE:
https://cloud.google.com/kubernetes-engine/docs/concepts/node-images

(The version of Ubuntu is not mentioned in the documentation, if it's
not new enough, it's still cgroup v1)

DigitalOcean Kubernetes Service (DOKS) is still cgroup v1:
https://docs.digitalocean.com/products/kubernetes/details/changelog/

Linode Kubernetes Engine (LKE) is still cgroup v1:
https://www.linode.com/docs/products/compute/kubernetes/release-notes/

It is possible that systemd's deprecation will push things over the
edge, but I wanted to make sure people are aware of this.





--
真実はいつも一つ!/ Always, there's only one truth!


Re: [systemd-devel] Feedback sought: can we drop cgroupv1 support soon?

2023-07-19 Thread Luca Boccassi
On Wed, 19 Jul 2023 at 11:46, Lewis Gaul  wrote:
>
> Hi Luca,
>
> > All the distributions you quoted above support cgroupv2 to the best of
> > my knowledge, it simply has to be enabled at boot. Why isn't that
> > sufficient?
>
> As I said in my previous email:
>
> > in the case of it being a systemd container on an arbitrary host then a 
> > lack of cgroup v1 support from systemd would place a cgroup v2 requirement 
> > on the host, which is an undesirable property of a container.
>
> and
>
> > we are not in a position to require the end-user to reconfigure their host 
> > to enable running our container.

What's the problem with that? You will already have _some_
requirements, just add a new one. It's just a configuration change.


Re: [systemd-devel] Feedback sought: can we drop cgroupv1 support soon?

2023-07-19 Thread Lewis Gaul
Hi Luca,

> All the distributions you quoted above support cgroupv2 to the best of
> my knowledge, it simply has to be enabled at boot. Why isn't that
> sufficient?

As I said in my previous email:

> in the case of it being a systemd container on an arbitrary host then a
lack of cgroup v1 support from systemd would place a cgroup v2 requirement
on the host, which is an undesirable property of a container.

and

> we are not in a position to require the end-user to reconfigure their
host to enable running our container.

Regards,
Lewis

On Wed, 19 Jul 2023 at 11:35, Luca Boccassi  wrote:

> On Wed, 19 Jul 2023 at 11:30, Lewis Gaul  wrote:
> >
> > Hi Lennart, all,
> >
> > TL;DR: A container making use of cgroup controllers must use the same
> cgroup version as the host, and in the case of it being a systemd container
> on an arbitrary host then a lack of cgroup v1 support from systemd would
> place a cgroup v2 requirement on the host, which is an undesirable property
> of a container.
> >
> > I can totally understand the desire to simplify the codebase/support
> matrix, and appreciate this response is coming quite late (almost a year
> since cgroups v1 was noted as a future deprecation in systemd). However, I
> wanted to share a use-case/argument for keeping cgroups v1 support a little
> longer in case it may impact the decision at all.
> >
> > At my $work we provide a container image to customers, where the
> container runs using systemd as the init system. The end-user has some
> freedom on how/where to run this container, e.g. using docker/podman on a
> host of their choice, or in Kubernetes (e.g. EKS in AWS).
> >
> > Of course there are bounds on what we officially support, but generally
> we would like to support recent LTS releases of major distros, currently
> including Ubuntu 20.04, Ubuntu 22.04, RHEL 8, RHEL 9, Amazon Linux 2 (EKS
> doesn’t yet support Amazon Linux 2023). Of these, only Ubuntu 22.04 and
> RHEL 9 have switched to using cgroups v2 by default, and we are not in a
> position to require the end-user to reconfigure their host to enable
> running our container. What’s more, since we make use of cgroup controllers
> inside the container, we cannot have cgroup v1 controllers enabled on the
> host while attempting to use cgroups v2 inside the container.
> >
> > > Because of that I see no reason why old systemd cgroupv1 payloads
> > > shouldn#t just work on cgroupv2 hosts: as long as you give them a
> > > pre-set-up cgroupv1 environemnt, and nothing stops you from doing
> > > that. In fact, this is something we even documented somewhere: what to
> > > do if the host only does a subset of the cgroup stuff you want, and
> > > what you have to do to set up the other stuff (i.e. if host doesn't
> > > manage your hierarchy of choice, but only others, just follow the same
> > > structure in the other hierarchy, and clean up after yourself). This
> > > is what nspawn does: if host is cgroupv2 only it will set up
> > > name=systemd hierarchy in cgroupv1 itself, and pass that to the
> > > container.
> >
> > I don't think this works for us since we need the full cgroup (v1/v2)
> filesystem available in the container, with controllers enabled.
> >
> > This means that we must, for now, continue to support cgroups v1 in our
> container image. If systemd were to drop support for cgroups v1 then we may
> find ourselves in an awkward position of not being able to upgrade to this
> new systemd version, or be forced to pass this restriction on to end-users.
> The reason we’re uncomfortable about insisting on the use of cgroups v2 is
> that as a container app we ideally wouldn’t place such requirements on the
> host.
> >
> > So, while it's true that the container ecosystem does now largely
> support cgroups v2, there is still an aspect of caring about what the host
> is running, which from our perspective this should be assumed to be the
> default configuration for the chosen distro. With this in mind, we’d
> ideally like to have systemd support cgroups v1 a little longer than the
> end of this year.
> >
> > Does this make sense as a use-case and motivation for wanting new
> systemd versions to continue supporting cgroups v1? Of course not forever,
> but until there are less hosts out there using cgroups v1.
>
> All the distributions you quoted above support cgroupv2 to the best of
> my knowledge, it simply has to be enabled at boot. Why isn't that
> sufficient?
>
> Kind regards,
> Luca Boccassi
>


Re: [systemd-devel] Feedback sought: can we drop cgroupv1 support soon?

2023-07-19 Thread Luca Boccassi
On Wed, 19 Jul 2023 at 11:30, Lewis Gaul  wrote:
>
> Hi Lennart, all,
>
> TL;DR: A container making use of cgroup controllers must use the same cgroup 
> version as the host, and in the case of it being a systemd container on an 
> arbitrary host then a lack of cgroup v1 support from systemd would place a 
> cgroup v2 requirement on the host, which is an undesirable property of a 
> container.
>
> I can totally understand the desire to simplify the codebase/support matrix, 
> and appreciate this response is coming quite late (almost a year since 
> cgroups v1 was noted as a future deprecation in systemd). However, I wanted 
> to share a use-case/argument for keeping cgroups v1 support a little longer 
> in case it may impact the decision at all.
>
> At my $work we provide a container image to customers, where the container 
> runs using systemd as the init system. The end-user has some freedom on 
> how/where to run this container, e.g. using docker/podman on a host of their 
> choice, or in Kubernetes (e.g. EKS in AWS).
>
> Of course there are bounds on what we officially support, but generally we 
> would like to support recent LTS releases of major distros, currently 
> including Ubuntu 20.04, Ubuntu 22.04, RHEL 8, RHEL 9, Amazon Linux 2 (EKS 
> doesn’t yet support Amazon Linux 2023). Of these, only Ubuntu 22.04 and RHEL 
> 9 have switched to using cgroups v2 by default, and we are not in a position 
> to require the end-user to reconfigure their host to enable running our 
> container. What’s more, since we make use of cgroup controllers inside the 
> container, we cannot have cgroup v1 controllers enabled on the host while 
> attempting to use cgroups v2 inside the container.
>
> > Because of that I see no reason why old systemd cgroupv1 payloads
> > shouldn#t just work on cgroupv2 hosts: as long as you give them a
> > pre-set-up cgroupv1 environemnt, and nothing stops you from doing
> > that. In fact, this is something we even documented somewhere: what to
> > do if the host only does a subset of the cgroup stuff you want, and
> > what you have to do to set up the other stuff (i.e. if host doesn't
> > manage your hierarchy of choice, but only others, just follow the same
> > structure in the other hierarchy, and clean up after yourself). This
> > is what nspawn does: if host is cgroupv2 only it will set up
> > name=systemd hierarchy in cgroupv1 itself, and pass that to the
> > container.
>
> I don't think this works for us since we need the full cgroup (v1/v2) 
> filesystem available in the container, with controllers enabled.
>
> This means that we must, for now, continue to support cgroups v1 in our 
> container image. If systemd were to drop support for cgroups v1 then we may 
> find ourselves in an awkward position of not being able to upgrade to this 
> new systemd version, or be forced to pass this restriction on to end-users. 
> The reason we’re uncomfortable about insisting on the use of cgroups v2 is 
> that as a container app we ideally wouldn’t place such requirements on the 
> host.
>
> So, while it's true that the container ecosystem does now largely support 
> cgroups v2, there is still an aspect of caring about what the host is 
> running, which from our perspective this should be assumed to be the default 
> configuration for the chosen distro. With this in mind, we’d ideally like to 
> have systemd support cgroups v1 a little longer than the end of this year.
>
> Does this make sense as a use-case and motivation for wanting new systemd 
> versions to continue supporting cgroups v1? Of course not forever, but until 
> there are less hosts out there using cgroups v1.

All the distributions you quoted above support cgroupv2 to the best of
my knowledge, it simply has to be enabled at boot. Why isn't that
sufficient?

Kind regards,
Luca Boccassi


Re: [systemd-devel] Feedback sought: can we drop cgroupv1 support soon?

2023-07-19 Thread Lewis Gaul
Hi Lennart, all,

TL;DR: A container making use of cgroup controllers must use the same
cgroup version as the host, and in the case of it being a systemd container
on an arbitrary host then a lack of cgroup v1 support from systemd would
place a cgroup v2 requirement on the host, which is an undesirable property
of a container.

I can totally understand the desire to simplify the codebase/support
matrix, and appreciate this response is coming quite late (almost a year
since cgroups v1 was noted as a future deprecation in systemd). However, I
wanted to share a use-case/argument for keeping cgroups v1 support a little
longer in case it may impact the decision at all.

At my $work we provide a container image to customers, where the container
runs using systemd as the init system. The end-user has some freedom on
how/where to run this container, e.g. using docker/podman on a host of
their choice, or in Kubernetes (e.g. EKS in AWS).

Of course there are bounds on what we officially support, but generally we
would like to support recent LTS releases of major distros, currently
including Ubuntu 20.04, Ubuntu 22.04, RHEL 8, RHEL 9, Amazon Linux 2 (EKS
doesn’t yet support Amazon Linux 2023). Of these, only Ubuntu 22.04 and
RHEL 9 have switched to using cgroups v2 by default, and we are not in a
position to require the end-user to reconfigure their host to enable
running our container. What’s more, since we make use of cgroup controllers
inside the container, we cannot have cgroup v1 controllers enabled on the
host while attempting to use cgroups v2 inside the container.

> Because of that I see no reason why old systemd cgroupv1 payloads
> shouldn#t just work on cgroupv2 hosts: as long as you give them a
> pre-set-up cgroupv1 environemnt, and nothing stops you from doing
> that. In fact, this is something we even documented somewhere: what to
> do if the host only does a subset of the cgroup stuff you want, and
> what you have to do to set up the other stuff (i.e. if host doesn't
> manage your hierarchy of choice, but only others, just follow the same
> structure in the other hierarchy, and clean up after yourself). This
> is what nspawn does: if host is cgroupv2 only it will set up
> name=systemd hierarchy in cgroupv1 itself, and pass that to the
> container.

I don't think this works for us since we need the full cgroup
(v1/v2) filesystem available in the container, with controllers enabled.

This means that we must, for now, continue to support cgroups v1 in our
container image. If systemd were to drop support for cgroups v1 then we may
find ourselves in an awkward position of not being able to upgrade to this
new systemd version, or be forced to pass this restriction on to end-users.
The reason we’re uncomfortable about insisting on the use of cgroups v2 is
that as a container app we ideally wouldn’t place such requirements on the
host.

So, while it's true that the container ecosystem does now largely support
cgroups v2, there is still an aspect of caring about what the host is
running, which from our perspective this should be assumed to be the
default configuration for the chosen distro. With this in mind, we’d
ideally like to have systemd support cgroups v1 a little longer than the
end of this year.

Does this make sense as a use-case and motivation for wanting new systemd
versions to continue supporting cgroups v1? Of course not forever, but
until there are less hosts out there using cgroups v1.

Best wishes,
Lewis

On Fri, 22 Jul 2022 at 11:15, Lennart Poettering 
wrote:

> On Do, 21.07.22 16:24, Stéphane Graber (stgra...@ubuntu.com) wrote:
>
> > Hey there,
> >
> > I believe Christian may have relayed some of this already but on my
> > side, as much as I can sympathize with the annoyance of having to
> > support both cgroup1 and cgroup2 side by side, I feel that we're sadly
> > nowhere near the cut off point.
> >
> > >From what I can gather from various stats we have, over 90% of LXD
> > users are still on distributions relying on CGroup1.
> > That's because most of them are using LTS releases of server
> > distributions and those only somewhat recently made the jump to
> > cgroup2:
> >  - RHEL 9 in May 2022
> >  - Ubuntu 22.04 LTS in April 2022
> >  - Debian 11 in August 2021
> >
> > OpenSUSE is still on cgroup1 by default in 15.4 for some reason.
> > All this is also excluding our two largest users, Chromebooks and QNAP
> > NASes, neither of them made the switch yet.
>
> At some point I feel no sympathy there. If google/qnap/suse still are
> stuck in cgroupv1 land, then that's on them, we shouldn't allow
> ourselves to be held hostage by that.
>
> I mean, that Google isn't forward looking in these things is well
> known, but I am a bit surprised SUSE is still so far back.
>
> > I honestly wouldn't be holding deprecating cgroup1 on waiting for
> > those few to wake up and transition.
> > Both ChromeOS and QNAP can very quickly roll it out to all their users
> > should they want to.
> > It's a bit