Getting dx fuse (/mnt/project/) and the dx upload/download commands to work on Cloud Workstation
Cloud Workstation is great for those of us who like to work over ssh instead of using a web browser, but it can require a little extra setup to get access to files in the project space working.
Getting the “dx” commands to work
The dx commands on Cloud Workstation use a “job token” to authenticate themselves as coming from a system that should have access to protected individual-level data files (and not from your local computer). You cannot run dx login on Cloud Workstation or you will lose your job token and lose your ability to access the protected data.
Because you can't run dx login, the dx commands need to be run a little differently to tell them where to look for files in your project space.
Here are some examples of using $DX_PROJECT_CONTEXT_ID to tell different dx commands where to look:
dx download $DX_PROJECT_CONTEXT_ID:/path/to/input_file.txt
dx upload output_file.txt --path $DX_PROJECT_CONTEXT_ID:/path/to/destination/
dx ls $DX_PROJECT_CONTEXT_ID:/You may find it helpful to copy the value in $DX_PROJECT_CONTEXT_ID to a shorter variable name, eg. PROJ=$DX_PROJECT_CONTEXT_ID
Setting up dx fuse (/mnt/project/)
Here are commands that will set up dx fuse and mount the /mnt/project filesystem on Cloud Workstation.
# NOTE: If it is no longer 2025 when you are reading this, go to https://github.com/dnanexus/dxfuse/releases/ and update the code below to use the URL for the newest version of dx fuse.
wget https://github.com/dnanexus/dxfuse/releases/download/v1.5.0/dxfuse-linux
chmod +x dxfuse-linux
echo "{
\"files\" : [],
\"directories\" : [
{
\"proj_id\" : \"$DX_PROJECT_CONTEXT_ID\",
\"folder\" : \"/\",
\"dirname\" : \"/project\"
}
]
}" > dxfuse_manifest.json
sudo -E ./dxfuse-linux /mnt dxfuse_manifest.json
Comments
0 comments
Please sign in to leave a comment.