Skip to content
This repository was archived by the owner on May 12, 2021. It is now read-only.
This repository was archived by the owner on May 12, 2021. It is now read-only.

cgroups: some question about kata host cgroup set #1256

@Ace-Tang

Description

@Ace-Tang

Description of problem

First I want say #734 is a good implement. But I have two questions about set kata container cgroup on host

  1. I think cgroup parent should be decided by upper level, like docker run --cgroup-parent, but it seems hardcode now, can we get changed ?
defaultCgroupParent = "/kata"

func (s *Sandbox) newCgroups() error {
    // New will still succeed when cgroup exists
    // create common parent for all kata-containers
    // e.g. /sys/fs/cgroup/cpu/vc
    parent, err := cgroups.New(cgroups.V1,
        cgroups.StaticPath(defaultCgroupParent), &specs.LinuxResources{})
  1. we can only get container config.json only through annotaion ? I do not know if I am correct about this
func (s *Sandbox) mergeSpecResource() (*specs.LinuxResources, error) {
    if s.config == nil {
        return nil, fmt.Errorf("sandbox config is nil")
    }

    resource := &specs.LinuxResources{
        CPU: &specs.LinuxCPU{},
    }

    for _, c := range s.config.Containers {
        config, ok := c.Annotations[annotations.ConfigJSONKey]
        if !ok {
            s.Logger().WithField("container", c.ID).Warningf("failed to find config from container annotations")
            continue
        }

for this, I think if we can get from parameter will be more better

/cc @WeiZhang555

kata version

# kata-runtime -v
kata-runtime  : 1.5.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions