From 286a7c85509f11ba7d67b07333c63d9d5db40c91 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 20 Jun 2025 07:58:28 +0000 Subject: [PATCH 1/2] build(deps): bump github.com/opencontainers/cgroups Bumps the opencontainers group with 1 update: [github.com/opencontainers/cgroups](https://github.com/opencontainers/cgroups). Updates `github.com/opencontainers/cgroups` from 0.0.2 to 0.0.3 - [Release notes](https://github.com/opencontainers/cgroups/releases) - [Changelog](https://github.com/opencontainers/cgroups/blob/main/RELEASES.md) - [Commits](https://github.com/opencontainers/cgroups/compare/v0.0.2...v0.0.3) --- updated-dependencies: - dependency-name: github.com/opencontainers/cgroups dependency-version: 0.0.3 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: opencontainers ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index c7ff70aa86..e82139f13b 100644 --- a/go.mod +++ b/go.mod @@ -27,7 +27,7 @@ require ( github.com/google/uuid v1.6.0 github.com/gosimple/slug v1.15.0 github.com/moby/go-archive v0.1.0 - github.com/opencontainers/cgroups v0.0.2 + github.com/opencontainers/cgroups v0.0.3 github.com/opencontainers/go-digest v1.0.0 // indirect github.com/opencontainers/image-spec v1.1.1 github.com/opencontainers/runc v1.3.0 diff --git a/go.sum b/go.sum index bc025cc94c..78e25e061f 100644 --- a/go.sum +++ b/go.sum @@ -323,8 +323,8 @@ github.com/onsi/ginkgo/v2 v2.23.4/go.mod h1:Bt66ApGPBFzHyR+JO10Zbt0Gsp4uWxu5mIOT github.com/onsi/gomega v1.5.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.37.0 h1:CdEG8g0S133B4OswTDC/5XPSzE1OeP29QOioj2PID2Y= github.com/onsi/gomega v1.37.0/go.mod h1:8D9+Txp43QWKhM24yyOBEdpkzN8FvJyAwecBgsU4KU0= -github.com/opencontainers/cgroups v0.0.2 h1:A+mAPPMfgKNCEZUUtibESFx06uvhAmvo8sSz3Abwk7o= -github.com/opencontainers/cgroups v0.0.2/go.mod h1:s8lktyhlGUqM7OSRL5P7eAW6Wb+kWPNvt4qvVfzA5vs= +github.com/opencontainers/cgroups v0.0.3 h1:Jc9dWh/0YLGjdy6J/9Ln8NM5BfTA4W2BY0GMozy3aDU= +github.com/opencontainers/cgroups v0.0.3/go.mod h1:s8lktyhlGUqM7OSRL5P7eAW6Wb+kWPNvt4qvVfzA5vs= github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= github.com/opencontainers/image-spec v1.1.1 h1:y0fUlFfIZhPF1W537XOLg0/fcx6zcHCJwooC2xJA040= From b11756a08658baf343d3a1e421dc55c7fa9de6cb Mon Sep 17 00:00:00 2001 From: David Trudgian Date: Fri, 20 Jun 2025 09:02:51 +0000 Subject: [PATCH 2/2] e2e: update expected cpu.weight The opencontainers/cgroups package has updated the v1 shares -> v2 weight conversion to a more accurate formula. Signed-off-by: Dave Dykstra <2129743+DrDaveD@users.noreply.github.com> --- e2e/cgroups/cgroups.go | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/e2e/cgroups/cgroups.go b/e2e/cgroups/cgroups.go index 2123ae0bc8..98c8895abd 100644 --- a/e2e/cgroups/cgroups.go +++ b/e2e/cgroups/cgroups.go @@ -412,11 +412,12 @@ var resourceFlagTests = []resourceFlagTest{ controllerV1: "cpu", resourceV1: "cpu.shares", expectV1: "123", - // Cgroups v2 has a conversion from shares to weight: - // weight = (1 + ((cpuShares-2)*9999)/262142) + // Cgroups v2 has a conversion from shares to weight. The formula has + // changed between opencontainer/cgroups versions, and runc / crun + // versions. See https://github.com/opencontainers/cgroups/pull/20 delegationV2: "cpu", resourceV2: "cpu.weight", - expectV2: "5", + expectV2: "5|20", }, { name: "cpuset-cpus", @@ -526,7 +527,7 @@ func (c *ctx) actionFlagV1(t *testing.T, tt resourceFlagTest, profile e2e.Profil exitFunc := []e2e.ApptainerCmdResultOp{} if tt.expectV1 != "" { - exitFunc = []e2e.ApptainerCmdResultOp{e2e.ExpectOutput(e2e.ContainMatch, tt.expectV1)} + exitFunc = []e2e.ApptainerCmdResultOp{e2e.ExpectOutput(e2e.RegexMatch, tt.expectV1)} } args := tt.args @@ -556,7 +557,7 @@ func (c *ctx) actionFlagV2(t *testing.T, tt resourceFlagTest, profile e2e.Profil exitFunc := []e2e.ApptainerCmdResultOp{} if tt.expectV2 != "" { - exitFunc = []e2e.ApptainerCmdResultOp{e2e.ExpectOutput(e2e.ContainMatch, tt.expectV2)} + exitFunc = []e2e.ApptainerCmdResultOp{e2e.ExpectOutput(e2e.RegexMatch, tt.expectV2)} } // Use shell in the container to find container cgroup and cat the value for the tested controller & resource. @@ -628,7 +629,7 @@ func (c *ctx) instanceFlagV1(t *testing.T, tt resourceFlagTest, profile e2e.Prof shellCmd := fmt.Sprintf("cat /sys/fs/cgroup/%s$(cat /proc/self/cgroup | grep '[,:]%s[,:]' | cut -d ':' -f 3)/%s", tt.controllerV1, tt.controllerV1, tt.resourceV1) exitFunc := []e2e.ApptainerCmdResultOp{} if tt.expectV1 != "" { - exitFunc = []e2e.ApptainerCmdResultOp{e2e.ExpectOutput(e2e.ContainMatch, tt.expectV1)} + exitFunc = []e2e.ApptainerCmdResultOp{e2e.ExpectOutput(e2e.RegexMatch, tt.expectV1)} } c.env.RunApptainer( @@ -684,7 +685,7 @@ func (c *ctx) instanceFlagV2(t *testing.T, tt resourceFlagTest, profile e2e.Prof shellCmd := fmt.Sprintf("cat /sys/fs/cgroup$(cat /proc/self/cgroup | grep '^0::' | cut -d ':' -f 3)/%s", tt.resourceV2) exitFunc := []e2e.ApptainerCmdResultOp{} if tt.expectV2 != "" { - exitFunc = []e2e.ApptainerCmdResultOp{e2e.ExpectOutput(e2e.ContainMatch, tt.expectV2)} + exitFunc = []e2e.ApptainerCmdResultOp{e2e.ExpectOutput(e2e.RegexMatch, tt.expectV2)} } execProfile := profile