Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion contrib/test/integration/build/runc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

- name: build runc
make:
params: BUILDTAGS="seccomp selinux"
chdir: "{{ ansible_env.GOPATH }}/src/github.com/opencontainers/runc"

- name: install runc
Expand Down
2 changes: 1 addition & 1 deletion dependencies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ dependencies:
match: cri_tools_git_version

- name: runc
version: v1.1.1
version: v1.1.3
refPaths:
- path: scripts/versions
match: runc
Expand Down
42 changes: 10 additions & 32 deletions internal/config/cgmgr/cgroupfs.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,10 @@ import (
"strings"

"github.com/containers/common/pkg/cgroups"
"github.com/cri-o/cri-o/internal/config/node"
"github.com/containers/podman/v4/pkg/rootless"
"github.com/cri-o/cri-o/utils"
libctr "github.com/opencontainers/runc/libcontainer/cgroups"
"github.com/opencontainers/runc/libcontainer/cgroups/fs"
"github.com/opencontainers/runc/libcontainer/cgroups/fs2"
libctrCgMgr "github.com/opencontainers/runc/libcontainer/cgroups/manager"
cgcfgs "github.com/opencontainers/runc/libcontainer/configs"
"github.com/opencontainers/runc/libcontainer/devices"
rspec "github.com/opencontainers/runtime-spec/specs-go"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
Expand Down Expand Up @@ -135,46 +132,27 @@ func (*CgroupfsManager) MoveConmonToCgroup(cid, cgroupParent, conmonCgroup strin
}

func setWorkloadSettings(cgPath string, resources *rspec.LinuxResources) (err error) {
var mgr libctr.Manager
if resources.CPU == nil {
return nil
}

paths := map[string]string{
"cpuset": filepath.Join("/sys/fs/cgroup", "cpuset", cgPath),
"cpu": filepath.Join("/sys/fs/cgroup", "cpu", cgPath),
"freezer": filepath.Join("/sys/fs/cgroup", "freezer", cgPath),
"devices": filepath.Join("/sys/fs/cgroup", "devices", cgPath),
}

cg := &cgcfgs.Cgroup{
Name: cgPath,
Resources: &cgcfgs.Resources{},
}
if resources.CPU.Cpus != "" {
cg.Resources.CpusetCpus = resources.CPU.Cpus
Path: "/" + cgPath,
Resources: &cgcfgs.Resources{
SkipDevices: true,
CpusetCpus: resources.CPU.Cpus,
},
Rootless: rootless.IsRootless(),
}
if resources.CPU.Shares != nil {
cg.Resources.CpuShares = *resources.CPU.Shares
}

// We need to white list all devices
// so containers created underneath won't fail
cg.Resources.Devices = []*devices.Rule{
{
Type: devices.WildcardDevice,
Allow: true,
},
}

if node.CgroupIsV2() {
mgr, err = fs2.NewManager(cg, cgPath)
} else {
mgr, err = fs.NewManager(cg, paths)
}
mgr, err := libctrCgMgr.New(cg)
if err != nil {
return err
}

return mgr.Set(cg.Resources)
}

Expand Down
2 changes: 1 addition & 1 deletion scripts/versions
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ declare -A VERSIONS=(
["cni-plugins"]=v1.1.1
["conmon"]=v2.1.2
["cri-tools"]=v1.24.2
["runc"]=v1.1.1
["runc"]=v1.1.3
["crun"]=1.4.5
["bats"]=v1.6.0
)
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions vendor/modules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1627,6 +1627,7 @@ github.com/opencontainers/runc/libcontainer/cgroups/ebpf/devicefilter
github.com/opencontainers/runc/libcontainer/cgroups/fs
github.com/opencontainers/runc/libcontainer/cgroups/fs2
github.com/opencontainers/runc/libcontainer/cgroups/fscommon
github.com/opencontainers/runc/libcontainer/cgroups/manager
github.com/opencontainers/runc/libcontainer/cgroups/systemd
github.com/opencontainers/runc/libcontainer/configs
github.com/opencontainers/runc/libcontainer/devices
Expand Down