-
Notifications
You must be signed in to change notification settings - Fork 516
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
Docker Snakemake container includes Ancient Singularity Version #652
Comments
Why not pull down a Docker URI to Singularity instead? The version 2.6.1 was likely the last release that could be installed with apt. Aside from the GoLang refactor, most of the core functionality still works as you’d expect, which is why there hasn’t been huge drive to change it. I also suspect other rootless container technologies are coming into the scene that could be a good replacement. |
Can you elaborate on this. I'm' not sure what you mean. |
When you specify a container with a docker:// unique resource identifier and —use-singularity the layers are pulled from |
Can dockerhub host singularity images? Or are you just suggesting that I convert all of my singularity recipes to dockerfiles and then use dockerhub to host the docker images? To be clear, I'd prefer to stick with singularity since I have more experience with it. |
No, it in fact is Singularity pulling down Docker layers and assembling them into a SIF at runtime. So you’d just build a Docker container for your analysis instead, and Singularity can use it. |
I agree that converting my existing images to docker images and hosting them on docker hub is a sollution. I'd prefer not to as I already have a bunch of singularity containers/recipes written and would really prefer to not have to redo them all. I may end up going with this sollution, but as an exercise, I'm currently working on building a new snakemake container that includes a modern version of singularity. I can then direct snakemake to use this container instead of the default container when spinning up on aws instances using the "--container-image" flag. If that works, I can just use move my existing singularity images to s3 and pull them with https addresses. If it doesn't work, I'll at least of got some more experience dicking around with docker containers. |
Sounds like a good plan! If you do work to update the singularity version in the container and think it would be useful to others, please contribute a PR. For Docker Hub, make sure to read about their updates purge policy and build/pull you containers with some frequency so they aren’t purged (GitHub actions is good for this). |
Background info, I'm testing this crap using a rule that runs a busco analysis. (as a further test, I used a rule that runs miniasm and that worked completely fine) I now have a docker container that includes snakemake and a new version of singularity. Snakemake+tibanna is correctly using the container I specify with the "--container-image" flag, my singularity image with busco, call it the Assembly Image, is then pulled successfully from s3 via https, then my job starts running, then my busco fails because Busco/Augustus can't write to a file location inside the container. This is basically a quirk of how augustus was implemented that model files basically have to be placed in the install directory for Augustus. Here is the thing though, the same image worked fine with the default Snakemake Image. To summarize:
...Any ideas why this is happening? For reference, you can find my Snakemake Image at... https://github.com/nhartwic/docker-containers |
Your Dockerfile doesn't look much different than what snakemake uses, except you've pinned the version, is that correct? I think if you have two cases, one working and one not, the approach I'd take is to figure out the differences between the two. Perhaps what you can do is:
See if you can reproduce the bug with the above. Then you'll have an idea of how that's related to snakemake (or possibly not). |
I've verified that my Assembly image from shub doesn't work with my Snakemake image. Meaning some difference in the Snakemake image seems to be responsible for this change in behavior...
The differences basically amount to...
...Since this list is so short, it seems like the only candidate here is that singularity 3.X behaves differently from singularity 2.X when it comes to writes to file locations in the image. So apparently there was a good reason snakemake never updated? |
I don’t know if that is true, but it’s a good theory if that is indeed the only difference. What exactly is the error message? |
Here is the relevant log snippet...
I'm not sure if you are familiar with Busco. But basically as part of execution Busco is going to create an Augustus gene prediction model and then tries to add it to Augustus by moving the model files into the Augustus config directory. This directory exists inside the singularity image and apparently can't be written to when singularity 3.X is used but can be written to when singularity 2.X is used, assuming my current understanding of what is happening is correct. |
Since my intended sollution is apparently not going to work. On to sollution two. Build docker containers instead of singularity containers. Anyone have any experience wrapping conda envs in a docker container in a way that actually works with singularity as used by snakemake? My initial attempt is found here... ...And was derived from... https://pythonspeed.com/articles/activate-conda-dockerfile/ ...But this isn't correctly activating the conda environment inside the singularity container that gets created by a call to "singularity pull". Any advice would be appreciated. Any documentation detailing what actually happens when singularity pulls a docker container would be appreciated. |
Hey @nhartwic I can try to help! Can you please provide a dummy Snakefile and any other dependencies, along with the command you are running to reproduce the issue? If I can reproduce and understand there’s a good chance I can help. |
I got there with a bit of trial and error this morning. Here is an example of the dockerfile I'm currently using to wrap a conda env that seems to cooperate with singularity...
...A few notes on this...
...All that said, the end result of this is that any command singularity sends to the container it builds based on the docker container that this docker file specifies will be executed with "myenv" activated using the typical activation method of conda, which should work for essentially any conda env. |
At this point I think I have a sollution that works. And the original purpose of this issue has been explored, if not completely. I'm willing to call this issue closed. |
I'm trying to use snakemake with tibanna. As part of this, I have some containers that let me run my workflows. I had been using singularity-hub to host my containers, but it has a quota/limit on number of pulls per week. So singularity hub is basically useless to me.
My initial sollution was to just host the images on my aws bucket and pull them using https addresses. New versions of singularity handle this just fine. At least as of 3.5.3 which is the version I tend to use. The version of singularity packaged with the snakemake docker container is 2.6.1 Is there some good reason that the singularity version used is so old, or has it just gone ignored for a while?
The text was updated successfully, but these errors were encountered: