13 dispatchLocal = &arvadosGoBooter{name: "crunch-dispatch-local"}
14 dispatchSLURM = &arvadosGoBooter{name: "crunch-dispatch-slurm"}
15 gitHTTP = &arvadosGoBooter{name: "arvados-git-httpd"}
16 keepbalance = &arvadosGoBooter{name: "keep-balance"}
17 keepproxy = &arvadosGoBooter{name: "keepproxy"}
18 keepstore = &arvadosGoBooter{name: "keepstore"}
19 websocket = &arvadosGoBooter{name: "arvados-ws"}
22 type arvadosGoBooter struct {
26 func availablePort() int {
27 return rand.Intn(10000) + 20000
30 func (agb *arvadosGoBooter) Boot(ctx context.Context) error {
32 cmd := path.Join(cfg.UsrDir, "bin", agb.name)
33 if _, err := os.Stat(cmd); err != nil {
34 if found, err := filepath.Glob(path.Join(cfg.UsrDir, "pkg", agb.name+"_*.deb")); err == nil && len(found) > 0 {
35 cmd := command("dpkg", "-i", found[0])
38 osPackageMutex.Unlock()
44 cfgPath := path.Join("/etc/arvados", agb.name, agb.name+".yml")
45 atomicWriteFile(cfgPath+".ctmpl", []byte("{}"), 0644)
52 cmd: path.Join(cfg.UsrDir, "bin", "consul-template"),
54 "-consul-addr=127.0.0.1:8500",
55 "-template="+cfgPath+".ctmpl:"+cfgPath,