Gentoo Archives: gentoo-dev

From: Rich Freeman <rich0@g.o>
To: gentoo-dev <gentoo-dev@l.g.o>
Subject: Re: [gentoo-dev] Re: An example overlayfs sandbox test
Date: Sun, 24 Sep 2017 11:31:13
Message-Id: CAGfcS_mDgWfAeM6Ga45okM+noPf3wT6PojHv-qTa5VuU4W3Emw@mail.gmail.com
In Reply to: [gentoo-dev] Re: An example overlayfs sandbox test by Martin Vaeth
1 On Sun, Sep 24, 2017 at 4:24 AM, Martin Vaeth <martin@×××××.de> wrote:
2 > Tim Harder <radhermit@g.o> wrote:
3 >
4 > It is the big advantage of overlay that it is implemented in
5 > kernel and does not involve any time-consuming checks during
6 > normal file operations.
7 >
8
9 Why would you expect containers to behave any differently? Either way
10 the kernel gets a path and has to figure out where the path is
11 actually stored, and check the inode for access permissions.
12
13 Now, I am concerned about the time to create the container, if we're
14 going to specify individual files, but the same would be true of an
15 overlay.
16
17 If you create a container and just read-only bind mount all the
18 top-level dirs from the root filesystem into it, and then mount a
19 read-write bind mount into the package build directory, that is just a
20 few operations. I'd expect that to go fast with either a container or
21 overlay solution.
22
23 If you actually want to go to the next step (which our current sandbox
24 does not) and only bind mount the specific files specified in DEPEND
25 and their RDEPEND then you're talking about creating thousands of bind
26 mounts. I have no idea how that performs. However, I suspect it
27 would be at least as slow to populate an overlayfs with just that
28 specific list of files.
29
30 You can't compare the file-level container solution against the
31 filesystem-level overlay solution when both solutions can be
32 implemented either way. If you just replicate the current sandbox
33 functionality then setup time is tiny and you get visibility into
34 write violations only. If you resolve dependencies and map in
35 individual files then you additionally get visibility into read
36 violations, at the cost of more time to create the build environment.
37
38 I'd be interested in how other distros are solving this problem,
39 because fundamentally what we're doing isn't really any different.
40
41 --
42 Rich

Replies

Subject Author
[gentoo-dev] Re: An example overlayfs sandbox test Martin Vaeth <martin@×××××.de>