DistributedScience / Distributed-CellProfiler

Run encapsulated docker containers with CellProfiler in the Amazon Web Services infrastructure.
https://distributedscience.github.io/Distributed-CellProfiler/
Other
37 stars 24 forks source link

Update Docker Image #127

Closed MrHassanMurtaza closed 2 years ago

MrHassanMurtaza commented 2 years ago

First of all, thanks for your work!

Is it possible to update the Docker Image with the latest version of the CellProfiler or at least 4.1.3?

I understand that the latest image has been built and pushed to Dockerhub but having it in the repository will enable us to make minor changes in the code if needed. I tried to build my own image by changing the CellProfiler version but I got a lot of errors w.r.t. dependencies. Please find the error logs trail below:

INFO:__main__:Could not load runcellpose
INFO:__main__:Traceback (most recent call last):
INFO:__main__:Could not load runcellpose
INFO:__main__:  File "/usr/local/lib/python3.8/dist-packages/cellprofiler_core/utilities/core/modules/__init__.py", line 71, in add_module
INFO:__main__:    m = __import__(mod, globals(), locals(), ["__all__"], 0)
INFO:__main__:Traceback (most recent call last):
INFO:__main__:  File "/home/ubuntu/CellProfiler-plugins/runcellpose.py", line 3, in <module>
INFO:__main__:  File "/usr/local/lib/python3.8/dist-packages/cellprofiler_core/utilities/core/modules/__init__.py", line 71, in add_module
INFO:__main__:    from cellpose import models
INFO:__main__:ModuleNotFoundError: No module named 'cellpose'
INFO:__main__:    m = __import__(mod, globals(), locals(), ["__all__"], 0)
INFO:__main__:  File "/home/ubuntu/CellProfiler-plugins/runcellpose.py", line 3, in <module>
INFO:__main__:    from cellpose import models
INFO:__main__:ModuleNotFoundError: No module named 'cellpose'
INFO:__main__:Could not load runcellpose
INFO:__main__:Traceback (most recent call last):
INFO:__main__:  File "/usr/local/lib/python3.8/dist-packages/cellprofiler_core/utilities/core/modules/__init__.py", line 71, in add_module
INFO:__main__:    m = __import__(mod, globals(), locals(), ["__all__"], 0)
INFO:__main__:  File "/home/ubuntu/CellProfiler-plugins/runcellpose.py", line 3, in <module>
INFO:__main__:    from cellpose import models
INFO:__main__:ModuleNotFoundError: No module named 'cellpose'
INFO:__main__:Could not load runcellpose
INFO:__main__:Traceback (most recent call last):
INFO:__main__:  File "/usr/local/lib/python3.8/dist-packages/cellprofiler_core/utilities/core/modules/__init__.py", line 71, in add_module
INFO:__main__:    m = __import__(mod, globals(), locals(), ["__all__"], 0)
INFO:__main__:  File "/home/ubuntu/CellProfiler-plugins/runcellpose.py", line 3, in <module>
INFO:__main__:    from cellpose import models
INFO:__main__:ModuleNotFoundError: No module named 'cellpose'
INFO:__main__:Could not load runstardist
INFO:__main__:Could not load runstardist
INFO:__main__:Traceback (most recent call last):
INFO:__main__:  File "/usr/local/lib/python3.8/dist-packages/cellprofiler_core/utilities/core/modules/__init__.py", line 71, in add_module
INFO:__main__:Traceback (most recent call last):
INFO:__main__:    m = __import__(mod, globals(), locals(), ["__all__"], 0)
INFO:__main__:  File "/home/ubuntu/CellProfiler-plugins/runstardist.py", line 5, in <module>
INFO:__main__:  File "/usr/local/lib/python3.8/dist-packages/cellprofiler_core/utilities/core/modules/__init__.py", line 71, in add_module
INFO:__main__:    from stardist.models import StarDist2D
INFO:__main__:ModuleNotFoundError: No module named 'stardist'
INFO:__main__:    m = __import__(mod, globals(), locals(), ["__all__"], 0)
INFO:__main__:  File "/home/ubuntu/CellProfiler-plugins/runstardist.py", line 5, in <module>
INFO:__main__:    from stardist.models import StarDist2D
INFO:__main__:ModuleNotFoundError: No module named 'stardist'
INFO:__main__:Could not load runstardist
INFO:__main__:Traceback (most recent call last):
INFO:__main__:Could not load runstardist
INFO:__main__:  File "/usr/local/lib/python3.8/dist-packages/cellprofiler_core/utilities/core/modules/__init__.py", line 71, in add_module
INFO:__main__:Traceback (most recent call last):
INFO:__main__:    m = __import__(mod, globals(), locals(), ["__all__"], 0)
INFO:__main__:  File "/usr/local/lib/python3.8/dist-packages/cellprofiler_core/utilities/core/modules/__init__.py", line 71, in add_module
INFO:__main__:  File "/home/ubuntu/CellProfiler-plugins/runstardist.py", line 5, in <module>
INFO:__main__:    m = __import__(mod, globals(), locals(), ["__all__"], 0)
INFO:__main__:  File "/home/ubuntu/CellProfiler-plugins/runstardist.py", line 5, in <module>
INFO:__main__:    from stardist.models import StarDist2D
INFO:__main__:    from stardist.models import StarDist2D
INFO:__main__:ModuleNotFoundError: No module named 'stardist'
INFO:__main__:ModuleNotFoundError: No module named 'stardist'
INFO:__main__:Could not load enhancedmeasuretexture
INFO:__main__:Traceback (most recent call last):
INFO:__main__:  File "/usr/local/lib/python3.8/dist-packages/cellprofiler_core/utilities/core/modules/__init__.py", line 71, in add_module
INFO:__main__:Could not load enhancedmeasuretexture
INFO:__main__:    m = __import__(mod, globals(), locals(), ["__all__"], 0)
INFO:__main__:  File "/home/ubuntu/CellProfiler-plugins/enhancedmeasuretexture.py", line 1057
INFO:__main__:    return setting_values, variable_revision_number
INFO:__main__:Could not load enhancedmeasuretexture
INFO:__main__:Could not load enhancedmeasuretexture
INFO:__main__:                                                  ^
INFO:__main__:Traceback (most recent call last):
INFO:__main__:IndentationError: unindent does not match any outer indentation level
INFO:__main__:Traceback (most recent call last):
INFO:__main__:  File "/usr/local/lib/python3.8/dist-packages/cellprofiler_core/utilities/core/modules/__init__.py", line 71, in add_module
INFO:__main__:  File "/usr/local/lib/python3.8/dist-packages/cellprofiler_core/utilities/core/modules/__init__.py", line 71, in add_module
INFO:__main__:    m = __import__(mod, globals(), locals(), ["__all__"], 0)
INFO:__main__:Traceback (most recent call last):
INFO:__main__:  File "/home/ubuntu/CellProfiler-plugins/enhancedmeasuretexture.py", line 1057
INFO:__main__:    m = __import__(mod, globals(), locals(), ["__all__"], 0)
INFO:__main__:    return setting_values, variable_revision_number
INFO:__main__:  File "/usr/local/lib/python3.8/dist-packages/cellprofiler_core/utilities/core/modules/__init__.py", line 71, in add_module
INFO:__main__:  File "/home/ubuntu/CellProfiler-plugins/enhancedmeasuretexture.py", line 1057
INFO:__main__:                                                  ^
INFO:__main__:IndentationError: unindent does not match any outer indentation level
INFO:__main__:    return setting_values, variable_revision_number
INFO:__main__:    m = __import__(mod, globals(), locals(), ["__all__"], 0)
INFO:__main__:                                                  ^
INFO:__main__:  File "/home/ubuntu/CellProfiler-plugins/enhancedmeasuretexture.py", line 1057
INFO:__main__:    return setting_values, variable_revision_number
INFO:__main__:                                                  ^
INFO:__main__:IndentationError: unindent does not match any outer indentation level
INFO:__main__:IndentationError: unindent does not match any outer indentation level
INFO:__main__:Could not load runimagejscript
INFO:__main__:Traceback (most recent call last):
INFO:__main__:  File "/usr/local/lib/python3.8/dist-packages/cellprofiler_core/utilities/core/modules/__init__.py", line 71, in add_module
INFO:__main__:    m = __import__(mod, globals(), locals(), ["__all__"], 0)
INFO:__main__:  File "/home/ubuntu/CellProfiler-plugins/runimagejscript.py", line 32, in <module>
INFO:__main__:    import imagej
INFO:__main__:ModuleNotFoundError: No module named 'imagej'
INFO:__main__:Could not load runimagejscript
INFO:__main__:Traceback (most recent call last):
INFO:__main__:  File "/usr/local/lib/python3.8/dist-packages/cellprofiler_core/utilities/core/modules/__init__.py", line 71, in add_module
INFO:__main__:    m = __import__(mod, globals(), locals(), ["__all__"], 0)
INFO:__main__:  File "/home/ubuntu/CellProfiler-plugins/runimagejscript.py", line 32, in <module>
INFO:__main__:    import imagej
INFO:__main__:ModuleNotFoundError: No module named 'imagej'
INFO:__main__:Could not load runimagejscript
INFO:__main__:Traceback (most recent call last):
INFO:__main__:  File "/usr/local/lib/python3.8/dist-packages/cellprofiler_core/utilities/core/modules/__init__.py", line 71, in add_module
INFO:__main__:    m = __import__(mod, globals(), locals(), ["__all__"], 0)
INFO:__main__:  File "/home/ubuntu/CellProfiler-plugins/runimagejscript.py", line 32, in <module>
INFO:__main__:    import imagej
INFO:__main__:ModuleNotFoundError: No module named 'imagej'
INFO:__main__:could not load these modules: runcellpose,runstardist,enhancedmeasuretexture,runimagejscript
INFO:__main__:could not load these modules: runcellpose,runstardist,enhancedmeasuretexture,runimagejscript
INFO:__main__:Could not load runimagejscript
INFO:__main__:Traceback (most recent call last):
INFO:__main__:  File "/usr/local/lib/python3.8/dist-packages/cellprofiler_core/utilities/core/modules/__init__.py", line 71, in add_module
INFO:__main__:    m = __import__(mod, globals(), locals(), ["__all__"], 0)
INFO:__main__:  File "/home/ubuntu/CellProfiler-plugins/runimagejscript.py", line 32, in <module>
INFO:__main__:    import imagej
INFO:__main__:ModuleNotFoundError: No module named 'imagej'
bethac07 commented 2 years ago

Hi,

There have not been any updates made to the worker code in the last ~12 months; all the other changes to the repository only affect the non-Dockerized portions of the workflow. The only changes have been to build with different "FROM" statements to pull the relevant CellProfiler Dockers for 4.1.3, etc.

Those errors seem to be plugin related; you will need to add the dependencies for those plugins to your Docker if you want to use them.

Hope that helps!

image

MrHassanMurtaza commented 2 years ago

Thanks for your reply.

I just changed the FROM statement to: FROM cellprofiler/cellprofiler:4.1.3

I didn't change anything else - yet the error only appears when I use my own built image.

Currently only tested on illumination correction pipeline. I did ssh inside the container and it has all the plugins in it. Not sure what could be the issue.

CellProfiler command looks like this:

INFO:__main__:cellprofiler -c -r -p /home/ubuntu/bucket/xxxxxxx.cppipe -i /home/ubuntu/bucket/xxxxxxxx/images/ -o /home/ubuntu/local_output/xxxxxx -d /home/ubuntu/local_output/xxxxx/cp.is.done --data-file=/home/ubuntu/bucket/xxxxxxxxx/load_data_csv/xxxxxxxx-without-illum.csv -g Metadata_Plate=xxxxxxxxxxx --plugins-directory=/home/ubuntu/CellProfiler-plugins
bethac07 commented 2 years ago

I'm not certain what to recommend here, since as I said none of the Dockerized code has changed! But if you're not running something that requires those plugins, none of the "failure to import module X" issues should affect your ability to run the illumination correction pipeline; if there is an issue with specifically running that, it's not in your Traceback here.

MrHassanMurtaza commented 2 years ago

I see that the illumination correction pipeline is still running as expected. I was just a bit worried if it'll affect the results of the illumination correction (from my non-biologists point of view). I'll test one full illumination correction run.