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...)
26 binfile := filepath.Join(boot.tempdir, "bin", "arvados-server")
27 err := boot.RunProgram(ctx, boot.tempdir, nil, nil, binfile, "-version")
33 for u = range runner.svc.InternalURLs {
35 fail(boot.RunProgram(ctx, boot.tempdir, nil, []string{"ARVADOS_SERVICE_INTERNAL_URL=" + u.String()}, binfile, runner.name, "-config", boot.configfile))
40 type runGoProgram struct {
46 func (runner runGoProgram) String() string {
47 _, basename := filepath.Split(runner.src)
51 func (runner runGoProgram) Run(ctx context.Context, fail func(error), boot *Booter) error {
52 boot.wait(ctx, runner.depends...)
53 binfile, err := boot.installGoProgram(ctx, runner.src)
61 err = boot.RunProgram(ctx, boot.tempdir, nil, nil, binfile, "-version")
65 if len(runner.svc.InternalURLs) > 0 {
66 // Run one for each URL
67 for u := range runner.svc.InternalURLs {
69 boot.waitShutdown.Add(1)
71 defer boot.waitShutdown.Done()
72 fail(boot.RunProgram(ctx, boot.tempdir, nil, []string{"ARVADOS_SERVICE_INTERNAL_URL=" + u.String()}, binfile))
77 boot.waitShutdown.Add(1)
79 defer boot.waitShutdown.Done()
80 fail(boot.RunProgram(ctx, boot.tempdir, nil, nil, binfile))