X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/8b3dd08ed1d43121bd92452c7cb0504098eb5887..60542dcecbffe14a43098d9e68ee6ae05868df1e:/lib/boot/supervisor.go diff --git a/lib/boot/supervisor.go b/lib/boot/supervisor.go index ddc17953d2..e913a7fe08 100644 --- a/lib/boot/supervisor.go +++ b/lib/boot/supervisor.go @@ -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 @@ -282,7 +281,7 @@ func (super *Supervisor) runCluster() error { if err != nil { return err } - conffile, err := os.OpenFile(filepath.Join(super.wwwtempdir, "config.yml"), os.O_CREATE|os.O_WRONLY, 0644) + conffile, err := os.OpenFile(filepath.Join(super.wwwtempdir, "config.yml"), os.O_CREATE|os.O_WRONLY|os.O_TRUNC, 0644) if err != nil { return err } @@ -308,6 +307,7 @@ func (super *Supervisor) runCluster() error { if super.ClusterType != "production" { super.prependEnv("PATH", super.tempdir+"/bin:") } + super.setEnv("ARVADOS_SERVER_ADDRESS", super.ListenHost) // Now that we have the config, replace the bootstrap logger // with a new one according to the logging config. @@ -324,13 +324,13 @@ func (super *Supervisor) runCluster() error { } else if super.SourceVersion == "" { // Find current source tree version. var buf bytes.Buffer - err = super.RunProgram(super.ctx, ".", runOptions{output: &buf}, "git", "diff", "--shortstat") + err = super.RunProgram(super.ctx, super.SourcePath, runOptions{output: &buf}, "git", "diff", "--shortstat") if err != nil { return err } dirty := buf.Len() > 0 buf.Reset() - err = super.RunProgram(super.ctx, ".", runOptions{output: &buf}, "git", "log", "-n1", "--format=%H") + err = super.RunProgram(super.ctx, super.SourcePath, runOptions{output: &buf}, "git", "log", "-n1", "--format=%H") if err != nil { return err } @@ -355,20 +355,24 @@ func (super *Supervisor) runCluster() error { createCertificates{}, runPostgreSQL{}, runNginx{}, - runServiceCommand{name: "controller", svc: super.cluster.Services.Controller, depends: []supervisedTask{seedDatabase{}}}, + railsDatabase{}, + runServiceCommand{name: "controller", svc: super.cluster.Services.Controller, depends: []supervisedTask{railsDatabase{}}}, runServiceCommand{name: "git-httpd", svc: super.cluster.Services.GitHTTP}, runServiceCommand{name: "health", svc: super.cluster.Services.Health}, runServiceCommand{name: "keepproxy", svc: super.cluster.Services.Keepproxy, depends: []supervisedTask{runPassenger{src: "services/api"}}}, runServiceCommand{name: "keepstore", svc: super.cluster.Services.Keepstore}, runServiceCommand{name: "keep-web", svc: super.cluster.Services.WebDAV}, - runServiceCommand{name: "ws", svc: super.cluster.Services.Websocket, depends: []supervisedTask{seedDatabase{}}}, + runServiceCommand{name: "ws", svc: super.cluster.Services.Websocket, depends: []supervisedTask{railsDatabase{}}}, installPassenger{src: "services/api", varlibdir: "railsapi"}, - runPassenger{src: "services/api", varlibdir: "railsapi", svc: super.cluster.Services.RailsAPI, depends: []supervisedTask{createCertificates{}, seedDatabase{}, installPassenger{src: "services/api", varlibdir: "railsapi"}}}, - seedDatabase{}, + runPassenger{src: "services/api", varlibdir: "railsapi", svc: super.cluster.Services.RailsAPI, depends: []supervisedTask{ + createCertificates{}, + installPassenger{src: "services/api", varlibdir: "railsapi"}, + railsDatabase{}, + }}, } if !super.NoWorkbench1 { tasks = append(tasks, - installPassenger{src: "apps/workbench", varlibdir: "workbench1", depends: []supervisedTask{seedDatabase{}}}, // dependency ensures workbench doesn't delay api install/startup + installPassenger{src: "apps/workbench", varlibdir: "workbench1", depends: []supervisedTask{railsDatabase{}}}, // dependency ensures workbench doesn't delay api install/startup runPassenger{src: "apps/workbench", varlibdir: "workbench1", svc: super.cluster.Services.Workbench1, depends: []supervisedTask{installPassenger{src: "apps/workbench", varlibdir: "workbench1"}}}, ) }