1 // Copyright (C) The Arvados Authors. All rights reserved.
3 // SPDX-License-Identifier: AGPL-3.0
11 "git.arvados.org/arvados.git/sdk/go/arvados"
14 type runServiceCommand struct {
20 func (runner runServiceCommand) String() string {
24 func (runner runServiceCommand) Run(ctx context.Context, fail func(error), boot *Booter) error {
25 boot.wait(ctx, runner.depends...)
28 for u = range runner.svc.InternalURLs {
30 fail(boot.RunProgram(ctx, boot.tempdir, nil, []string{"ARVADOS_SERVICE_INTERNAL_URL=" + u.String()}, "arvados-server", runner.name, "-config", boot.configfile))
35 type runGoProgram struct {
41 func (runner runGoProgram) String() string {
42 _, basename := filepath.Split(runner.src)
46 func (runner runGoProgram) Run(ctx context.Context, fail func(error), boot *Booter) error {
47 boot.wait(ctx, runner.depends...)
48 bindir := filepath.Join(boot.tempdir, "bin")
49 err := boot.RunProgram(ctx, runner.src, nil, []string{"GOBIN=" + bindir}, "go", "install")
56 _, basename := filepath.Split(runner.src)
57 binfile := filepath.Join(bindir, basename)
59 if len(runner.svc.InternalURLs) > 0 {
60 // Run one for each URL
61 for u := range runner.svc.InternalURLs {
63 boot.waitShutdown.Add(1)
65 defer boot.waitShutdown.Done()
66 fail(boot.RunProgram(ctx, boot.tempdir, nil, []string{"ARVADOS_SERVICE_INTERNAL_URL=" + u.String()}, binfile))
71 boot.waitShutdown.Add(1)
73 defer boot.waitShutdown.Done()
74 fail(boot.RunProgram(ctx, boot.tempdir, nil, nil, binfile))