Skip to content

Commit f1f4e3e

Browse files
committed
jailer: update documentation following...
the UUID validation. Signed-off-by: Diana Popa <[email protected]>
1 parent afd7d0a commit f1f4e3e

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

docs/jailer.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ The jailer is invoked in this manner:
55
jailer --id <id> --node <numa_node> --exec-file <exec_file> --uid <uid> --gid <gid> [--chroot-base-dir <chroot_base>]
66
```
77

8-
* **id** is the unique VM identification string, which has to be alphanumeric for now.
8+
* **id** is the unique VM identification string (i.e the UUID) and needs to follow one of the three UUID formats (simple, hyphenated or urn). See [RFC4122: A Universally Unique IDentifier (UUID) URN Namespace](https://tools.ietf.org/html/rfc4122).
99

1010
* **numa_node** represents the NUMA node the process gets assigned to. More details are available below.
1111

@@ -42,28 +42,28 @@ After starting, the Jailer goes through the following operations:
4242

4343
## EXAMPLE RUN AND NOTES
4444

45-
Let’s assume Firecracker is available as `/usr/bin/firecracker`, and the jailer can be found at `/usr/bin/jailer`. We pick the **unique id 0abbcf2**, and we choose to run on **NUMA node 0**, using **uid 123**, and **gid 100**. For this example, we are content with the default `/srv/jailer` **chroot base dir**.
45+
Let’s assume Firecracker is available as `/usr/bin/firecracker`, and the jailer can be found at `/usr/bin/jailer`. We pick the **unique id 551e7604-e35c-42b3-b825-416853441234**, and we choose to run on **NUMA node 0**, using **uid 123**, and **gid 100**. For this example, we are content with the default `/srv/jailer` **chroot base dir**.
4646

47-
We start by running ```/usr/bin/jailer --id 0abbcf2 --node 0 --exec-file /usr/bin/firecracker --uid 123 --gid 100```.
47+
We start by running ```/usr/bin/jailer --id 551e7604-e35c-42b3-b825-416853441234 --node 0 --exec-file /usr/bin/firecracker --uid 123 --gid 100```.
4848

4949
After opening the file descriptors mentioned in the previous section, the jailer will create the following resources (and all their prerequisites, such as the path which contains them):
5050

51-
* `/srv/jailer/firecracker/0abbcf2/api.socket` (created via `bind`)
52-
* `/srv/jailer/firecracker/0abbcf2/root/firecracker` (copied from `/usr/bin/firecracker`)
51+
* `/srv/jailer/firecracker/551e7604-e35c-42b3-b825-416853441234/api.socket` (created via `bind`)
52+
* `/srv/jailer/firecracker/551e7604-e35c-42b3-b825-416853441234/root/firecracker` (copied from `/usr/bin/firecracker`)
5353

5454
Let’s also assume the **cpu**, **cpuset**, and **pids** cgroups are mounted at `/sys/fs/cgroup/cpu`, `/sys/fs/cgroup/cpuset`, and `/sys/fs/cgroup/pids`, respectively. The jailer will create the following subfolders (which will inherit settings from the parent cgroup):
5555

56-
* `/sys/fs/cgroup/cpu/firecracker/0abbcf2`
57-
* `/sys/fs/cgroup/cpuset/firecracker/0abbcf2`
58-
* `/sys/fs/cgroup/pids/firecracker/0abbcf2`.
56+
* `/sys/fs/cgroup/cpu/firecracker/551e7604-e35c-42b3-b825-416853441234`
57+
* `/sys/fs/cgroup/cpuset/firecracker/551e7604-e35c-42b3-b825-416853441234`
58+
* `/sys/fs/cgroup/pids/firecracker/551e7604-e35c-42b3-b825-416853441234`.
5959

6060
It’s worth noting that, whenever a folder already exists, nothing will be done, and we move on to the next directory that needs to be created. This should only happen for the common **firecracker** subfolder (but, as for creating the chroot path before, we do not issue an error if folders directly associated with the supposedly unique **id** already exist).
6161

62-
The jailer then writes the current pid to `/sys/fs/cgroup/cpu/firecracker/0abbcf2/tasks`, `/sys/fs/cgroup/cpuset/firecracker/0abbcf2/tasks`, and `/sys/fs/cgroup/pids/firecracker/0abbcf2/tasks`. It also writes ```0``` to `/sys/fs/cgroup/cpuset/firecracker/0abbcf2/cpuset.mems`.
62+
The jailer then writes the current pid to `/sys/fs/cgroup/cpu/firecracker/551e7604-e35c-42b3-b825-416853441234/tasks`, `/sys/fs/cgroup/cpuset/firecracker/551e7604-e35c-42b3-b825-416853441234/tasks`, and `/sys/fs/cgroup/pids/firecracker/551e7604-e35c-42b3-b825-416853441234/tasks`. It also writes ```0``` to `/sys/fs/cgroup/cpuset/firecracker/551e7604-e35c-42b3-b825-416853441234/cpuset.mems`.
6363

64-
Finally, the jailer chroots into `/srv/jailer/firecracker/0abbcf2/root`, switches the **uid** to ```123```, and **gid** to ```100```, and execs `/firecracker —jailed`.
64+
Finally, the jailer chroots into `/srv/jailer/firecracker/551e7604-e35c-42b3-b825-416853441234/root`, switches the **uid** to ```123```, and **gid** to ```100```, and execs `/firecracker —jailed`.
6565

66-
We can now use the socket at `/srv/jailer/firecracker/0abbcf2/api.socket` to interact with the VM.
66+
We can now use the socket at `/srv/jailer/firecracker/551e7604-e35c-42b3-b825-416853441234/api.socket` to interact with the VM.
6767

6868
### Observations
6969

0 commit comments

Comments
 (0)