Fusion needs to be the entrypoint of the container to be sure that it’s the init process and all the subprocesses will be able to access Fusion filesystem.
To achieve this, Wave is changing the entrypoint of the image to /usr/bin/fusion but adding the environment variable WAVE_ENTRY_CHAIN with the “real” image entrypoint.
If WAVE_ENTRY_CHAIN is defined, then Fusion will execute WAVE_ENTRY_CHAIN + whatever command is passed. Here, your --entrypoint '' is ignored because Fusion executes the one defined at the image level.
I’ve never tested, but most likely, you can overwrite WAVE_ENTRY_CHAIN by defining:
But, given that all these seem too much of a workaround, it will be interesting to understand why, in the first place, you need to overwrite an entrypoint.
So the workaround (which works outside of Seqera Platform / Wave / Fusion) is to reset the container entrypoint, then the process uses bash normally and the command works.
@FloWuenne - given that this process only supports the Docker container and not Conda / anything else. Is there any reason not to just truncate the process script to this?
Thanks so much for the explanation and reply @jordeu !
The reason we need to overwrite entrypoints is that for some of our docker images that are not on conda, the authors of the docker containers unfortunately define an entrypoint that is not compatible with nf-core module definition / execution and thus we overwrite the entrypoint to make them compatible.
We can try your suggested fix using the docker.runOptions setting: docker.runOptions = '--entrypoint "" -e WAVE_ENTRY_CHAIN=""'
@ewels how would one do this in a practical sense? Since the megatest only gets launched at release and we would have to modify the config file?
To test it you can set a config within Seqera Platform and launch manually. Then edit the pipeline code (either nextflow.config or test_full.config or somewhere else) for future automated release runs.
To launch from Seqera platform I actually just add molkart as a pipeline to the launchpad, attach the same compute environment as the full test used and specify the config and dataset right? Nothing different from a normal Seqera platform run via Launchpad in my private workspace? @ewels
I always wondered if there is any case where using an image with an entrypoint makes sense on Nextflow. Unless the entrypoint is bash, it may always have this problem.
To be honest @jordeu, personally I think defining entrypoints on docker just shouldn’t be done by software authors for bioinformatic software packages…
We just tried simply stating mesmer in the nf-core module, which complains that it can’t find run_app.py, probably because in the Dockerfile they change the WORKDIR…
Ah you were set to have view-only rights in the nf-core workspace, I’ve just bumped that - should show up now.
I’m increasingly thinking that a custom image (can be hosted at the nf-core quay.io account) is the best solution here, if not bioconda. A custom image should be very little effort to set up.
So I will try the WAVE_ENTRY_CHAIN config that @jordeu mentioned once, to see whether that actually works.
For the future, we can definitely host our own custom image for Mesmer. For hosting on the nf-core quay.io is it just standard procedure: Write Dockerfile → tag → push? I guess we need permission for the nf-core quay.io then? Otherwise I can also host it on my personal dockerhub.
Just to add to the general problems of entrypoints. We have one other tool in Molkart which is called Cellpose. I made the biocontainer recipe from an existing one. For some reason, this one also fails if we don’t overwrite the entrypoint, but in this case, we don’t actually know why…
No we are not setting the entrypoint. But the biocontainer automatically adds a CMD [“python3”] to the end of the container. This container is a bit more tricky because the issue seems to be linked to behaviour of NUMBA cache dir that is somehow modified by setting entrypoint "" . I am currently making a PR for the new version of Cellpose (2.3.2), so we are trying out some things to fix the dependency of entrypoint for this one. If you have any suggestions, would be highly appreciated !
Actually the opposite, we have to set the entrypoint to "" for it to work in nextflow…
If we can figure out for Cellpose why we currently need to overwrite the entrypoint for the biocontainer that I posted and can fix this directly in the biocontainer recipe, then yes, making a custom image for Mesmer would cure the entrypoint
@jordeu Unfortunately for our specific issue with Mesmer in nf-core/molkart, your suggestions to fix Entrypoints in WAVE both did not work to fix the issue.
We still observe the same error:
Command error:
python: can't open file 'bash': [Errno 2] No such file or directory
4:21PM INF shutdown filesystem start
4:21PM INF shutdown filesystem done