21055: Don't exit when failing to set inotify.max_user_watches.
[arvados.git] / lib / install / deps.go
index 1b4bf7266d29124dd56a92c9d9284828896cd706..076a4e2b6a172f42bbf2063626a39a86c49195c8 100644 (file)
@@ -30,18 +30,17 @@ import (
 
 var Command cmd.Handler = &installCommand{}
 
-const goversion = "1.18.8"
+const goversion = "1.20.6"
 
 const (
-       rubyversion             = "2.7.6"
+       rubyversion             = "2.7.7"
        bundlerversion          = "2.2.19"
-       singularityversion      = "3.9.9"
+       singularityversion      = "3.10.4"
        pjsversion              = "1.9.8"
        geckoversion            = "0.24.0"
        gradleversion           = "5.3.1"
        nodejsversion           = "v12.22.12"
        devtestDatabasePassword = "insecure_arvados_test"
-       workbench2version       = "e30e54d674c95ee15e296c71e471c1555bdc5a38" // 2.4.3
 )
 
 //go:embed arvados.service
@@ -193,13 +192,18 @@ func (inst *installCommand) RunCommand(prog string, args []string, stdin io.Read
                if test {
                        if osv.Debian && osv.Major <= 10 {
                                pkgs = append(pkgs, "iceweasel")
+                       } else if osv.Debian && osv.Major >= 11 {
+                               pkgs = append(pkgs, "firefox-esr")
                        } else {
                                pkgs = append(pkgs, "firefox")
                        }
                }
                if dev || test {
-                       pkgs = append(pkgs, "squashfs-tools") // for singularity
-                       pkgs = append(pkgs, "gnupg")          // for docker install recipe
+                       pkgs = append(pkgs,
+                               "libglib2.0-dev", // singularity (conmon)
+                               "libseccomp-dev", // singularity (seccomp)
+                               "squashfs-tools", // singularity
+                               "gnupg")          // docker install recipe
                }
                switch {
                case osv.Debian && osv.Major >= 11:
@@ -255,6 +259,19 @@ DEBIAN_FRONTEND=noninteractive apt-get --yes --no-install-recommends install doc
                        err = fmt.Errorf("don't know how to install docker for osversion %v", osv)
                        return 1
                }
+
+               err = inst.runBash(`
+add="fs.inotify.max_user_watches=524288"
+if ! grep -F -- "$add" /etc/sysctl.conf; then
+    echo "$add" | tee -a /etc/sysctl.conf
+    sysctl -p
+fi
+`, stdout, stderr)
+               if err != nil {
+                       // Just warn instead of fail because this is expected when running
+                       // inside Docker.
+                       logger.Warnf("couldn't set fs.inotify.max_user_watches value: %w", err)
+               }
        }
 
        os.Mkdir("/var/lib/arvados", 0755)
@@ -360,7 +377,7 @@ 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
+git clone --recurse-submodules https://github.com/sylabs/singularity
 cd singularity
 git checkout v${S}
 ./mconfig --prefix=/var/lib/arvados
@@ -527,38 +544,6 @@ ln -sfv /var/lib/arvados/node-`+nodejsversion+`-linux-x64/bin/{yarn,yarnpkg} /us
                                return 1
                        }
                }
-
-               if havewb2version, err := exec.Command("git", "--git-dir=/var/lib/arvados/arvados-workbench2/.git", "log", "-n1", "--format=%H").CombinedOutput(); err == nil && string(havewb2version) == workbench2version+"\n" {
-                       logger.Print("workbench2 repo is already at " + workbench2version)
-               } else {
-                       err = inst.runBash(`
-V=`+workbench2version+`
-cd /var/lib/arvados
-if [[ ! -e arvados-workbench2 ]]; then
-  git clone https://git.arvados.org/arvados-workbench2.git
-  cd arvados-workbench2
-  git checkout $V
-else
-  cd arvados-workbench2
-  if ! git checkout $V; then
-    git fetch
-    git checkout yarn.lock
-    git checkout $V
-  fi
-fi
-rm -rf build
-`, stdout, stderr)
-                       if err != nil {
-                               return 1
-                       }
-               }
-
-               if err = inst.runBash(`
-cd /var/lib/arvados/arvados-workbench2
-yarn install
-`, stdout, stderr); err != nil {
-                       return 1
-               }
        }
 
        if prod || pkg {
@@ -688,8 +673,8 @@ done
 
                // Install workbench2 app to /var/lib/arvados/workbench2/
                if err = inst.runBash(`
-cd /var/lib/arvados/arvados-workbench2
-VERSION="`+inst.PackageVersion+`" BUILD_NUMBER=1 GIT_COMMIT="`+workbench2version[:9]+`" yarn build
+cd `+inst.SourcePath+`/services/workbench2
+VERSION="`+inst.PackageVersion+`" BUILD_NUMBER=1 GIT_COMMIT=000000000 yarn build
 rsync -a --delete-after build/ /var/lib/arvados/workbench2/
 `, stdout, stderr); err != nil {
                        return 1