1 // Copyright (C) The Arvados Authors. All rights reserved.
3 // SPDX-License-Identifier: AGPL-3.0
15 "git.arvados.org/arvados.git/sdk/go/arvados"
18 type installPassenger struct {
23 func (runner installPassenger) String() string {
24 return "installPassenger:" + runner.src
27 func (runner installPassenger) Run(ctx context.Context, fail func(error), boot *Booter) error {
28 err := boot.wait(ctx, runner.depends...)
33 err = boot.RunProgram(ctx, runner.src, &buf, nil, "gem", "list", "--details", "bundler")
37 for _, version := range []string{"1.11.0", "1.17.3", "2.0.2"} {
38 if !strings.Contains(buf.String(), "("+version+")") {
39 err = boot.RunProgram(ctx, runner.src, nil, nil, "gem", "install", "--user", "bundler:1.11", "bundler:1.17.3", "bundler:2.0.2")
46 err = boot.RunProgram(ctx, runner.src, nil, nil, "bundle", "install", "--jobs", "4", "--path", filepath.Join(os.Getenv("HOME"), ".gem"))
50 err = boot.RunProgram(ctx, runner.src, nil, nil, "bundle", "exec", "passenger-config", "build-native-support")
54 err = boot.RunProgram(ctx, runner.src, nil, nil, "bundle", "exec", "passenger-config", "install-standalone-runtime")
58 err = boot.RunProgram(ctx, runner.src, nil, nil, "bundle", "exec", "passenger-config", "validate-install")
65 type runPassenger struct {
71 func (runner runPassenger) String() string {
72 return "runPassenger:" + runner.src
75 func (runner runPassenger) Run(ctx context.Context, fail func(error), boot *Booter) error {
76 err := boot.wait(ctx, runner.depends...)
80 port, err := internalPort(runner.svc)
82 return fmt.Errorf("bug: no InternalURLs for component %q: %v", runner, runner.svc.InternalURLs)
85 err = boot.RunProgram(ctx, runner.src, nil, nil, "bundle", "exec", "passenger", "start", "-p", port)