17717: Merge branch 'master' into 17717-costanalyzer-date-mode
[arvados.git] / lib / install / deps.go
index 8df3fba532a59559fe6ce5e17eacfa5bd41956c3..a1f5d72befcfc595a754a9683e0170e232887565 100644 (file)
@@ -178,9 +178,15 @@ func (inst *installCommand) RunCommand(prog string, args []string, stdin io.Read
                        "r-cran-roxygen2",
                        "r-cran-xml",
                        "sudo",
+                       "uuid-dev",
                        "wget",
                        "xvfb",
                )
+               if dev || test {
+                       pkgs = append(pkgs,
+                               "squashfs-tools", // for singularity
+                       )
+               }
                switch {
                case osv.Debian && osv.Major >= 10:
                        pkgs = append(pkgs, "libcurl4")
@@ -245,6 +251,7 @@ make install
                } else {
                        err = inst.runBash(`
 cd /tmp
+rm -rf /var/lib/arvados/go/
 wget --progress=dot:giga -O- https://storage.googleapis.com/golang/go`+goversion+`.linux-amd64.tar.gz | tar -C /var/lib/arvados -xzf -
 ln -sf /var/lib/arvados/go/bin/* /usr/local/bin/
 `, stdout, stderr)
@@ -315,6 +322,27 @@ rm ${zip}
                        }
                }
 
+               singularityversion := "3.5.2"
+               if havesingularityversion, err := exec.Command("/var/lib/arvados/bin/singularity", "--version").CombinedOutput(); err == nil && strings.Contains(string(havesingularityversion), singularityversion) {
+                       logger.Print("singularity " + singularityversion + " already installed")
+               } else if dev || test {
+                       err = inst.runBash(`
+S=`+singularityversion+`
+tmp=/var/lib/arvados/tmp/singularity
+trap "rm -r ${tmp}" ERR EXIT
+cd /var/lib/arvados/tmp
+git clone https://github.com/sylabs/singularity
+cd singularity
+git checkout v${S}
+./mconfig --prefix=/var/lib/arvados
+make -C ./builddir
+make -C ./builddir install
+`, stdout, stderr)
+                       if err != nil {
+                               return 1
+                       }
+               }
+
                // The entry in /etc/locale.gen is "en_US.UTF-8"; once
                // it's installed, locale -a reports it as
                // "en_US.utf8".