gVisor runtime monitoring for OCI

69 views
Skip to first unread message

Lars Andringa

unread,
Apr 17, 2023, 7:58:41 AM4/17/23
to gVisor Users [Public]
Hi all,

I am looking into implementing gVisor's runtime monitoring (runsc trace) into an application, however I am trying to do it using the OCI method (runsc run) rather than docker. The documentation however only covers docker.

The main issue I am running into is that I need the sandbox ID for the trace command, but I cannot find the sandbox ID of my running process. Every form of lists or descriptions of my containers give me the linux PID of the process, but this obviously doesn't help. How can I find the sandbox ID of my running container using runsc run?

Kind regards,
Lars

Ayush Ranjan

unread,
Apr 17, 2023, 1:16:14 PM4/17/23
to Lars Andringa, gVisor Users [Public]
The sandbox ID is the container ID in your case. You must be using `runsc create <container-id>` and `runsc run <container-id>`. Just use the container-id for the trace command.

Note that in some cases the sandbox ID might be different from the container ID. This only happens when using subcontainers (when a sandbox is running multiple containers). In that case, the sandbox ID is the first (root) container's ID. And subsequent containers in that sandbox (subcontainers) have a container ID that is different from sandbox ID. But I assume you are not using subcontainers.

You can follow the logic over here to see how the sandbox ID is configured.

--
You received this message because you are subscribed to the Google Groups "gVisor Users [Public]" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gvisor-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gvisor-users/86297ad8-d41f-4598-a056-7b48ae5934b0n%40googlegroups.com.

Fabricio Voznika

unread,
Apr 17, 2023, 6:28:18 PM4/17/23
to Ayush Ranjan, Lars Andringa, gVisor Users [Public]
You can also get the list of all sandboxes with: `runsc list --sandbox --root=<root_dir>`

Lars Andringa

unread,
Apr 18, 2023, 6:36:03 AM4/18/23
to gVisor Users [Public]
Thank you for both answers. This helped out a ton.
Reply all
Reply to author
Forward
0 new messages