-
-
Notifications
You must be signed in to change notification settings - Fork 23
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
adding support for alias files #557
Conversation
an alias file is a yaml file "lookup" alongside a container.yaml that can be used to provide tag specific commands for a particular container tag Signed-off-by: vsoch <vsoch@users.noreply.github.com>
Signed-off-by: vsoch <vsoch@users.noreply.github.com>
Signed-off-by: vsoch <vsoch@users.noreply.github.com>
I love how this looks like! |
Also @marcodelapierre when you have some time it would be fun to brainstorm an idea that I’ve been toying with - I really like this idea of providing container transparency (wrt) aliases - it was my initial vision for the scientific filesystem (building the aliases into the entry point) and the interactions here. What I’ve been chewing on is how to move these aliases outside of shpc, meaning making them possible for any container technology to find and use. It could mean something like:
At the most complex level you could imagine a registry just for aliases, and a tool like shpc would ping it to look up containers. And the simplest level is a command line tool that tries to bring them together in some context. |
I will definitely follow-up on this, I would love to brainstorm on it! |
Yes! |
Hello ! One comment: could this be called say Best, |
@muffato that's a great idea! Would it be okay to still be tag specific, and are there any fields we don't want to override? |
|
Ok sounds good! I should be able to update the PR this evening. |
Cool! |
Signed-off-by: vsoch <vsoch@users.noreply.github.com>
Signed-off-by: vsoch <vsoch@users.noreply.github.com>
okay - updates to use "overrides" and for a specific set of fields should be in! And:
I actually think starting with the "short form" and only adding the long form when it's needed makes sense. |
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.
It looks amazingly lean and clean ! Nice one :) Just a couple of comments:
shpc/main/container/config.py
Outdated
@@ -259,26 +304,29 @@ def get_envars(self): | |||
""" | |||
return dict(self.env) if self.env else {} | |||
|
|||
def get_aliases(self): | |||
def get_aliases(self, tag=None): |
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.
This might be a very dumb question: why is this function changed ? I can't see the tag
parameter being used, and I don't understand the renames aliases
→ loaded
and self.aliases
→ aliases
.
Is it a leftover from the previous version where only aliases could be overridden ?
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.
This tag=None should be removed - that was an oversight! When the changes were scoped to aliases, we had lines here that would essentially load the file (and aliases) on demand. Now as overrids, that happens once at the beginning of the install (so we don't need the tag here). It was my oversight to not remove that (now unneeded) tag parameter.
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.
Oh and I see how I renamed the variables - I think I liked the original design better, so I'll make a fix to this tonight to restore the original function. Thanks for catching this I totally missed it!
Co-authored-by: Matthieu Muffato <mm49@sanger.ac.uk>
Signed-off-by: vsoch <vsoch@users.noreply.github.com>
…ty-hpc into add/alias-files
Signed-off-by: vsoch <vsoch@users.noreply.github.com>
I think tests were ok, and the containers just took too long to pull. |
Hi @vsoch . Can I double-check something with you ? I can't manage to install a container any more, even on the main branch. It's not able to separate the tag from the container name
Does it work for you ? |
Co-authored-by: Matthieu Muffato <mm49@sanger.ac.uk>
Signed-off-by: vsoch <vsochat@stanford.edu>
Reproduced - only when I turned on wrapper scripts! The bug was that it needed to default to an {} given that the value was present and None, so I changed to .get or {}. |
Thanks, it can now get installed, but overrides don't work. I'm installing the container like this
I think it's because |
yep I totally see that! Did you add an overrides file to that container you are testing? |
Yes, thanks for checking ;) the overrides files are there, and detected. Here is the content of
|
@muffato can you give me the complete file set to reproduce? I can also make some test cases from them! |
Updated Unpack in
|
…h tag Signed-off-by: vsoch <vsoch@users.noreply.github.com>
…ty-hpc into add/alias-files
Signed-off-by: vsoch <vsoch@users.noreply.github.com>
Signed-off-by: vsoch <vsoch@users.noreply.github.com>
@vsoch : these overrides are not meant to make it to the registry. I wrote them just to test different scenarios |
Also, seeing that you introduced
|
Agree - and sorry for adding the overrides files to the actual container - I knew the envar wasn't real but I though the aliases might be! Will remove them after dinner (soon). |
We can't use it here:
because tag needs to be the full tag with digest, etc. But we can use it one level up! This function is admittedly a bit messy - I am going to see if I can neaten it up, at least with respect to not having tag.name and version! |
Signed-off-by: vsoch <vsoch@users.noreply.github.com>
okay I tried cleaning it up, and removed the extra overrides! Hopefully it looks better now. |
All good for me, I can confirm it all works as intended. Thanks ! |
I will aim to do some quick testing on my end, too, next week. |
my testing will be on the lines of singularity + lmod + wrapper scripts + overrides |
done with my testing, all good on my side! |
An alias file is a yaml file "lookup" alongside a container.yaml that can be used to provide tag specific commands for a particular
container tag. I am also adding the two pawsey containers as an example, and (when the main CI passes) we can trigger the container test CI, as I've also updated those tests to assert that all provided alias files exist!
This will close #536
Signed-off-by: vsoch vsoch@users.noreply.github.com