Singularity: bind-mount squashfs images directly or allow them as overlays

Created on 1 May 2018  ·  6Comments  ·  Source: hpcng/singularity

Version of Singularity:

2.4.3

Expected behavior

Here is a use case from a leading AI development organization.

We use squashfs to distribute snapshots of compiled code to jobs so that they can keep developing on the original tree. However, Singularity and squashfs don’t play together nicely because of the absence of the following feature.

“ Ideally, singularity could offer to either bind-mount squashfs images directly or to use them as overlays (with the --overlay option). This is not supported, however -- overlays have to be mounted read/write right now”

Actual behavior

overlays have to be mounted read/write

Steps to reproduce behavior

N/A

Most helpful comment

I believe the OP is asking for the ability to -B read-only squashfs images directly.

example:
singularity shell -B /some/squashfs_image.simg:/some/path/inside container.simg

This would allow you to bind snap apps, possibly other singularity images, etc as read-only filesystems within the container. (without simply binding the file itself)

All 6 comments

Hi @bdfpenguin , squashfs is a read-only filesystem, maybe I misunderstood your issue but writable (ext3 image) overlays are possible with following commands :

$ singularity image.create -s 1024 /tmp/overlay.img
$ singularity shell -o /tmp/overlay.img /tmp/squash.img

Then you can create a writable overlay image for each snapshots. Is that what you want ?

I believe the OP is asking for the ability to -B read-only squashfs images directly.

example:
singularity shell -B /some/squashfs_image.simg:/some/path/inside container.simg

This would allow you to bind snap apps, possibly other singularity images, etc as read-only filesystems within the container. (without simply binding the file itself)

Hi,
I have kinda the same problem.
I was looking for a way to mount/bind an existing data container into another container during runtime.

For example:
container A has the program and expects data in /DATA (which is empty in A)
container B has the data in /DATA

I would like to run A and mount /DATA from B.
Is that currently possible? or maybe a feature that could be useful? or has there been an answer to your question?

Thanks

I wanted to "ping" this feature request. I believe this would be a great feature. Is this being considered? Or are their alternatives?

@robertlugg @bdfpenguin @MBlaschek @jekriske-lilly Since V3 it's possible to load multiple overlay images, let's consider a squashfs image with root tree :

/
/Data

Loading it with singularity shell -o squashfs.img:ro docker://alpine will load overlay image on top of the container image and add /Data to the container image root tree

Feature added in v3

Was this page helpful?
0 / 5 - 0 ratings