[ARVADOS] updated: 2.1.0-1078-g2d43f3de7

Git user git at public.arvados.org
Tue Jul 20 15:17:20 UTC 2021


Summary of changes:
 lib/crunchrun/singularity.go | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

       via  2d43f3de749909c040ea17460ec828047e6db7c2 (commit)
      from  a2dcdbb414a73f4b4d4c395c823a07b929358aae (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit 2d43f3de749909c040ea17460ec828047e6db7c2
Author: Peter Amstutz <peter.amstutz at curii.com>
Date:   Tue Jul 20 11:15:44 2021 -0400

    17813: Handle setting $HOME as a special case
    
    Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <peter.amstutz at curii.com>

diff --git a/lib/crunchrun/singularity.go b/lib/crunchrun/singularity.go
index cd03e32e5..be2d18871 100644
--- a/lib/crunchrun/singularity.go
+++ b/lib/crunchrun/singularity.go
@@ -246,8 +246,6 @@ func (e *singularityExecutor) Start() error {
 		mount := e.spec.BindMounts[path]
 		args = append(args, "--bind", mount.HostPath+":"+path+":"+readonlyflag[mount.ReadOnly])
 	}
-	args = append(args, e.imageFilename)
-	args = append(args, e.spec.Command...)
 
 	// This is for singularity 3.5.2. There are some behaviors
 	// that will change in singularity 3.6, please see:
@@ -255,9 +253,17 @@ func (e *singularityExecutor) Start() error {
 	// https://sylabs.io/guides/3.5/user-guide/environment_and_metadata.html
 	env := make([]string, 0, len(e.spec.Env))
 	for k, v := range e.spec.Env {
-		env = append(env, "SINGULARITYENV_"+k+"="+v)
+		if k == "HOME" {
+			// $HOME is a special case
+			args = append(args, "--home="+v)
+		} else {
+			env = append(env, "SINGULARITYENV_"+k+"="+v)
+		}
 	}
 
+	args = append(args, e.imageFilename)
+	args = append(args, e.spec.Command...)
+
 	path, err := exec.LookPath(args[0])
 	if err != nil {
 		return err

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list