tailhook / vagga

Vagga is a containerization tool without daemons
http://vagga.readthedocs.org
MIT License
1.86k stars 96 forks source link

OverlayFS support #317

Open tailhook opened 8 years ago

tailhook commented 8 years ago

This is a big ticket tracking overlayfs support.

The plan, in the order of importance:

I think we should try at least to support !Container for the next milestone (which will be 0.7.0)

piranna commented 7 years ago

Would this allow to mount an overlayfs filesystem from inside a running vagga instance?

tailhook commented 7 years ago

@piranna you already can do this, if you have the kernel which supports unprivileged overlayfs (ubuntu has, as well as our arch linux kernel build). You can check it with vagga _check_overlayfs_support. But otherwise it has nothing to do with vagga using the overlayfs support per se.

piranna commented 7 years ago

I supposed, just wanted to be sure because last time I tried to do it I was not able, and yesterday trying to do the same with Docker my machine crashed each time I tried it. Native mounting on QEmu or real hardware (no containers) works flawlessly, so probably there's a problem in other place.

jirutka commented 7 years ago

Is it really a good idea to use OverlayFS for layered FS? Based on some sources I read, it’s far from stable, it’s one of many mistakes of Docker Inc…

I think that it’d be better to utilize Btrfs or LVM for this feature.

tailhook commented 7 years ago

@jirutka, can you share a link? I though docker had problems with first version of overlayfs driver, but they have fixed all issues in the second version (by "overlayfs driver" I mean some code in docker that handles overlayfs, they have same in-kernel subsystem).

I think that it’d be better to utilize Btrfs or LVM for this feature.

We can't use LVM as unprivileged user. Also, LVM is quite wasteful (because it copies on write whole disk blocks which usually are ~ 10MiB), up to the level where it doesn't make sense to use (i.e. doesn't provide any savings comparing to full copy).

Btrfs support is planned. But there are not many systems which use btrfs for their /home directory. And setting up storage-dir with btrfs filesystem is too complex for most users (for example most home computers and workstations have a maximum-sized /home, so can't create another partition easily).

On the other hand, we can achieve quite similar savings by just using hardlinks. It's a lot less safer, and doesn't work for all use cases, but can provide as good results as using btrfs for many simpler use cases (but will not work for Snashot volumes, for example).

jirutka commented 7 years ago

can you share a link?

For example this one: https://thehftguy.com/2016/11/01/docker-in-production-an-history-of-failure/. And my co-worker warned me about using OverlayFS on ext4, but don’t remember details.

On the other hand, we can achieve quite similar savings by just using hardlinks.

How? Hardlinks can work only if you can ensure that files will not be modified in-place, but always recreated.

tailhook commented 7 years ago

How? Hardlinks can work only if you can ensure that files will not be modified in-place, but always recreated.

Sure. We can hardlink equal files after image has been built, to save space. As I've already said it doesn't help with Snapshot volumes. But for all other purposes we mount container image read-only when running all the commands.

jirutka commented 7 years ago

We can hardlink equal files after image has been built, to save space.

Aha, sounds like a good solution!