hyperhq / runv

Hypervisor-based Runtime for OCI
Apache License 2.0
828 stars 129 forks source link

maintain process info #560

Closed bergwolf closed 7 years ago

bergwolf commented 7 years ago

Save all process info in process.json file in container root directory. With it, runv ps can look up and verify each of them.

[root@hypervsock foobar]# cat process.json
[
        {
                "id": "init",
                "pid": 66524,
                "cmd": "sh",
                "create_time": 10904725
        }
]

With it, runv ps works and containerd is able to interpret its result properly.

[hypervsock@containerd]$sudo runv --root /run/containerd/runc/default ps foobar
PROCESS     CMD
70492       sh
70559       top
[hypervsock@containerd]$sudo runv --root /run/containerd/runc/default ps foobar -f json
[70492,70559]
[hypervsock@containerd]$sudo ctr t ps foobar
PID
70492
70559
laijs commented 7 years ago

the output of runc ps is changed. Could you also change it for runv ps? At least change it to be what containerd expects.

bergwolf commented 7 years ago

@laijs updated

laijs commented 7 years ago

LGTM