-
-
Notifications
You must be signed in to change notification settings - Fork 27
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
Registry Entry that Points to a Local SIF File #519
Comments
Love this idea! Okay so let me walk through my thinking about design before jumping into an implementation. So a current container.yaml might look like this: docker: vanessa/salad
url: https://hub.docker.com/r/vanessa/salad
maintainer: '@vsoch'
description: A container all about fork and spoon puns.
latest:
latest: sha256:e8302da47e3200915c1d3a9406d9446f04da7244e4995b7135afd2b79d4f63db
tags:
latest: sha256:e8302da47e3200915c1d3a9406d9446f04da7244e4995b7135afd2b79d4f63db
aliases:
salad: /code/salad I would normally have this stored under $ shpc install vanessa/salad Now let's pretend that I've instead pulled this container, and I have it as a sif, $ shpc add salad_latest.sif vanessa/salad:latest You'd get a module, but not with customization (e.g., just basic commands to shell / exec.) ProposalSo my proposal is to update shpc add to instead of doing:
to instead do:
This means that
The above is nice because shpc can still calculate the digest for your container from the SIF directly, and then plop that into a latest (that you can either keep or change the tag for) and the container is named to match that. You'll also notice the path is the sha, and we do that to easily match it to latest. If you ask to install an old tag that isn't the current path, it will look for it in the same install directory as the container, and only error if it cannot find it. So if the container sif gets deleted from your registry folder, you wouldn't be able to install that exact container again (logically), and this would be up to you to keep/remove and tidy up the recipe. You'd also likely edit the url / description and uncomment variables that you want (e.g., the list of aliases or gpu for your use case). And then when you are happy with the recipe and want to make the module: $ shpc install vanessa/salad Just as you would another standard recipe! And then let's say you have a new version of your container, you'd again do: $ shpc add salad_latest.sif vanessa/salad:2.1 And it would either add the new SIF and version if it's not present, or if you are specifying to overwrite an existing version, it would ask you to confirm first. There are two things I'm not sure about (but I have an opinion, and let me know what you think)!
Let me know your thoughts! Pinging @marcodelapierre because he always has good ideas and feedback too :)
Let me know your thoughts on the above and if I'm missing anything! |
Yes! That's exactly the sort of behavior I'd want. I think having We've got several sifs that were built specifically for our systems (mostly with MPI stacks that behave nicely with our MPI stacks, etc). For your two questions/thoughts at the end:
|
Thank you! Will start on this asap. |
Signed-off-by: vsoch <[email protected]>
Signed-off-by: vsoch <[email protected]>
Signed-off-by: vsoch <[email protected]>
okay all set! #520 Please take your time to review, I only work on personal projects in evenings and on weekends so we have a good 24 hours at least. 😆 |
This is amazing! I'll get it on one of our clusters today to try out the workflow and let you know any pain points I encounter. I'm excited to get it up and running! |
Love it!! I did run into an issue I think: When you initially create the .yml with path: sha256:d252a813426a261e14a2a0d48e9313acd9bee2c75da01ad22c301c4e068d0714.sif
# change this to a URL to describe your container, or to get help
url: https://singularity-hpc.readthedocs.io
# change this to your GitHub alias (or another contact or name)
maintainer: Dinosaur
# A description to describe your container
description: A custom container to do X.
latest:
1.2.gpu: sha256:d252a813426a261e14a2a0d48e9313acd9bee2c75da01ad22c301c4e068d0714
tags:
latest:
# Any custom features?
# features:
# gpu: true
# Put custom aliases here
# aliases:
# echo: /usr/bin/echo
# custom environment variables
# env:
# breakfast: pancakes
1.2.gpu: sha256:d252a813426a261e14a2a0d48e9313acd9bee2c75da01ad22c301c4e068d0714 The tag gets pushed to the bottom rather than remaining with path: sha256:d252a813426a261e14a2a0d48e9313acd9bee2c75da01ad22c301c4e068d0714.sif
# change this to a URL to describe your container, or to get help
url: <URL>
# change this to your GitHub alias (or another contact or name)
maintainer: <maintainer>
# A description to describe your container
description: <description>
latest:
1.2.gpu: sha256:d252a813426a261e14a2a0d48e9313acd9bee2c75da01ad22c301c4e068d0714
tags:
1.2.gpu: sha256:d252a813426a261e14a2a0d48e9313acd9bee2c75da01ad22c301c4e068d0714
# Any custom features?
features:
gpu: true
# Put custom aliases here
# aliases:
# echo: /usr/bin/echo
# custom environment variables
# env:
# breakfast: pancakes (moved the tag to the correct location and removed the Otherwise, it works like a charm! Figuring out MPI stuff now with wrappers :) |
Oh that's so weird! It must be the yaml parser I use, which honors preserving comments. I'll take a look this evening and fix it up - for the time being your fix is totally spot on! |
okay I think I've fixed the bug! |
Hi @vsoch , @georgiastuart , thanks for pinging, and sorry for the delay. One thing I was thinking myself is related to this issue: the ability to create starting container.yaml for remote containers, just to save some typing and monkey job. Now... One of the many interesting things I see in the proposal above is that in the yaml you can now choose to specify And then, for the 2nd part, that is already described above. Now that the SHPC client, and crucially Then, for any containers, regardless whether remote or local, one has two options: Apologies if this adds nothing to the above, or if it makes little sense....it's already Friday evening here :-D |
@marcodelapierre I love that! So we could do either:
OR
To add
|
I would love to be able to change the namespace on pulled containers, but I can also see the argument for not doing it. My vote is for the options $ shpc add docker://vanessa/salad:latest
$ shpc add docker://vanessa/salad:latest dinosaur/salad:latest I'll pull your bug fix today and try it out on another container module install! |
Sounds good! Likely I’ll do the larger update to the PR at the end of the day. Adding this functionality will also require getting tags and digests from a registry, so it sets us up nicely to do some kind of update command (which we were discussing in #501 I think). |
okay creation from |
Amazing, thanks both! |
When I attempt this command: shpc add docker://tensorflow/tensorflow:2.7.1-gpu tensorflow:2.7.1-gpu I get this result: # change this to a URL to describe your container, or to get help
url: https://singularity-hpc.readthedocs.io
# change this to your GitHub alias (or another contact or name)
maintainer: Dinosaur
# Any custom features?
# features:
# gpu: true
# Put custom aliases here
# aliases:
# echo: /usr/bin/echo
# custom environment variables
# env:
# breakfast: pancakes
# A description to describe your container
description: A custom container to do X.
latest:
2.7.1-gpu: 'crane digest tensorflow/tensorflow:2.7.1-gpu:2.7.1-gpu: parsing reference
"tensorflow/tensorflow:2.7.1-gpu:2.7.1-gpu": could not parse reference'
tags:
2.7.1-gpu: 'crane digest tensorflow/tensorflow:2.7.1-gpu:2.7.1-gpu: parsing reference
"tensorflow/tensorflow:2.7.1-gpu:2.7.1-gpu": could not parse reference'
docker: tensorflow/tensorflow:2.7.1-gpu Same for without the namespace change: shpc add docker://tensorflow/tensorflow:2.7.1-gpu |
Signed-off-by: vsoch <[email protected]>
okay should be fixed! It's almost like checking for an error in the response is a good idea (oops for me lol) |
That fixed the add! Now I'm running into the following error with the install: $ vim registry/tensorflow/container.yaml
$ shpc install tensorflow:2.7.1-gpu
singularity pull --name /opt/ohpc/pub/unpackaged/shpc/containers/tensorflow/tensorflow/2.7.1-gpu/2.7.1-gpu/tensorflow-tensorflow:2.7.1-gpu-2.7.1-gpu-sha256:581575fc3a736398f0dff9e950f57f2e6d808296267ac98325451a0b1d101dd0.sif docker://tensorflow/tensorflow:2.7.1-gpu@sha256:581575fc3a736398f0dff9e950f57f2e6d808296267ac98325451a0b1d101dd0
FATAL: While making image from oci registry: error fetching image to cache: failed to get checksum for docker://tensorflow/tensorflow:2.7.1-gpu@sha256:581575fc3a736398f0dff9e950f57f2e6d808296267ac98325451a0b1d101dd0: unable to parse image name docker://tensorflow/tensorflow:2.7.1-gpu@sha256:581575fc3a736398f0dff9e950f57f2e6d808296267ac98325451a0b1d101dd0: Docker references with both a tag and digest are currently not supported It looks like it's duplicating the tag. I think that, in the registry file, the docker identifier should not contain the tag. Here's what it generates: docker: tensorflow/tensorflow:2.7.1-gpu Here's what ended up working: docker: tensorflow/tensorflow Hope this helps! |
oops! So that was actually the same bug (one level up!) should be fixed now. |
seems like some great progress here! :) I really like this new feature addition |
) * refactor of "add" to generate a container.yaml first to close #519 * this set of changes re-organizes the container template to be under the container module, and also moves around some code in modules and container (base.py and config.py) because in development I find the current locations not intuititve enough. * add should only support maintaining the namespace for the docker:// uri Signed-off-by: vsoch <[email protected]>
I've got a few SIFs that I want to make available to our cluster users via shpc. However, these SIFs are locally stored only (for the time being, hopefully we'll have a gitlab docker registry up and running soon!).
I'm reading the registry entry writing documentation and I'd like to be able to define aliases, GPU resources, etc for these local sifs as you could in a registry recipe for a remote image. Is that possible?
I've messed with
shpc add
and it seems like it creates just a default setup / module file without the finer control that you get from a registry recipe, is that correct?The text was updated successfully, but these errors were encountered: