-
-
Notifications
You must be signed in to change notification settings - Fork 230
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
Singularity support #617
Singularity support #617
Conversation
b3fcf15
to
ddb22ab
Compare
suggestions for a better naming?
Might be a nice feature; currently, cwltool fails if |
|
This might be a cwltool bug, I think there is another bug report about this (#614) |
@anton-khodak Please examine the code paths involving a |
@anton-khodak and yes, let's switch to |
cwltool/job.py
Outdated
@@ -362,6 +363,44 @@ def add_volumes(self, pathmapper, runtime): | |||
docker_windows_path_adjust(createtmp), | |||
docker_windows_path_adjust(vol.target))) | |||
|
|||
def add_volumes_singularity(self, pathmapper, runtime, stage_output): |
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.
Would it make sense to move this to signularity.py
?
cwltool/job.py
Outdated
|
||
self._setup(kwargs) | ||
|
||
if user_space_docker_cmd: | ||
runtime = [user_space_docker_cmd, u"run"] | ||
if use_singularity: |
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.
Likewise this block could also be nice to move to singularity.py
2f5f1ab
to
ea4f587
Compare
cwltool/job.py
Outdated
@@ -386,8 +348,7 @@ def run(self, pull_image=True, rm_container=True, | |||
try: | |||
env = cast(MutableMapping[Text, Text], os.environ) | |||
if docker_req and kwargs.get("use_container"): | |||
img_id = str(docker.get_from_requirements( | |||
docker_req, True, pull_image)) | |||
img_id = self.get_from_requirements(docker_req, True, pull_image) |
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.
cwltool/job.py:351: error: Incompatible types in assignment (expression has type "unicode", variable has type "str")
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.
thanks! forgot that the returned value was wrapped in string
ea4f587
to
602b4fe
Compare
# Conflicts: # cwltool/job.py
# Conflicts: # cwltool/job.py
Thanks @anton-khodak, very exciting! We've been investigating how to use singularity as a runtime for our CWL workflows and spent some time today with this branch on a handful of our tools from https://github.com/Duke-GCB/bespin-cwl. Some observations/questions from our tests:
Works well though, thanks! |
Thank you @dleehr for the review, we really appreciate it!
According to https://github.com/singularityware/singularity/releases/tag/2.2 the overlayfs support is debuted in Singularity v2.2 (released 2016-10-11). But we should test and document the minimal required version, yes.
|
Jenkins, test this please |
1 similar comment
Jenkins, test this please |
@anton-khodak I can reproduce https://ci.commonwl.org/job/cwltool-pr-conformance-multiver/978/version=v1.0/testReport/py2/7_singularity/Test_empty_writable_dir_with_InitialWorkDirRequirement_inside_Docker/ locally, can you look into that? |
@anton-khodak There is some weirdness on Jenkins, here's a Vagrantfile that I've been using to test locally (as well as verify the system requirements): https://gist.github.com/mr-c/0ec90d717617d074017c0cb38b72d1a4 |
Ah, good catch. I was conflating this with the Persistent Overlay feature in 2.4. I agree that the kernel support should be highlighted. Our cluster runs RHEL 6.8 with a 2.6.32 kernel. It doesn't support overlay, so even though we upgraded to Singularity 2.4.2, this still won't run.
I suppose I assumed broad support from the branch But to answer the question about why not Docker images -
At the end of the day, I agree that support for non-portable Singularity images doesn't seem like a good addition to the specification, especially with the promise of singularity supporting OCI. |
As it turns out, we need Singularity 2.4 for their equivalent of
Hmm... What if before runtime the relevant directories were added to the image?
Got it (and thanks!). Would
👍 |
In theory, yes. I created
Hard to say. I think it's worth adding a second word there, but don't know if runtime is it. Maybe "runner"? If you think more runtimes will be supported, I'd suggest |
Odd that some of the tests are failing on Jenkins. Here's an Ubuntu based Vagrantfile where all the tests pass: https://gist.github.com/mr-c/0ec90d717617d074017c0cb38b72d1a4#file-vagrantfile-ubuntu |
Currently we need two pieces of information: the type of docker-ish runner (docker, udocker/dx-docker, singularity) and the name of the runner's executable (though we can guess based upon the name). In a post-OCI runtime world I hope we can collapse that to just the name of the runner's executable :-) |
This is great - we just wanted to start working on this yesterday and realized that it's already here! :-) Well, almost anyway - because I have one question/issue: What if (like in our case) the HPC cluster (with Singularity installed) is inside a DMZ and thus unable to pull images from the internet? Is there a way to supply the path to a local Singularity image, ideally at runtime (it wouldn't be so nice to have to hard code paths inside the Command Line Tool descriptors)? So basically: is there a way to pull an image (whether Docker or Singularity, I guess) before the corresponding Command Line Tool is executed and ensuring that the local image is used during execution? We are planning to use CWL/toil and an HPC (without internet access) managed by Slurm. The server running CWL/toil is outside the DMZ and has both Docker and Singularity installed. I'm not sure how common that setup is, but I could imagine we're not the only ones with this problem. |
Hello @uniqueg and thank you for your enthusiasm! Does https://github.com/common-workflow-language/cwltool/pull/617/files#diff-d28bca6cb02397efd0ad40c0eefadbb8R40 give you what you need? You should also look into Singularity's To find out which images to download I would |
@mr-c: Thanks a lot for that! The approach works just great after some very slight modifications. |
initial code merged from https://github.com/johnfonner/cwltool/tree/feature-singularity
introduces
--container-manager
option that allows choosing between Docker and Singularity. The default manager is Docker.--container-manager=singularity
as this is rather verbose.docker
executable and asingularity
executable is found?