- os.Setenv("PATH", filepath.Join(boot.libPath, "bin")+":"+os.Getenv("PATH"))
-
- err = boot.installGoProgram(ctx, "cmd/arvados-server")
- if err != nil {
- return 1
- }
-
- var wg sync.WaitGroup
- for _, cmpt := range []component{
- {name: "nginx", runFunc: runNginx},
- {name: "controller", cmdHandler: controller.Command},
- {name: "dispatchcloud", cmdHandler: dispatchcloud.Command, notIfTest: true},
- {name: "git-httpd", goProg: "services/arv-git-httpd"},
- {name: "health", goProg: "services/health"},
- {name: "keep-balance", goProg: "services/keep-balance", notIfTest: true},
- {name: "keepproxy", goProg: "services/keepproxy"},
- {name: "keepstore", goProg: "services/keepstore", svc: boot.cluster.Services.Keepstore},
- {name: "keep-web", goProg: "services/keep-web"},
- {name: "railsAPI", svc: boot.cluster.Services.RailsAPI, railsApp: "services/api"},
- {name: "ws", goProg: "services/ws"},
- } {
- cmpt := cmpt
- wg.Add(1)
- go func() {
- defer wg.Done()
- defer cancel()
- logger.WithField("component", cmpt.name).Info("starting")
- err := cmpt.Run(ctx, boot, stdout, stderr)
- if err != nil {
- logger.WithError(err).WithField("component", cmpt.name).Info("exited")
- }
- }()
- }
- <-ctx.Done()
- wg.Wait()
- return 0
-}
-
-func (boot *bootCommand) installGoProgram(ctx context.Context, srcpath string) error {
- boot.goMutex.Lock()
- defer boot.goMutex.Unlock()
- return boot.RunProgram(ctx, filepath.Join(boot.sourcePath, srcpath), nil, []string{"GOPATH=" + boot.libPath}, "go", "install")
-}
-
-func (boot *bootCommand) setupRubyEnv() error {
- boot.setupRubyOnce.Do(func() {
- buf, err := exec.Command("gem", "env", "gempath").Output() // /var/lib/arvados/.gem/ruby/2.5.0/bin:...
- if err != nil || len(buf) == 0 {
- boot.setupRubyErr = fmt.Errorf("gem env gempath: %v", err)
- }
- gempath := string(bytes.Split(buf, []byte{':'})[0])
- os.Setenv("PATH", gempath+"/bin:"+os.Getenv("PATH"))
- os.Setenv("GEM_HOME", gempath)
- os.Setenv("GEM_PATH", gempath)
- })
- return boot.setupRubyErr