Skip to content
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

add cellprofiler v4.2.1 tool #1163

Merged
merged 10 commits into from Apr 25, 2022
Merged

Conversation

sunyi000
Copy link
Contributor

  • main module of cellprofiler 4.2.1 as galaxy tool

@sunyi000
Copy link
Contributor Author

sunyi000 commented Sep 15, 2021

@bgruening I still get all tests passed on my local machine with clean setup, but failed during CI.

  • the only difference I see is that the ci workflow uses py3.7 during test and combined_test..
  • since cellprofiler only works with 3.8 and above (https://github.com/CellProfiler/CellProfiler/blob/master/setup.py#L96) I just want to try upgrading the python version in ci.yaml but it seems that circleci cached the old version somewhere.
  • could you help me clear the cache, or do I simply just need to rename the cache key in ci.yml ?

just want to see if changing python version in ci.yml makes any difference

thanks very much

@bgruening
Copy link
Owner

Please run your tests locally with planemo test --docker. Are they failing when you do that?

@sunyi000
Copy link
Contributor Author

Please run your tests locally with planemo test --docker. Are they failing when you do that?

it succeeded. all 4 tests passed with planemo test --docker cellprofiler.xml

Co-authored-by: Cristóbal Gallardo <gallardoalbac@gmail.com>
sunyi000 and others added 2 commits September 22, 2021 16:11
Co-authored-by: Cristóbal Gallardo <gallardoalbac@gmail.com>
@gallardoalba
Copy link
Contributor

gallardoalba commented Sep 22, 2021

When I run it in local, I get this error:

Screenshot from 2021-09-22 18-22-32

But it works after downgrading the NumPy version:

Screenshot from 2021-09-22 18-23-24

Then I guess that it is necessary to modify the conda recipe.

@sunyi000
Copy link
Contributor Author

When I run it in local, I get this error:

Screenshot from 2021-09-22 18-22-32

But it works after downgrading the NumPy version:

Screenshot from 2021-09-22 18-23-24

Then I guess that it is necessary to modify the conda recipe.

ah.. I got numpy 1.19 in my environment..I will go change the recipe then...
thanks

@sunyi000
Copy link
Contributor Author

sunyi000 commented Sep 22, 2021

I just updated the recipe, and created a PR 30645
@gallardoalba Thank you.

@gallardoalba
Copy link
Contributor

I just updated the recipe, and created a PR 30645
@gallardoalba Thank you.

You can ask here for a review https://gitter.im/bioconda/Lobby

@simonbray
Copy link
Collaborator

Could you rename the @CP_VERSION@ token to @TOOL_VERSION@? This will allow automated updates of the cellprofiler tool. :)

@gallardoalba
Copy link
Contributor

gallardoalba commented Sep 23, 2021

It seems to be a similar error @sunyi000 scikit-image/scikit-image#4664. I think that you will need to create a Docker image in order to solve it.

@sunyi000
Copy link
Contributor Author

thanks for the link.. I will create a docker
but I'm still confused why this is working in a local env...

@gallardoalba
Copy link
Contributor

thanks for the link.. I will create a docker
but I'm still confused why this is working in a local env...

In that case, the reason is that in local don't exist such problems with folder permissions, but in Galaxy, due to security reasons, there are restrictions. Regards.

Co-authored-by: Simon Bray <32272674+simonbray@users.noreply.github.com>
@mvdbeek
Copy link
Collaborator

mvdbeek commented Oct 29, 2021

In that case, the reason is that in local don't exist such problems with folder permissions, but in Galaxy, due to security reasons, there are restrictions. Regards.

To clarify this, the tool is writing to $HOME, as you can see from the traceback:

Traceback (most recent call last):
  File "/tmp/tmpzruufokr/galaxy-dev/test/functional/test_toolbox.py", line 98, in test_tool
    self.do_it(tool_version=tool_version, test_index=test_index)
  File "/tmp/tmpzruufokr/galaxy-dev/test/functional/test_toolbox.py", line 35, in do_it
    verify_tool(tool_id, self.galaxy_interactor, resource_parameters=resource_parameters, test_index=test_index, tool_version=tool_version, register_job_data=register_job_data)
  File "/tmp/tmpzruufokr/galaxy-dev/lib/galaxy/tool_util/verify/interactor.py", line 1038, in verify_tool
    raise e
  File "/tmp/tmpzruufokr/galaxy-dev/lib/galaxy/tool_util/verify/interactor.py", line 1034, in verify_tool
    job_stdio = _verify_outputs(testdef, test_history, jobs, tool_id, data_list, data_collection_list, galaxy_interactor, quiet=quiet)
  File "/tmp/tmpzruufokr/galaxy-dev/lib/galaxy/tool_util/verify/interactor.py", line 1208, in _verify_outputs
    raise JobOutputsError(found_exceptions, job_stdio)
galaxy.tool_util.verify.interactor.JobOutputsError: Job in error state.. tool_id: cp_cellprofiler4, exit_code: 1, stderr: Traceback (most recent call last):
  File "/usr/local/bin/cellprofiler", line 7, in <module>
    from cellprofiler.__main__ import main
  File "/usr/local/lib/python3.8/site-packages/cellprofiler/__main__.py", line 24, in <module>
    from cellprofiler_core.object import ObjectSet
  File "/usr/local/lib/python3.8/site-packages/cellprofiler_core/object/__init__.py", line 1, in <module>
    from ._object_set import ObjectSet
  File "/usr/local/lib/python3.8/site-packages/cellprofiler_core/object/_object_set.py", line 1, in <module>
    from ._objects import Objects
  File "/usr/local/lib/python3.8/site-packages/cellprofiler_core/object/_objects.py", line 9, in <module>
    from ..utilities.core.object import downsample_labels
  File "/usr/local/lib/python3.8/site-packages/cellprofiler_core/utilities/core/object.py", line 3, in <module>
    import skimage.color
  File "/usr/local/lib/python3.8/site-packages/skimage/__init__.py", line 135, in <module>
    from .data import data_dir
  File "/usr/local/lib/python3.8/site-packages/skimage/data/__init__.py", line 270, in <module>
    _init_pooch()
  File "/usr/local/lib/python3.8/site-packages/skimage/data/__init__.py", line 255, in _init_pooch
    os.makedirs(data_dir, exist_ok=True)
  File "/usr/local/lib/python3.8/os.py", line 213, in makedirs
    makedirs(head, exist_ok=exist_ok)
  File "/usr/local/lib/python3.8/os.py", line 213, in makedirs
    makedirs(head, exist_ok=exist_ok)
  File "/usr/local/lib/python3.8/os.py", line 213, in makedirs
    makedirs(head, exist_ok=exist_ok)
  File "/usr/local/lib/python3.8/os.py", line 223, in makedirs
    mkdir(name, mode)
PermissionError: [Errno 13] Permission denied: '/home/runner/.cache'

The home directory is often not writable on HPC systems, and never when running in docker. This is fixed by using a profile version >= 18.01 in 884f9e6

What this does is provide a home directory for the job that is within the job working directory, and so is mounted R/W in docker. All new tools should use a profile version that shouldn't be older than about a year or two (see here for the recommendations for submitting tools to the IUC: https://galaxy-iuc-standards.readthedocs.io/en/latest/best_practices/tool_xml.html#tool-profile).

@gallardoalba
Copy link
Contributor

In that case, the reason is that in local don't exist such problems with folder permissions, but in Galaxy, due to security reasons, there are restrictions. Regards.

To clarify this, the tool is writing to $HOME, as you can see from the traceback:

Traceback (most recent call last):
  File "/tmp/tmpzruufokr/galaxy-dev/test/functional/test_toolbox.py", line 98, in test_tool
    self.do_it(tool_version=tool_version, test_index=test_index)
  File "/tmp/tmpzruufokr/galaxy-dev/test/functional/test_toolbox.py", line 35, in do_it
    verify_tool(tool_id, self.galaxy_interactor, resource_parameters=resource_parameters, test_index=test_index, tool_version=tool_version, register_job_data=register_job_data)
  File "/tmp/tmpzruufokr/galaxy-dev/lib/galaxy/tool_util/verify/interactor.py", line 1038, in verify_tool
    raise e
  File "/tmp/tmpzruufokr/galaxy-dev/lib/galaxy/tool_util/verify/interactor.py", line 1034, in verify_tool
    job_stdio = _verify_outputs(testdef, test_history, jobs, tool_id, data_list, data_collection_list, galaxy_interactor, quiet=quiet)
  File "/tmp/tmpzruufokr/galaxy-dev/lib/galaxy/tool_util/verify/interactor.py", line 1208, in _verify_outputs
    raise JobOutputsError(found_exceptions, job_stdio)
galaxy.tool_util.verify.interactor.JobOutputsError: Job in error state.. tool_id: cp_cellprofiler4, exit_code: 1, stderr: Traceback (most recent call last):
  File "/usr/local/bin/cellprofiler", line 7, in <module>
    from cellprofiler.__main__ import main
  File "/usr/local/lib/python3.8/site-packages/cellprofiler/__main__.py", line 24, in <module>
    from cellprofiler_core.object import ObjectSet
  File "/usr/local/lib/python3.8/site-packages/cellprofiler_core/object/__init__.py", line 1, in <module>
    from ._object_set import ObjectSet
  File "/usr/local/lib/python3.8/site-packages/cellprofiler_core/object/_object_set.py", line 1, in <module>
    from ._objects import Objects
  File "/usr/local/lib/python3.8/site-packages/cellprofiler_core/object/_objects.py", line 9, in <module>
    from ..utilities.core.object import downsample_labels
  File "/usr/local/lib/python3.8/site-packages/cellprofiler_core/utilities/core/object.py", line 3, in <module>
    import skimage.color
  File "/usr/local/lib/python3.8/site-packages/skimage/__init__.py", line 135, in <module>
    from .data import data_dir
  File "/usr/local/lib/python3.8/site-packages/skimage/data/__init__.py", line 270, in <module>
    _init_pooch()
  File "/usr/local/lib/python3.8/site-packages/skimage/data/__init__.py", line 255, in _init_pooch
    os.makedirs(data_dir, exist_ok=True)
  File "/usr/local/lib/python3.8/os.py", line 213, in makedirs
    makedirs(head, exist_ok=exist_ok)
  File "/usr/local/lib/python3.8/os.py", line 213, in makedirs
    makedirs(head, exist_ok=exist_ok)
  File "/usr/local/lib/python3.8/os.py", line 213, in makedirs
    makedirs(head, exist_ok=exist_ok)
  File "/usr/local/lib/python3.8/os.py", line 223, in makedirs
    mkdir(name, mode)
PermissionError: [Errno 13] Permission denied: '/home/runner/.cache'

The home directory is often not writable on HPC systems, and never when running in docker. This is fixed by using a profile version >= 18.01 in 884f9e6

What this does is provide a home directory for the job that is within the job working directory, and so is mounted R/W in docker. All new tools should use a profile version that shouldn't be older than about a year or two (see here for the recommendations for submitting tools to the IUC: https://galaxy-iuc-standards.readthedocs.io/en/latest/best_practices/tool_xml.html#tool-profile).

Great to know, thanks!

@sunyi000
Copy link
Contributor Author

sunyi000 commented Oct 29, 2021

thank you very much for the clarification and all the helps @mvdbeek @gallardoalba

@jkh1
Copy link

jkh1 commented Apr 25, 2022

I was looking for it in the toolshed and realized it wasn't there yet. It looks like all checks are fine. Is there any other thing that's holding up the merge?

@gallardoalba gallardoalba merged commit 4cb71c4 into bgruening:master Apr 25, 2022
@gallardoalba
Copy link
Contributor

I was looking for it in the toolshed and realized it wasn't there yet. It looks like all checks are fine. Is there any other thing that's holding up the merge?

Done!

@jkh1
Copy link

jkh1 commented Apr 26, 2022

Thanks a lot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants