17344: Note "systemd enable" step is irrelevant in pkg case.
[arvados.git] / lib / install / deps.go
index 6bf390175d330741c2335c278e19dc3ea7f7deb4..a9fb874e2d7f95ae7f840132c0ba1687e0161711 100644 (file)
@@ -563,7 +563,6 @@ yarn install
                for _, srcdir := range []string{
                        "cmd/arvados-client",
                        "cmd/arvados-server",
-                       "services/crunch-dispatch-slurm",
                } {
                        fmt.Fprintf(stderr, "building %s...\n", srcdir)
                        cmd := exec.Command("go", "install", "-ldflags", "-X git.arvados.org/arvados.git/lib/cmd.version="+inst.PackageVersion+" -X main.version="+inst.PackageVersion+" -s -w")
@@ -615,15 +614,15 @@ yarn install
                                {"touch", "log/production.log"},
                                {"chown", "-R", "--from=root", "www-data:www-data", "/var/www/.bundle", "/var/www/.gem", "/var/www/.npm", "/var/www/.passenger", "log", "tmp", "vendor", ".bundle", "Gemfile.lock", "config.ru", "config/environment.rb"},
                                {"sudo", "-u", "www-data", "/var/lib/arvados/bin/gem", "install", "--user", "--conservative", "--no-document", "bundler:" + bundlerversion},
-                               {"sudo", "-u", "www-data", "/var/lib/arvados/bin/bundle", "config", "--set", "--local", "deployment", "true"},
-                               {"sudo", "-u", "www-data", "/var/lib/arvados/bin/bundle", "config", "--set", "--local", "path", "/var/www/.gem"},
-                               {"sudo", "-u", "www-data", "/var/lib/arvados/bin/bundle", "config", "--set", "--local", "without", "development test diagnostics performance"},
+                               {"sudo", "-u", "www-data", "/var/lib/arvados/bin/bundle", "config", "set", "--local", "deployment", "true"},
+                               {"sudo", "-u", "www-data", "/var/lib/arvados/bin/bundle", "config", "set", "--local", "path", "/var/www/.gem"},
+                               {"sudo", "-u", "www-data", "/var/lib/arvados/bin/bundle", "config", "set", "--local", "without", "development test diagnostics performance"},
                                {"sudo", "-u", "www-data", "/var/lib/arvados/bin/bundle", "install", "--jobs", "8"},
 
                                {"chown", "www-data:www-data", ".", "public/assets"},
                                // {"sudo", "-u", "www-data", "/var/lib/arvados/bin/bundle", "config", "set", "--local", "system", "true"},
-                               {"sudo", "-u", "www-data", "ARVADOS_CONFIG=none", "RAILS_GROUPS=assets", "RAILS_ENV=production", "/var/lib/arvados/bin/bundle", "exec", "rake", "npm:install"},
-                               {"sudo", "-u", "www-data", "ARVADOS_CONFIG=none", "RAILS_GROUPS=assets", "RAILS_ENV=production", "/var/lib/arvados/bin/bundle", "exec", "rake", "assets:precompile"},
+                               {"sudo", "-u", "www-data", "ARVADOS_CONFIG=none", "RAILS_GROUPS=assets", "RAILS_ENV=production", "PATH=/var/lib/arvados/bin:" + os.Getenv("PATH"), "/var/lib/arvados/bin/bundle", "exec", "rake", "npm:install"},
+                               {"sudo", "-u", "www-data", "ARVADOS_CONFIG=none", "RAILS_GROUPS=assets", "RAILS_ENV=production", "PATH=/var/lib/arvados/bin:" + os.Getenv("PATH"), "/var/lib/arvados/bin/bundle", "exec", "rake", "assets:precompile"},
                                {"chown", "root:root", "."},
                                {"chown", "-R", "root:root", "public/assets", "vendor"},
 
@@ -678,27 +677,38 @@ rsync -a --delete-after build/ /var/lib/arvados/workbench2/
                if err != nil {
                        return 1
                }
-               // This is equivalent to "systemd enable", but does
-               // not depend on the systemctl program being
-               // available.
-               symlink := "/etc/systemd/system/multi-user.target.wants/arvados.service"
-               err = os.Remove(symlink)
-               if err != nil && !errors.Is(err, os.ErrNotExist) {
-                       return 1
-               }
-               err = os.Symlink("/lib/systemd/system/arvados.service", symlink)
-               if err != nil {
-                       return 1
+               if prod {
+                       // (fpm will do this for us in the pkg case)
+                       // This is equivalent to "systemd enable", but
+                       // does not depend on the systemctl program
+                       // being available:
+                       symlink := "/etc/systemd/system/multi-user.target.wants/arvados.service"
+                       err = os.Remove(symlink)
+                       if err != nil && !errors.Is(err, os.ErrNotExist) {
+                               return 1
+                       }
+                       err = os.Symlink("/lib/systemd/system/arvados.service", symlink)
+                       if err != nil {
+                               return 1
+                       }
                }
 
                // Symlink user-facing programs /usr/bin/x ->
                // /var/lib/arvados/bin/x
-               for _, prog := range []string{"arvados-client", "arvados-server", "arv", "arv-tag"} {
-                       err = os.Remove("/usr/bin/" + prog)
+               for _, srcdst := range [][]string{
+                       {"arvados-client", "arvados-client"},
+                       {"arvados-client", "arv"},
+                       {"arvados-server", "arvados-server"},
+                       {"arv", "arv-ruby"},
+                       {"arv-tag", "arv-tag"},
+               } {
+                       src := srcdst[0]
+                       dst := srcdst[1]
+                       err = os.Remove("/usr/bin/" + dst)
                        if err != nil && !errors.Is(err, os.ErrNotExist) {
                                return 1
                        }
-                       err = os.Symlink("/var/lib/arvados/bin/"+prog, "/usr/bin/"+prog)
+                       err = os.Symlink("/var/lib/arvados/bin/"+src, "/usr/bin/"+dst)
                        if err != nil {
                                return 1
                        }