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

singularity can not make mountspaces (mount MS_SLAVE) #2911

Closed
ct-clmsn opened this issue Feb 4, 2018 · 10 comments
Closed

singularity can not make mountspaces (mount MS_SLAVE) #2911

ct-clmsn opened this issue Feb 4, 2018 · 10 comments

Comments

@ct-clmsn
Copy link

ct-clmsn commented Feb 4, 2018

  1. Windows Version/build number
  • Windows 10 CLI ver output

Microsoft Windows [Version 10.0.16299.125]

  • WSL "gcc --version" output

(Ubuntu5.4.1-2ubuntu~14.04) 5.4.1 20160904

  • WSL "uname -a" output

Linux hostname 4.4.0-43-Microsoft #1-Microsoft Wed Dec31 14:42:53 PST 2014 x86_64 x86_64 x86_64 GNU/Linux

  1. Steps required to reproduce

git clone https://github.com/singularityware/singularity.git
cd singularity
./autogen.sh
./configure
make
sudo make install
sudo singularity run shub://vsoch/singularity-images

  1. Copy of terminal output

$ sudo singularity run shub://vsoch/singularity-images

Progress |===================================| 100.0%
ERROR : Could not make mountspaces slave: Invalid argument
ABORT : Retval = 255

  1. Expected behavior

The sun is shining, the weather is sweet...
You say please, but all I see is pizza..

  1. Strace (running strace -ff)

https://gist.github.com/ct-clmsn/7bb63e07673330965bdf3e2f782ab951

Attempted to run the singularity container software. The software compiles successfully. But, has runtime execution errors - specifically running the introductory tutorial.

Detailed logs emailed to support

@therealkenc
Copy link
Collaborator

therealkenc commented Feb 5, 2018

Ref ##2902. Fail is now:

unshare(CLONE_FS)                       = 0
unshare(CLONE_NEWNS)                    = 0
mount(NULL, "/", NULL, MS_REC|MS_SLAVE, NULL) = -1 EINVAL (Invalid argument)

Someone is going to tell you that combination of flags is not currently supported.

Might be fun to put the following at the top of mnt.c around line 22 and recompile:

#undef SINGULARITY_MS_SLAVE
#define _GNU_SOURCE
#include <errno.h>
#include <fcntl.h>

That will change the call to:

mount(NULL, "/", NULL, MS_PRIVATE | MS_REC, NULL)

Not that I am bullish on you seeing singularity light up. It might just return EINVAL also. Or it might get you to the next blocker. Or maybe you'll get lucky.

@therealkenc
Copy link
Collaborator

So I did the #undef SINGULARITY_MS_SLAVE hack for the lulz. That will get you to:

$ sudo singularity run shub://vsoch/singularity-images
Progress |===================================| 100.0%
WARNING: Requested option 'mount slave' is not available on this host, using private
ERROR  : No more available loop devices, try increasing 'max loop devices' in singularity.conf
ABORT  : Retval = 255

Don't need to even look at the strace for that one: that is #131. Even if WSL had a loop device (it doesn't), a very good assumption is Singularity will try to mount an ext234 image on that loop device next. Which isn't in the cards, pretty much full stop.

No sunshine or sweet weather either. I might order pizza. But this issue can be a landing zone for MS_SLAVE, which is legit enough. Good post.

@therealkenc therealkenc changed the title singularity can not make mountspaces singularity can not make mountspaces (mount MS_SLAVE) Feb 5, 2018
@SvenGroot
Copy link
Member

Yeah, as @therealkenc we currently have no support for slave or shared mounts, nor loop devices.

@ct-clmsn
Copy link
Author

ct-clmsn commented Feb 9, 2018

@therealkenc thanks for looking into this issue!

@jbleonesio
Copy link

This also prevent Flatpak/Bubblewrap to work properly as they heavily rely on mounting directories

https://github.com/projectatomic/bubblewrap/blob/30548332a7d04328487906edcd999c3dab67db28/bubblewrap.c#L1995

@therealkenc
Copy link
Collaborator

Yes, but bubblewrap.c is a who's-who of stuff we don't have. MS_SLAVE isn't going to get you there.

@jbleonesio
Copy link

Agreed, but still a step to the next blocker.
Do you have a more precise idea of what seems to be missing in order to get Flatpak running ? Thanks !

@therealkenc
Copy link
Collaborator

I do, but it will turn this thread into a Flatpak/Bubblewrap discussion unrelated to MS_SLAVE (followed by someone mentioning Docker, and ultimately ending badly in the Law of WSL github). Bubblewrap doesn't look too bad on a second glance though, assuming some of the CLI params are avoided. The team has done a lot of work on (what looks like) enabling container scenarios. I'll ref this thread if I have anything concrete to offer. Who knows; stranger stuff has lit up.

@Brian-Perkins
Copy link

Mount propagation flag support added in build 17666.

@alexlarsson
Copy link

For the record, the wip/WSL bubblewrap branch has this workaround: containers/bubblewrap@088c24d

I have not verified if t the fix that is available works for flatpak though.

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

6 participants