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

allowing user-bind paths that include colon in their names #5923

Closed
arozenfe opened this issue Apr 12, 2021 · 3 comments · Fixed by #6008
Closed

allowing user-bind paths that include colon in their names #5923

arozenfe opened this issue Apr 12, 2021 · 3 comments · Fixed by #6008
Milestone

Comments

@arozenfe
Copy link

Version of Singularity:

$ singularity version
3.7.1-1

Problem

Singularity cannot bind mount files or directory that include colon in their names. Currently singularity always identifies colons as delimiters.

We need some way to escape special characters like colon from the file/directory name we want to mount, in both the source and the destination.

Steps to reproduce this behavior

$ ls -l /tmp/some:file
-rw-r--r-- 1 root root 0 Apr 12 07:00 /tmp/some:file

$ singularity exec -B /tmp/some:file image.sif /bin/bash
FATAL:   container creation failed: unable to add /tmp/some to mount list: destination must be an absolute path

$ singularity exec -B '/tmp/some\:file' image.sif /bin/bash
FATAL:   container creation failed: unable to add /tmp/some\ to mount list: destination must be an absolute path

$ singularity exec -B '/tmp/some\:file:/tmp/destfile' image.sif /bin/bash
FATAL:   while parsing bind path: while getting bind path: /tmp/destfile is not a valid bind option

We tried to add backslash and quotes in different combinations, but nothing worked.

@carterpeel
Copy link
Contributor

Hello,

This is a templated response that is being sent out to all open issues. We are working hard on 'rebuilding' the Singularity community, and a major task on the agenda is finding out what issues are still outstanding.

Please consider the following:

  1. Is this issue a duplicate, or has it been fixed/implemented since being added?
  2. Is the issue still relevant to the current state of Singularity's functionality?
  3. Would you like to continue discussing this issue or feature request?

Thanks,
Carter

@carterpeel
Copy link
Contributor

Hi Arozenfe,

with the current state of how Singularity handles bind paths, : is used as a delimiter.

I can attempt to change the regex that parses bind paths to allow for : following an "ignore the next character" verb, but that might cause problems for some.

When you run singularity exec -B /tmp/some:file image.sif /bin/bash, it's interpreting that as "/tmp/some --> file".
This will not work as file is not an absolute path, and /tmp/some does not exist.

cclerget added a commit to cclerget/singularity that referenced this issue Jun 2, 2021
…ng syntax:

- `singularity shell -B /tmp/comma\\,separated_dir:/data image`
- `singularity shell -B "/tmp/comma\,separated_dir":/data image`
- `singularity shell -B /tmp/colon\\:sep_dir:/data image`
- `singularity shell -B /tmp/"colon\:sep_dir":/data image`

- Fixes apptainer#5923
- Fixes apptainer#5959
cclerget added a commit to cclerget/singularity that referenced this issue Jun 2, 2021
…ng syntax:

- `singularity shell -B /tmp/comma\\,separated_dir:/data image`
- `singularity shell -B "/tmp/comma\,separated_dir":/data image`
- `singularity shell -B /tmp/colon\\:sep_dir:/data image`
- `singularity shell -B /tmp/"colon\:sep_dir":/data image`

- Fixes apptainer#5923
- Fixes apptainer#5959
cclerget added a commit to cclerget/singularity that referenced this issue Jun 2, 2021
…ng syntax:

- `singularity shell -B /tmp/comma\\,separated_dir:/data image`
- `singularity shell -B "/tmp/comma\,separated_dir":/data image`
- `singularity shell -B /tmp/colon\\:sep_dir:/data image`
- `singularity shell -B /tmp/"colon\:sep_dir":/data image`

- Fixes apptainer#5923
- Fixes apptainer#5959
@cclerget cclerget added this to the 3.8.1 milestone Jun 4, 2021
cclerget added a commit to cclerget/singularity that referenced this issue Jun 4, 2021
…ng syntax:

- `singularity shell -B /tmp/comma\\,separated_dir:/data image`
- `singularity shell -B "/tmp/comma\,separated_dir":/data image`
- `singularity shell -B /tmp/colon\\:sep_dir:/data image`
- `singularity shell -B /tmp/"colon\:sep_dir":/data image`

- Fixes apptainer#5923
- Fixes apptainer#5959
cclerget added a commit to cclerget/singularity that referenced this issue Jun 4, 2021
…ng syntax:

- `singularity shell -B /tmp/comma\\,separated_dir:/data image`
- `singularity shell -B "/tmp/comma\,separated_dir":/data image`
- `singularity shell -B /tmp/colon\\:sep_dir:/data image`
- `singularity shell -B /tmp/"colon\:sep_dir":/data image`

- Fixes apptainer#5923
- Fixes apptainer#5959
@josefwells
Copy link

I'll note that docker solves this with a verbose --mount option:
moby/moby#8604

As someone that lives in both worlds, it is nice when the approaches are at least similar.

You could probably use --fusemount and some kind of magic, but my preference is to advise people to not use colons in paths :)

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

Successfully merging a pull request may close this issue.

5 participants