-
Notifications
You must be signed in to change notification settings - Fork 426
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
Remove environment variables eval for --bind, --nv and --rocm for build command #6211
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a description of the changed behavior to CHANGELOG.md
How exactly does this affect issue #6181? |
@DrDaveD Doesn't fix the initial issue (as this is a won't fix issue and an expected behavior which would be documented by apptainer/singularity-userdocs#411) but cover the one highlighted in #6181 (comment) |
So to be clear, you're saying that this stops accepting $SINGULARITY_BINDPATH, right? Ok, I see BINDPATH was an additional variable that was included with the --bind option. If that's the case, how was SINGULARITY_BINDPATH honored prior to 3.8.0? I looked through the pr #5911 changeset and I don't see it removing support for SINGULARITY_BINDPATH. In fact, it looks like it adds settings for these variables. Is this change going to cause those to break? I think I'm going to have to test this PR. |
Using the example Singularity file from the comment on issue #6181 if I do For that matter, I don't even understand what the purpose is of these options. Is it only for having these bound in during image build time? I tried using it with a %setup command of |
I would be against having two different behaviors for The actual solution would be to make the behavior of |
The only use case that I can think of is something like guppy. I have to use Edit: that said, I can't remember now if the rpm expects the cuda rpms to be installed, or if it checks for the cuda drivers directly. If it's the former, having |
@DrDaveD
@eburgueno This requires some clarifications,
This is only valid when running non-writable container, not for writable container as mentioned above, Singularity doesn't create anything inside the container to honor bind mount and has always worked this way AFAIR. |
Ok now I see I had a misunderstanding and thought prior to 3.8.0 SINGULARITY_BINDPATH was honored. Since that is the case, I really don't see any reason for stopping to honor these environment variables. I don't think they cause any harm. I don't see any negative side effect. |
@cclerget thank you for the clarification. I must acknowledge that I never used the @DrDaveD the negative side effect of continuing to honor the environment variables at build time is that if the behavior is to be left consistent to that of This is quite literally "it's not a bug, it's a [new] feature!". It is however a feature that introduces a subtle breaking change. And I would be fine with it if it was for a very obvious and widely used use case, but I don't think that's what we're dealing with here. From where I stand, there might be two options moving forward:
|
Ok it didn't occur to me that system administrators would set SINGULARITY_BINDPATH. That's a good reason to not have this feature honor that variable. I would think that more system admins would set the default in singularity.conf, which wouldn't have this side effect. I don't have a strong opinion on your first option, to change --writable and the build command to allow binding to non-existent mount points. It may be technically a challenge because it may require an extra overlay layer between the container and the area that users write into, I'm not sure. I don't like the second proposed option, to change the error into a warning. Now I think this PR is probably good to do, independent of whether or not there is separately added the ability to allow binds to non-existent mountpoints. It does still need an update to CHANGELOG.md to indicate SINGULARITY_BINDPATH is also no longer honored for the build command. |
@eburgueno Yes, Singularity avoid to mess up with the container filesystem in writable mode and create unexpected empty dir/files but the most important argument is from a security point of view, contrary to overlay/underlay mode (allow non-existent binds), writable expose the container filesystem directly to Singularity, placing Singularity in a untrusted filesystem when dealing with file/dir manipulations, it took several v3 versions to handle that securely and the writable behavior wasn't changed since. A way to avoid the need for creating the bind directory during
After build you will noticed that Singularity created directory For most use cases, I think binding into Like @DrDaveD , I'm against option 2, by the past there were complaints about Singularity reporting error as warning or conversely, Singularity must be consistent on that, plus it make things more difficult for maintainers and tests. For option 1, I don't see much reasons to change this behavior to match the build use cases (like suggested above |
This fixes or addresses the following GitHub issues:
Before submitting a PR, make sure you have done the following:
make check
and tested this PR locally with amake test
, andmake testall
if possible (see CONTRIBUTING.md).