18874: `arvados-server boot` uses workbench2 in main repo.
authorTom Clegg <tom@curii.com>
Thu, 24 Aug 2023 18:22:12 +0000 (14:22 -0400)
committerTom Clegg <tom@curii.com>
Thu, 24 Aug 2023 18:22:12 +0000 (14:22 -0400)
Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom@curii.com>

lib/boot/cmd.go
lib/boot/supervisor.go
lib/boot/workbench2.go

index dc5c43180e111b2e4d655f9a8d76149a25567e2d..41a2dab5ed0fd0a96d79d0b6341e74b6a79b6d9f 100644 (file)
@@ -69,9 +69,6 @@ func (bcmd bootCommand) run(ctx context.Context, prog string, args []string, std
        flags.StringVar(&super.ClusterType, "type", "production", "cluster `type`: development, test, or production")
        flags.StringVar(&super.ListenHost, "listen-host", "127.0.0.1", "host name or interface address for internal services whose InternalURLs are not configured")
        flags.StringVar(&super.ControllerAddr, "controller-address", ":0", "desired controller address, `host:port` or `:port`")
-       // Default for -workbench2-source is where `arvados-server
-       // install` puts its checkout.
-       flags.StringVar(&super.Workbench2Source, "workbench2-source", "/var/lib/arvados/arvados-workbench2", "path to arvados-workbench2 source tree")
        flags.BoolVar(&super.NoWorkbench1, "no-workbench1", false, "do not run workbench1")
        flags.BoolVar(&super.NoWorkbench2, "no-workbench2", false, "do not run workbench2")
        flags.BoolVar(&super.OwnTemporaryDatabase, "own-temporary-database", false, "bring up a postgres server and create a temporary database")
index 55fe9d2e37f3cc51125f66c61c324fd96080a99c..e913a7fe0894875d490a933a86030e3a74f7e23b 100644 (file)
@@ -61,8 +61,7 @@ type Supervisor struct {
        // explicitly configured in config file. If blank, use a
        // random port on ListenHost.
        ControllerAddr string
-       // Path to arvados-workbench2 source tree checkout.
-       Workbench2Source     string
+
        NoWorkbench1         bool
        NoWorkbench2         bool
        OwnTemporaryDatabase bool
index 5a319ebfe4bb45e0ea902bb62b5182044c442207..149487cdb649d4c4b6cbdc84f8c8a9e92a3537fb 100644 (file)
@@ -37,9 +37,6 @@ func (runner runWorkbench2) Run(ctx context.Context, fail func(error), super *Su
                        err = super.RunProgram(ctx, "/var/lib/arvados/workbench2", runOptions{
                                user: "www-data",
                        }, "arvados-server", "workbench2", super.cluster.Services.Controller.ExternalURL.Host, net.JoinHostPort(host, port), ".")
-               } else if super.Workbench2Source == "" {
-                       super.logger.Info("skipping Workbench2: Workbench2Source==\"\" and not in production mode")
-                       return
                } else {
                        stdinr, stdinw := io.Pipe()
                        defer stdinw.Close()
@@ -47,15 +44,15 @@ func (runner runWorkbench2) Run(ctx context.Context, fail func(error), super *Su
                                <-ctx.Done()
                                stdinw.Close()
                        }()
-                       if err = os.Mkdir(super.Workbench2Source+"/public/_health", 0777); err != nil && !errors.Is(err, fs.ErrExist) {
+                       if err = os.Mkdir(super.SourcePath+"/services/workbench2/public/_health", 0777); err != nil && !errors.Is(err, fs.ErrExist) {
                                fail(err)
                                return
                        }
-                       if err = ioutil.WriteFile(super.Workbench2Source+"/public/_health/ping", []byte(`{"health":"OK"}`), 0666); err != nil {
+                       if err = ioutil.WriteFile(super.SourcePath+"/services/workbench2/public/_health/ping", []byte(`{"health":"OK"}`), 0666); err != nil {
                                fail(err)
                                return
                        }
-                       err = super.RunProgram(ctx, super.Workbench2Source, runOptions{
+                       err = super.RunProgram(ctx, super.SourcePath+"/services/workbench2", runOptions{
                                env: []string{
                                        "CI=true",
                                        "HTTPS=false",