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

cgroups: some question about kata host cgroup set #1256

Closed
Ace-Tang opened this issue Feb 20, 2019 · 2 comments
Closed

cgroups: some question about kata host cgroup set #1256

Ace-Tang opened this issue Feb 20, 2019 · 2 comments

Comments

@Ace-Tang
Copy link
Contributor

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
@devimc
Copy link

devimc commented Feb 20, 2019

@Ace-Tang these issues are fixed here #1189 , could you please review it ?

@Ace-Tang
Copy link
Contributor Author

Solve my problem, thanks @devimc

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants