Git Product home page Git Product logo

Comments (6)

giuseppe avatar giuseppe commented on June 12, 2024

I think the issue is that you are setting a systemd cgroup in the OCI configuration file but didn't use --systemd-cgroup to the OCI runtime.

Could you run $OCI_RUNTIME --systemd-cgroup run -d -b .... and compare them again?

from crun.

mykola-kobets-epam avatar mykola-kobets-epam commented on June 12, 2024

Basically you are correct that with --systemd-cgroup crun/runc hierarchies identical:

-.slice
└─system.slice (#43)
  ├─runc-fcfcc473-64a0-41bc-bb61-8ca3801c7e0f.scope … (#3141)
  │ → trusted.delegate: 1
  │ → trusted.invocation_id: 96501da102af47ffae740d837a05726f
  │ └─ 2727 python3 -u main.py

-.slice
└─system.slice (#43)
  ├─crun-fcfcc473-64a0-41bc-bb61-8ca3801c7e0f.scope … (#2676)
  │ → trusted.delegate: 1
  │ → trusted.invocation_id: 8d2b9a3448774046bca968cca71c4d50
  │ └─container (#2716)
  │   └─ 2710 python3 -u main.py

Nevertheless I haven't found systemd cgroup in the OCI configuration file.

I think there is a difference in behavior between crun & runc for cases without --systemd-cgroup option. I suppose crun creates child cgroup inherited from the root, while runc from the parent cgroup. Example for crun/runc under systemd:

=>> crun

Control group /:
-.slice
├─fcfcc473-64a0-41bc-bb61-8ca3801c7e0f (#1812)
│ └─ 852 python3 -u main.py

=>> runc

Control group /:
-.slice
└─system.slice (#43)
  ├─system-aos\x2dservice.slice (#1754)
  │ → trusted.invocation_id: fbd62be6c5534072bc6193702d1bdb25
  │ ├─fcfcc473-64a0-41bc-bb61-8ca3801c7e0f (#2186)
  │ │ └─ 859 python3 -u main.py
  │ └─[email protected] (#1783)
  │   → trusted.invocation_id: a94e0068c56e44b4ba481b7a709a797a

=>> cgroup of systemd service

root@node0:~# systemctl status [email protected][email protected] - AOS Service
    Process: 852 ExecStart=/usr/bin/runc run -d --pid-file /run/aos/runtime/fcfcc473-64a0-41bc-bb61-8ca3801c7e0f/.pid -b /run/aos/runtime/fcfcc473-64a0-41bc-bb61-8ca3801c7e0f fcfcc473-64a0-41bc-bb61-8ca3801c7e0f (code=exited, status=0/SUCCESS)
     CGroup: /system.slice/system-aos\x2dservice.slice/[email protected]
             ‣  859 python3 -u main.py

Attaching container configuration:
cat-config.json

I can also share strace output for both cases if required.

from crun.

giuseppe avatar giuseppe commented on June 12, 2024

if you don't specify the --systemd-cgroup option, then you must specify the cgroup path as it is on the cgroup file system (e.g. foo/bar will become /sys/fs/cgroup/foo/bar).

from crun.

mykola-kobets-epam avatar mykola-kobets-epam commented on June 12, 2024

And in case when both parameters not specified then behavior is implementation defined. ie it's ok that crun/runc create different hierarchies, right?

from crun.

giuseppe avatar giuseppe commented on June 12, 2024

yes, it is implementation specific (although I remember we end up doing a similar thing)

from crun.

mykola-kobets-epam avatar mykola-kobets-epam commented on June 12, 2024

good to know, that's what I needed to clarify, thank you. Closing the issue.

from crun.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.