-
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
fixing link so that /environment is honored #800
Conversation
I think |
I agree we should support older images that have the /environment, but I don't think we should be encouraging people to echo things / write into |
I think that There are also things that cannot be done without catting to an On a separate note, I have no idea why the travis build failed. ??? |
I would advocate for supporting a way to define environment variables during post (that cannot be determined) and still not supporting users echoing into /environment. |
I think the current method is to echo to |
I think we moved the file into the metadata folder because it affords a distinct barrier between "container" and "metadata." To have "some in and some out" would be confusing. Perhaps a workaround would be to allow the user to echo to the same path, but via an environment variable set during bootstrap? Eg,
and that way, we can preserve the clean / distinct -ness of the metadata folder, while still making it an intuitive workflow. |
I should probably say that this is not my idea. I made this PR at @gmkurtzer request following a meeting we had yesterday. So he should probably weigh in. I don't really see any reason to leave Maybe it was a bad idea to pollute the root directory with those files in the first place, but what's done is done. It's a big headache for users if the locations keep changing. |
And I think that adding an env var that we can |
ok @gmkurtzer do you want to weigh in here? |
I think those ideas are great @vsoch! Keep in mind too that the %environment scriptlet will do the same thing, but it won't handle dynamically created info like you are talking about. So yes, let's define the environment variable to the environment file such that this can be done portably. Shall we add that feature to this PR or create another? Up to you @GodloveD! Thanks! |
cool, so you mean this idea:
I think this makes most sense to support the way we are doing things now, while still allowing an easy workflow for the user to do it dynamically. @GodloveD what are your concerns with this approach? |
I think the $ENVIRONMENT_FILE should point to a new environment file, so %environment doesn't accidently get overwritten by a single @GodloveD, I'm curious too what this would complicate. Can you elaborate? Thanks! |
oh +1, that makes sense. Too many 🥕 🥕 >>> |
I think it would complicate matters from the user perspective by adding a 3rd method for setting up the environment. In other words we tell the user "echo to I'm not saying it complicates the code, I'm saying it complicates the user experience. We should consider how much responsibility we are putting on the user to keep up with every change we make because they have to alter their workflow to keep up. |
Echoing to environment was never "best use" only as "this is the workaround for now." In my mind it's very clear to have these two options:
The others that you mention are simply not options we advocate. They were, and still are, hacks. |
Echo'ing to Thank you all, this is great stuff! |
Just a note from the peanut gallery - the choice of emoticons for commenting on issue comments is just abysmal! I can either laugh, thumbs up or down, throw you a party, act confused, or send love. Not enough emotion choices!! |
It's also not great that I don't get a notification about it either! ... Unless I go back and look, I have no idea you emoted on it. lol |
@gmkurtzer I'm not sure if this is exactly what you had a in mind, but have a look. This basically just adds an extra command to the |
If we are echoing to a file in the metadata folder, why are we changing it back to still have |
I'm enabling both methods. |
As long as we aren't advocating and continuing support for users echoing to
it dually gets defined and also added to their "runtime" list. With our method, we can't easily do that. And funny that, if you think about it, we are now supporting both an environment section and our equivalent of |
src/bootstrap.c
Outdated
@@ -83,6 +83,7 @@ int main(int argc, char **argv) { | |||
envar_set("SINGULARITY_DOCKER_USERNAME", singularity_registry_get("DOCKER_USERNAME"), 1); | |||
envar_set("SINGULARITY_CACHEDIR", singularity_registry_get("CACHEDIR"), 1); | |||
envar_set("SINGULARITY_version", singularity_registry_get("VERSION"), 1); | |||
envar_set("SINGULARITY_ENVIRONMENT", "/.singularity.d/env/91-environment.sh", 1); |
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.
I would recommend just adding this to the shell code in deffile-sections.sh instead of the C code.
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.
OK. I'll give it a shot. Note that SINGULARITY_ENVIRONMENT is already a
(rather important) variable. If I add it to deffile-sections.sh
is it
going to get added to the registry? What kind of havoc would that cause?
OK. I'll give it a shot. Note that SINGULARITY_ENVIRONMENT is already a
(rather important) variable. If I add it to `deffile-sections.sh` is it
going to get added to the registry? What kind of havoc would that cause?
…On Thu, Jul 20, 2017 at 1:14 PM, Gregory M. Kurtzer < ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In src/bootstrap.c
<#800 (comment)>
:
> @@ -83,6 +83,7 @@ int main(int argc, char **argv) {
envar_set("SINGULARITY_DOCKER_USERNAME", singularity_registry_get("DOCKER_USERNAME"), 1);
envar_set("SINGULARITY_CACHEDIR", singularity_registry_get("CACHEDIR"), 1);
envar_set("SINGULARITY_version", singularity_registry_get("VERSION"), 1);
+ envar_set("SINGULARITY_ENVIRONMENT", "/.singularity.d/env/91-environment.sh", 1);
I would recommend just adding this to the shell code in
deffile-sections.sh instead of the C code.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#800 (review)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AHUUXLbtCtAIlBamTW_n2mWqWyKclrY_ks5sP4rvgaJpZM4OTjsz>
.
|
Oh, perhaps I missed something. Why does it need to be in the registry? I don't think it would cause any issues, but perhaps I am missing something. Thoughts? |
No it totally doesn't need to be in the registry! I was just afraid it might be automatically added to the registry if I set it in |
Ahhh, I understand now. Yeah, it won't get into the registry if we set it in the deffile-sections.sh. Just set it near the top so it is available for %post. Thanks! |
OK. Hopefully this will do the trick (and do it properly). So basically now if you bootstrap with a definition file like this:
You can do things like this:
|
Looks perfect to me! Merging, thanks! |
Description of the Pull Request (PR):
Fixes backward compatibility with
/environment
fileThis fixes or addresses the following GitHub issues:
/environment
not honored in Singularity 2.3 #799Checkoff for all PRs:
make test
Attn: @singularityware-admin