X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/0a40a80076a616f3bd79c863c212bfbb22f775fa..e28233a15116ea3c0c86d0216c686215eb2ef6c7:/lib/install/deps.go diff --git a/lib/install/deps.go b/lib/install/deps.go index ec1eb19573..069ffd0a2b 100644 --- a/lib/install/deps.go +++ b/lib/install/deps.go @@ -8,6 +8,7 @@ import ( "bufio" "bytes" "context" + _ "embed" "errors" "flag" "fmt" @@ -32,15 +33,19 @@ const goversion = "1.17.7" const ( rubyversion = "2.7.5" + bundlerversion = "2.2.19" singularityversion = "3.7.4" pjsversion = "1.9.8" geckoversion = "0.24.0" gradleversion = "5.3.1" - nodejsversion = "v12.22.2" + nodejsversion = "v12.22.11" devtestDatabasePassword = "insecure_arvados_test" - workbench2version = "cfa81dfc3041cb459c8a0918a2732dfcf3a11d40" + workbench2version = "5e020488f67b5bc919796e0dc8b0b9f3b3ff23b0" ) +//go:embed arvados.service +var arvadosServiceFile []byte + type installCommand struct { ClusterType string SourcePath string @@ -167,7 +172,6 @@ func (inst *installCommand) RunCommand(prog string, args []string, stdin io.Read "make", "net-tools", "pandoc", - "perl-modules", "pkg-config", "postgresql", "postgresql-contrib", @@ -198,9 +202,9 @@ func (inst *installCommand) RunCommand(prog string, args []string, stdin io.Read } switch { case osv.Debian && osv.Major >= 10: - pkgs = append(pkgs, "libcurl4") + pkgs = append(pkgs, "libcurl4", "perl-modules-5.32") default: - pkgs = append(pkgs, "libcurl3") + pkgs = append(pkgs, "libcurl3", "perl-modules") } cmd := exec.CommandContext(ctx, "apt-get") if inst.EatMyData { @@ -493,6 +497,7 @@ else cd arvados-workbench2 if ! git checkout $V; then git fetch + git checkout yarn.lock git checkout $V fi fi @@ -539,6 +544,19 @@ yarn install } } + // Symlink user-facing Go programs /usr/bin/x -> + // /var/lib/arvados/bin/x + for _, prog := range []string{"arvados-client", "arvados-server"} { + err = os.Remove("/usr/bin/" + prog) + if err != nil && !errors.Is(err, os.ErrNotExist) { + return 1 + } + err = os.Symlink("/var/lib/arvados/bin/"+prog, "/usr/bin/"+prog) + if err != nil { + return 1 + } + } + // Copy assets from source tree to /var/lib/arvados/share cmd := exec.Command("install", "-v", "-t", "/var/lib/arvados/share", filepath.Join(inst.SourcePath, "sdk/python/tests/nginx.conf")) cmd.Stdout = stdout @@ -573,8 +591,8 @@ yarn install {"mkdir", "-p", "log", "tmp", ".bundle", "/var/www/.gem", "/var/www/.bundle", "/var/www/.passenger"}, {"touch", "log/production.log"}, {"chown", "-R", "--from=root", "www-data:www-data", "/var/www/.gem", "/var/www/.bundle", "/var/www/.passenger", "log", "tmp", ".bundle", "Gemfile.lock", "config.ru", "config/environment.rb"}, - {"sudo", "-u", "www-data", "/var/lib/arvados/bin/gem", "install", "--user", "--conservative", "--no-document", "bundler:2.2.19"}, - {"sudo", "-u", "www-data", "/var/lib/arvados/bin/bundle", "install", "--deployment", "--jobs", "8", "--path", "/var/www/.gem"}, + {"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", "install", "--deployment", "--jobs", "8", "--path", "/var/www/.gem", "--without", "development test diagnostics performance"}, {"sudo", "-u", "www-data", "/var/lib/arvados/bin/bundle", "exec", "passenger-config", "build-native-support"}, {"sudo", "-u", "www-data", "/var/lib/arvados/bin/bundle", "exec", "passenger-config", "install-standalone-runtime"}, } { @@ -610,6 +628,23 @@ rsync -a --delete-after build/ /var/lib/arvados/workbench2/ `, stdout, stderr); err != nil { return 1 } + + err = os.WriteFile("/lib/systemd/system/arvados.service", arvadosServiceFile, 0777) + 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 + } } return 0