-
Notifications
You must be signed in to change notification settings - Fork 60
add --write-fake
via unprivileged overlayfs
#1793
Conversation
@olifre @nschan, can you try this branch? May be relevant to nextflow-io/nextflow#3367 and nextflow-io/nextflow#4463. |
@reidpr Thanks, I gave this a short spin right now, this looks promising! I encountered a few problems:
|
Thank you @olifre; I hadn’t thought of running images owned by others. I can reproduce:
Is this a regression? That is, if we merge this PR with |
This check is (at present) only used to fill in the report The reasoning to include it is that many folks have no idea whether their kernel supports these things (kernel version is not reliable due to distro backports), so let’s try it and tell them. |
It is not, and it does not make things worse 😉. My actual use case relies on a read-only FS which contains the unpacked container. Hence, with Charliecloud without this PR, I do (expectedly) get:
Hence, it's certainly an improvement for me, and it also fixes #96 (but in fact, I currently have images with |
That sounds like a good solution — I also don't think that this flag should ever be used by the regular user, but it could be helpful for packagers (at least for Gentoo, it would be the easiest solution).
I fully and wholeheartedly agree that these checks are a great default approach, and the output is very helpful (and no standard user should need to override / disable them). |
One thing we could do is retain the existing behavior as a backup: overmount a new tmpfs on container |
You are of course correct, my bad: I compared:
for both the previous version and with the unprivileged overlayfs patch. What I forgot was that So you are completely correct, |
@olifre, this is very close if you want to have another look. |
@reidpr Many thanks! I did several more tests using containers stored on a read-only FS. It works exceptionally well. Expectedly, In some cases, I hit the "15 directories" limit, but I did not hit that for actual use cases (I'm not sure if a real use case exists in which someone wants to add, for example, a sub-directory to Thanks a lot (and Merry Christmas!). |
@reidpr Many thanks! Yes, indeed this was a possibility I was thinking of. This approach works great, and the symlink ranch (in this way) seems much more lightweight than the overmount farm 😉 . It removes the limitation without the risk of getting an explosive number of bind mounts, which is great! I did not observe any issues with any use case I had at hand, but of course some differences are seen:
I don't have any use case at hand which has a problem with that, but wanted to mention it, since some tooling is sensitive to such things (e.g. I would personally say "if a real-world program breaks since it does not follow links, but checks permissions / type before resolving links", that's likely not wanted behaviour, but a bug in the program instead. So I think this approach has big advantages, e.g. allowing to bind into crowded directories such as |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good
This pull request implements
ch-run --write-fake
, which overlayfs a writeable tmpfs atop a read-only image. This makes the image appear writeable when it really is not (all writes are discarded on container exit). Needs a recent kernel: upstream 5.11 for the feature to work at all, and upstream 6.6 to avoid some weirdness (distros vary).Closes #96, but I'm tagging it as a stand-alone PR because I think its scope exceeds that of #96.