My question is whether it's possible for dxfuse to automatically mount the project's folder with dxfuse under /mnt/project when using our own custom Docker images.
To flesh out the question: I would like to be able to fetch arbitrary files within each task. I have reviewed https://dnanexus.gitbook.io/uk-biobank-rap/science-corner/guide-to-analyzing-large-sample-sets and while that uses streaming (stream: true), it still requires knowing all possible files at launch time. FUSE systems, like gcsfuse or (for DNANexus) dxfuse, don't require that you first know all of the possible files at launch time, so that is attractive.
Having tried to tackle this issue now for a few days, I don't think that there is a workaround with the current DNANexus executor scripts. A consequence of /mnt/project not being mounted is that WDL workflows using Docker image runtimes are essentially not usable on the DNANexus platform for any task that requires dxfuse access.
Ah, yes, your main interest is WDL... Not sure whether this could work inside WDL. But I would definitely try to install dxfuse inside a docker container.
I tried installing dxfuse and dxpy inside the Docker. But even with their presence, because the environment variables aren't passed to the Docker image, those tools inside the Docker image don't get permission to take any actions.
Comments
6 comments
To flesh out the question: I would like to be able to fetch arbitrary files within each task. I have reviewed https://dnanexus.gitbook.io/uk-biobank-rap/science-corner/guide-to-analyzing-large-sample-sets and while that uses streaming (stream: true), it still requires knowing all possible files at launch time. FUSE systems, like gcsfuse or (for DNANexus) dxfuse, don't require that you first know all of the possible files at launch time, so that is attractive.
I haven't seen any examples of this working with custom applets - only with the DNANexus-provided apps. When people have tried so far, they have not been successful from what I can tell (e.g., https://community.dnanexus.com/s/question/0D5t000003lClcbCAC/is-there-a-way-to-mount-projectbucket-folders-on-vm-workers-directly-like-nfs-mount ). I have also not been successful, but I'm not expert in DNANexus's systems or configuration.
If this is not possible with DNANexus, that's fine, but I wanted to ask.
Having tried to tackle this issue now for a few days, I don't think that there is a workaround with the current DNANexus executor scripts. A consequence of /mnt/project not being mounted is that WDL workflows using Docker image runtimes are essentially not usable on the DNANexus platform for any task that requires dxfuse access.
Just some tips (not tested on my end).
Have you tried to develop a custom applet which would install https://github.com/dnanexus/dxfuse/releases and access data using dxfuse?
https://github.com/dnanexus/dxfuse
In case that would work, I would image that providing a mnt folder to the docker container should also work, as I did something similar for running Matlab via ttyd: https://community.dnanexus.com/s/question/0D5t000004AfobvCAB/howto-run-matlab-on-rap
Ah, yes, your main interest is WDL... Not sure whether this could work inside WDL. But I would definitely try to install dxfuse inside a docker container.
I tried installing dxfuse and dxpy inside the Docker. But even with their presence, because the environment variables aren't passed to the Docker image, those tools inside the Docker image don't get permission to take any actions.
What could be the closest solution, could be the code available at this doc page: https://documentation.dnanexus.com/getting-started/developer-tutorials/web-app-let-tutorials/running-rstudio-shiny-server-and-apps#lets-create-a-new-applet
# Mount the parent project using dxFUSE
wget https://github.com/dnanexus/dxfuse/releases/download/v0.21/dxfuse-linux
...
FUSE_MOUNT=$HOME/projects
mkdir -p $FUSE_MOUNT
sudo -E ./dxfuse-linux -uid $(id -u) -gid $(id -g) -verbose 2 $FUSE_MOUNT $DX_PROJECT_CONTEXT_ID
...
...
docker run --rm -p 443:3838 -v $PWD/app:/srv/shiny-server/ -v $PROJ_PATH:/srv/project/ rocker/shiny
As doc said, "It dxfuse-mounts the DNAnexus project as a folder, and then mounted this folder to the Docker image."
Please sign in to leave a comment.