Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exposing/leveraging filesystem features for containers (casefolding, reflinks) #1178

Open
Conan-Kudo opened this issue Mar 22, 2023 · 14 comments

Comments

@Conan-Kudo
Copy link

In a discussion during Container Plumbing Days 2023, @rhatdan and I got to talking about running Windows applications as Linux containers using Wine. He mentioned that there are filesystem quirks preventing that from working effectively.

In that discussion, I noted that per-directory casefolding is supported in ext4 and Wine can use that if available, and it's on the roadmap for Btrfs as well. Additionally, there's been a proposal and patch to take advantage of reflinks in Wine for space savings.

That led to him suggesting I open a ticket for exploring how to expose these capabilities in filesystems when applications benefit from them. This particular gap in OCI containers is one of the reasons I wind up using systemd-nspawn instead, so it'd be nice to have this in OCI-based containers too.

cc: @davide125, @josefbacik, @giuseppe

@giuseppe
Copy link
Member

thanks for starting the discussion!

In that discussion, I noted that per-directory casefolding is supported in ext4 and Wine can use that if available, and it's on the roadmap for Btrfs as well. Additionally, there's been a proposal and patch to take advantage of reflinks in Wine for space savings.

can we set it recursively for the entire directory and its descendants?

That led to him suggesting I open a ticket for exploring how to expose these capabilities in filesystems when applications benefit from them. This particular gap in OCI containers is one of the reasons I wind up using systemd-nspawn instead, so it'd be nice to have this in OCI-based containers too.

what exactly would you like to see in crun (or Podman) that is missing now?

@Conan-Kudo
Copy link
Author

Conan-Kudo commented Mar 22, 2023

can we set it recursively for the entire directory and its descendants?

Yes, I believe so. I think when you create an empty directory and set the property, everything inherits it by default.

@rhatdan
Copy link
Member

rhatdan commented Mar 23, 2023

I would like to see crun-wine which works like crun-wasm works.

Then if the file system handled it, pull "arch=windows" images and attempt to run them with --crun-wine

@Conan-Kudo
Copy link
Author

what exactly would you like to see in crun (or Podman) that is missing now?

One thing that's probably out of scope is being able to execute a directory or btrfs subvolume as a filesystem root. That makes iterating on base containers super-nice. Also because using btrfs subvolumes directly means I get all that fanciness right out of the gate.

@giuseppe
Copy link
Member

giuseppe commented Mar 23, 2023

One thing that's probably out of scope is being able to execute a directory or btrfs subvolume as a filesystem root.

could you use podman run ... --rootfs $PATH_YOU_WANT_AS_ROOTFS?

@Conan-Kudo
Copy link
Author

Huh TIL, but I guess it wouldn't automatically create a btrfs snapshot to work from to emulate the "ephemeral-ness"? nspawn can do that. But regardless, that's pretty cool.

@giuseppe
Copy link
Member

you could specify :O to create an overlay mount on top of it.

podman run ... --rootfs $PATH_YOU_WANT_AS_ROOTFS:O

That is ephemeral but using overlay

@Hi-Angel
Copy link

talking about running Windows applications as Linux containers using Wine. He mentioned that there are filesystem quirks preventing that from working effectively

FTR, I'm not quite clear what are those quirks. Case-insensitivity is handled by WINE internally, I don't think there's anything to be done on a filesystem or Podman side, is there?

@rhatdan
Copy link
Member

rhatdan commented Aug 14, 2023

The issue as I recall was the file systems being pulled were being stored in mixed case, and this caused issues. Wine issues happened later.

@Conan-Kudo
Copy link
Author

talking about running Windows applications as Linux containers using Wine. He mentioned that there are filesystem quirks preventing that from working effectively

FTR, I'm not quite clear what are those quirks. Case-insensitivity is handled by WINE internally, I don't think there's anything to be done on a filesystem or Podman side, is there?

This is not necessarily true. There's been a lot of work lately to delegate capabilities to Linux where it'd be more efficient to do so. The introduction of filesystem-level casefolding is one such example. Another is the futex_waitv() syscall.

@Conan-Kudo
Copy link
Author

you could specify :O to create an overlay mount on top of it.

podman run ... --rootfs $PATH_YOU_WANT_AS_ROOTFS:O

That is ephemeral but using overlay

In this scenario, OverlayFS needs support for casefolding.

@Hi-Angel
Copy link

Hi-Angel commented Aug 14, 2023

@rhatdan

The issue as I recall was the file systems being pulled were being stored in mixed case, and this caused issues

I still don't see why mixed case is not okay. Podman per se doesn't care about the case of files it works with. And then WINE apps I assume should just work because WINE does case-insensitivity translation internally.

@Conan-Kudo

This is not necessarily true. There's been a lot of work lately to delegate capabilities to Linux where it'd be more efficient to do so. The introduction of filesystem-level casefolding is one such example. Another is the futex_waitv() syscall.

AFAIK all of that is optimization related, not something WINE haven't solved some other way. More over, the futex2 aka futex_waitv() is still not used by WINE despite being merged to the kernel long ago. It may be used in Proton though. And the reflinks you mentioned in 1st post were never merged either, probably because that was from an individual contributor, and contributing to WINE for outsiders is tough for non-technical reasons.

@rhatdan
Copy link
Member

rhatdan commented Aug 14, 2023

Well its been a while you could try to pull a Windows container and see what happens.

@rhatdan
Copy link
Member

rhatdan commented Aug 14, 2023

If community or @flouthoc or @giuseppe would be willing to work with this, I would be thrilled.

I just pulled a Microsoft image and it stored it fine, someone needs to create a crun that uses libwine, and see if they could get this to work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants