From d8ecd9d8940a50ebabe089eb326753f54bb2831b Mon Sep 17 00:00:00 2001 From: Ward Vandewege Date: Fri, 8 Oct 2021 10:43:52 -0400 Subject: [PATCH] 18258: also handle SINGULARITY_TMPDIR Arvados-DCO-1.1-Signed-off-by: Ward Vandewege --- lib/crunchrun/singularity.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/crunchrun/singularity.go b/lib/crunchrun/singularity.go index 681dbb6cc9..5af023a83d 100644 --- a/lib/crunchrun/singularity.go +++ b/lib/crunchrun/singularity.go @@ -160,15 +160,22 @@ func (e *singularityExecutor) LoadImage(dockerImageID string, imageTarballPath s return err } + // Set up a cache and tmp dir for singularity build err = os.Mkdir(e.tmpdir+"/cache", 0700) if err != nil { return err } defer os.RemoveAll(e.tmpdir + "/cache") + err = os.Mkdir(e.tmpdir+"/tmp", 0700) + if err != nil { + return err + } + defer os.RemoveAll(e.tmpdir + "/tmp") build := exec.Command("singularity", "build", imageFilename, "docker-archive://"+e.tmpdir+"/image.tar") build.Env = os.Environ() build.Env = append(build.Env, "SINGULARITY_CACHEDIR="+e.tmpdir+"/cache") + build.Env = append(build.Env, "SINGULARITY_TMPDIR="+e.tmpdir+"/tmp") e.logf("%v", build.Args) out, err := build.CombinedOutput() // INFO: Starting build... -- 2.30.2