I tried a few different combinations for overwriting tmp dir inside a docker container for the squidpy spatial tool. This PR is one of the combinations I tried.
The issue with the previous PR is because Galaxy is trying to mount -v "$_GALAXY_JOB_TMP_DIR:/tmp:rw" to /tmp and simultaneously through a mount argument added in the previous PR a tmpfs is being mounted in the same path as the Galaxy's. So, docker is complaining about the double/duplicate mount point; this occurs when two different sources try to compete for the same target inside the container.
To override the tmp dir for a job/tool, we need to look into the Galaxy's job script,
_galaxy_setup_environment() {
local _use_framework_galaxy="$1"
if [ -z "$_GALAXY_JOB_TMP_DIR" ]; then
_GALAXY_JOB_DIR="/data/jwd02f/main/071/801/71801564"
_GALAXY_JOB_HOME_DIR="/data/jwd02f/main/071/801/71801564/home"
_GALAXY_JOB_TMP_DIR=$([ ! -e '/data/jwd02f/main/071/801/71801564/tmp' ] || mv '/data/jwd02f/main/071/801/71801564/tmp' '/data/jwd02f/main/071/801/71801564'/tmp.$(date +%Y%m%d-%H%M%S) ; mkdir '/data/jwd02f/main/071/801/71801564/tmp'; echo '/data/jwd02f/main/071/801/71801564/tmp')
fi
GALAXY_MEMORY_MB="6144"; export GALAXY_MEMORY_MB
HOME="$_GALAXY_JOB_HOME_DIR"; export HOME
TMPDIR="$_GALAXY_JOB_TMP_DIR"; export TMPDIR
TMP="$_GALAXY_JOB_TMP_DIR"; export TMP
TEMP="$_GALAXY_JOB_TMP_DIR"; export TEMP
When the _GALAXY_JOB_TMP_DIR var is not set for a job or is empty, Galaxy will automatically use the tmp dir present in the JWD and the ENVs TMP, TEMP, and TMPDIR are set to use the same value in the _GALAXY_JOB_TMP_DIR.
So, in this PR, we attempt to set the hosts /tmp dir as the value for _GALAXY_JOB_TMP_DIR var, which in turn will set TMP, TEMP, and TMP_DIR to the value /tmp. The host's /tmp dir will be mounted inside the container as /tmp (see below the docker run command created by the job script).
From the docker run command (-v "$_GALAXY_JOB_TMP_DIR:$_GALAXY_JOB_TMP_DIR:rw" -v "$_GALAXY_JOB_TMP_DIR:/tmp:rw"), we can see that by setting the ENV _GALAXY_JOB_TMP_DIR: '/tmp' (as in this PR), we mount the hosts /tmp dir inside the container as /tmp.
Let's give this a try. It might solve the issue discussed here. Once this is tested on the EU, we can apply the same for the funannotate tool(s).
I tried a few different combinations for overwriting tmp dir inside a docker container for the squidpy spatial tool. This PR is one of the combinations I tried.
The issue with the previous PR is because Galaxy is trying to mount
-v "$_GALAXY_JOB_TMP_DIR:/tmp:rw"
to/tmp
and simultaneously through amount
argument added in the previous PR atmpfs
is being mounted in the same path as the Galaxy's. So, docker is complaining about the double/duplicate mount point; this occurs when two different sources try to compete for the same target inside the container.To override the
tmp
dir for a job/tool, we need to look into the Galaxy's job script,When the
_GALAXY_JOB_TMP_DIR
var is not set for a job or is empty, Galaxy will automatically use thetmp
dir present in the JWD and the ENVsTMP
,TEMP
, andTMPDIR
are set to use the same value in the_GALAXY_JOB_TMP_DIR
.So, in this PR, we attempt to set the hosts
/tmp
dir as the value for_GALAXY_JOB_TMP_DIR
var, which in turn will setTMP
,TEMP
, andTMP_DIR
to the value/tmp
. The host's/tmp
dir will be mounted inside the container as/tmp
(see below the docker run command created by the job script).From the
docker run
command (-v "$_GALAXY_JOB_TMP_DIR:$_GALAXY_JOB_TMP_DIR:rw" -v "$_GALAXY_JOB_TMP_DIR:/tmp:rw"
), we can see that by setting the ENV_GALAXY_JOB_TMP_DIR: '/tmp'
(as in this PR), we mount the hosts/tmp
dir inside the container as/tmp
.Let's give this a try. It might solve the issue discussed here. Once this is tested on the EU, we can apply the same for the
funannotate
tool(s).