From 060cefc054e2f6dda2e5f806c3fa146690363485 Mon Sep 17 00:00:00 2001 From: Justin Bedo Date: Mon, 10 Dec 2018 09:25:52 +1100 Subject: qsub: fix $TMPDIR location --- lib/qsub.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib') diff --git a/lib/qsub.nix b/lib/qsub.nix index 4ef6dbc..017e52c 100644 --- a/lib/qsub.nix +++ b/lib/qsub.nix @@ -8,14 +8,14 @@ while [ ! -e ${tmpDir}/$PBS_JOBID ] ; do sleep ${toString sleepTime} done + set -a + . ${tmpDir}/$PBS_JOBID/nix-set + set +a TMPDIR=${tmpDir}/$PBS_JOBID TEMP=$TMPDIR TMP=$TMPDIR NIX_BUILD_TOP=$TMPDIR cd $TMPDIR - set -a - . nix-set - set +a ${builder} ${lib.escapeShellArgs args} > qsub-stdout 2> qsub-stderr echo $? > qsub-exit ''; -- cgit v1.2.3 From 2a8c14c6fabc914b8cc173313a685f2b94a26aea Mon Sep 17 00:00:00 2001 From: Justin Bedo Date: Tue, 11 Dec 2018 11:09:51 +1100 Subject: qsub: prefix directories to prevent cleanup deleting top level dir --- lib/qsub.nix | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'lib') diff --git a/lib/qsub.nix b/lib/qsub.nix index 017e52c..f7b3c3e 100644 --- a/lib/qsub.nix +++ b/lib/qsub.nix @@ -5,13 +5,13 @@ args = let script = writeScript "qsub-script" '' #!${stdenv.shell} - while [ ! -e ${tmpDir}/$PBS_JOBID ] ; do + while [ ! -e ${tmpDir}/qsub-$PBS_JOBID ] ; do sleep ${toString sleepTime} done set -a - . ${tmpDir}/$PBS_JOBID/nix-set + . ${tmpDir}/qsub-$PBS_JOBID/nix-set set +a - TMPDIR=${tmpDir}/$PBS_JOBID + TMPDIR=${tmpDir}/qsub-$PBS_JOBID TEMP=$TMPDIR TMP=$TMPDIR NIX_BUILD_TOP=$TMPDIR @@ -46,15 +46,15 @@ } trap cleanup INT TERM EXIT - cp -r $TMPDIR ${tmpDir}/$id - set > ${tmpDir}/$id/nix-set + cp -r $TMPDIR ${tmpDir}/qsub-$id + set > ${tmpDir}/qsub-$id/nix-set until qstat -f ''${id%%.} 2>&1 | grep "\(Unknown Job\|job_state = C\)" > /dev/null ; do sleep ${toString sleepTime} done - cat ${tmpDir}/$id/qsub-stderr >&2 - cat ${tmpDir}/$id/qsub-stdout - if [ -e ${tmpDir}/$id/qsub-exit ]; then - exitCode=$(cat ${tmpDir}/$id/qsub-exit) + cat ${tmpDir}/qsub-$id/qsub-stderr >&2 + cat ${tmpDir}/qsub-$id/qsub-stdout + if [ -e ${tmpDir}/qsub-$id/qsub-exit ]; then + exitCode=$(cat ${tmpDir}/qsub-$id/qsub-exit) else exitCode=1 fi -- cgit v1.2.3