X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/e2d623bd4c686100772924b2b15ab808bbb147d0..94942f7b2f35a775aea5b22d2be637022e6b4fb7:/lib/dispatchcloud/dispatcher.go diff --git a/lib/dispatchcloud/dispatcher.go b/lib/dispatchcloud/dispatcher.go index 278bcb6657..ae91a710e3 100644 --- a/lib/dispatchcloud/dispatcher.go +++ b/lib/dispatchcloud/dispatcher.go @@ -17,11 +17,12 @@ import ( "git.arvados.org/arvados.git/lib/cloud" "git.arvados.org/arvados.git/lib/dispatchcloud/container" "git.arvados.org/arvados.git/lib/dispatchcloud/scheduler" - "git.arvados.org/arvados.git/lib/dispatchcloud/ssh_executor" + "git.arvados.org/arvados.git/lib/dispatchcloud/sshexecutor" "git.arvados.org/arvados.git/lib/dispatchcloud/worker" "git.arvados.org/arvados.git/sdk/go/arvados" "git.arvados.org/arvados.git/sdk/go/auth" "git.arvados.org/arvados.git/sdk/go/ctxlog" + "git.arvados.org/arvados.git/sdk/go/health" "git.arvados.org/arvados.git/sdk/go/httpserver" "github.com/julienschmidt/httprouter" "github.com/prometheus/client_golang/prometheus" @@ -100,7 +101,7 @@ func (disp *dispatcher) Close() { // Make a worker.Executor for the given instance. func (disp *dispatcher) newExecutor(inst cloud.Instance) worker.Executor { - exr := ssh_executor.New(inst) + exr := sshexecutor.New(inst) exr.SetTargetPort(disp.Cluster.Containers.CloudVMs.SSHPort) exr.SetSigners(disp.sshKey) return exr @@ -164,6 +165,11 @@ func (disp *dispatcher) initialize() { }) mux.Handler("GET", "/metrics", metricsH) mux.Handler("GET", "/metrics.json", metricsH) + mux.Handler("GET", "/_health/:check", &health.Handler{ + Token: disp.Cluster.ManagementToken, + Prefix: "/_health/", + Routes: health.Routes{"ping": disp.CheckHealth}, + }) disp.httpHandler = auth.RequireLiteralToken(disp.Cluster.ManagementToken, mux) } }