cerebis / bin3C

Extract metagenome-assembled genomes (MAGs) from metagenomic data using Hi-C.
GNU Affero General Public License v3.0
23 stars 7 forks source link

docker image failure in singularity #35

Closed koadman closed 2 years ago

koadman commented 3 years ago

Attempted use of the 'latest' bin3c docker image via singularity fails:

(base) [u117335@hpcnode01 hiC]$ singularity exec docker://cerebis/bin3c bin3C -h
INFO:    Converting OCI blobs to SIF format
INFO:    Starting build...
Getting image source signatures
Copying blob 01eb078129a0 done  
Copying blob 8aa3d5e985df done  
Copying blob adc0c6326fb0 done  
Copying blob 0bec6cd1dbee done  
Copying blob dff569c99a51 done  
Copying blob 9aff459baf14 done  
Copying blob 07cfb3673553 done  
Copying blob 5f959e355afe done  
Copying blob 961fa702be45 done  
Copying blob 8f44c0eae022 done  
Copying blob 4d1eb2e46571 done  
Copying blob 843071cda642 done  
Copying blob 9c429b79d6ce done  
Copying config a238bc60d4 done  
Writing manifest to image destination
Storing signatures
2021/03/18 13:27:03  info unpack layer: sha256:01eb078129a0d03c93822037082860a3fefdc15b0313f07c6e1c2168aef5401b
2021/03/18 13:27:06  info unpack layer: sha256:8aa3d5e985df933b109a77dcda079c02fdab708bea98e6dbaca42e24cc609ffe
2021/03/18 13:27:12  info unpack layer: sha256:adc0c6326fb0c25e1e2d72f65bee37f30da6281d1b1effef77a7a033c44bbf03
2021/03/18 13:27:12  info unpack layer: sha256:0bec6cd1dbeeb48c1348df4184119b12d528d82befdd8345ac5d2cf55fe5a007
2021/03/18 13:27:15  info unpack layer: sha256:dff569c99a518baf3678c334bbeeb444bd120c10b5bbdd7bc1f2f79c2105b6af
2021/03/18 13:27:15  info unpack layer: sha256:9aff459baf141a2ebff3e1b219c89b53af242bf927073f2f62621e7d09c49a71
2021/03/18 13:27:15  info unpack layer: sha256:07cfb367355330bd5b2a9fedc7559889d18ca80bb321ec048598f90ff8ed446f
2021/03/18 13:27:15  info unpack layer: sha256:5f959e355afea847adff397152f802b4290835af5f79d7ee1b42095024702434
2021/03/18 13:27:15  info unpack layer: sha256:961fa702be45beda4de5ada7e0edf7e9b7be43155c19303d2f79de6dae0784c9
2021/03/18 13:27:16  info unpack layer: sha256:8f44c0eae022b48953543917c44b5cd238e35890cdebe3764fa15692ea6043b6
2021/03/18 13:27:16  info unpack layer: sha256:4d1eb2e4657156faee1e4e6f577d73f4de15bb45fef0970c373cf53095d52100
2021/03/18 13:27:16  info unpack layer: sha256:843071cda642c1f013def1aafa3f44448420507297c45ca316f7b7d94b02f03f
2021/03/18 13:27:16  info unpack layer: sha256:9c429b79d6ce1664769a231270bfefbbbea8d639c6aaee59f70603e5400972d4
INFO:    Creating SIF file...
Traceback (most recent call last):
  File "/usr/bin/bin3C", line 6, in <module>
    from pkg_resources import load_entry_point
ImportError: No module named pkg_resources
escamero commented 2 years ago

Hello,

I am experiencing the same issue (ImportError: No module named pkg_resources). Did you find a solution?

cerebis commented 2 years ago

I must admit I've not looked into this issue! I will make it a priority.

@escamero can you tell me what version of Singularity you are using? We've had some local insdtallations that were really old, which had more problems than others -- mind you, on other projects.

cerebis commented 2 years ago

I have isolated this problem to a simple issue within the Singularity image: the path /lib/python2.7/site-packages is inaccessible due to permissions. As yet, I have not explored how to correct this unintended side-effect.

Short-term Solution

As a running container is read-only this prevents a simple chmod, however you can create a sandbox version that is writable.

With the sandbox created, you can then apply new permissions to this path and bin3C will work.

# sandbox (file-system based)
singularity build --sandbox bin3c_sbsif docker://cerebis/bin3c:latest
# give everyone read and execute permission
chmod a+x,a+r bin3c_sbsif/lib/python2.7/site-packages
# run the container
singularity exec bin3c_sbsif bin3C -h
cerebis commented 2 years ago

The new image has been pushed to Docker Hub.

Please note that the latest code exists in the branch py3. I have just created a Docker image that uses this branch, but I will hold off on releasing it until I have time to test.