[ARVADOS] created: 2.1.0-2442-g6b1a602cf
Git user
git at public.arvados.org
Tue May 10 13:43:20 UTC 2022
at 6b1a602cf1de1b6488c7d6b55e8d99ca8f707160 (commit)
commit 6b1a602cf1de1b6488c7d6b55e8d99ca8f707160
Author: Tom Clegg <tom at curii.com>
Date: Tue May 10 09:43:02 2022 -0400
18947: Move arvados-health command into arvados-server binary.
Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom at curii.com>
diff --git a/build/run-build-packages.sh b/build/run-build-packages.sh
index 26705c066..377166242 100755
--- a/build/run-build-packages.sh
+++ b/build/run-build-packages.sh
@@ -254,7 +254,7 @@ package_go_binary cmd/arvados-server crunch-run "$FORMAT" "$ARCH" \
"Supervise a single Crunch container"
package_go_binary services/crunchstat crunchstat "$FORMAT" "$ARCH" \
"Gather cpu/memory/network statistics of running Crunch jobs"
-package_go_binary services/health arvados-health "$FORMAT" "$ARCH" \
+package_go_binary cmd/arvados-server arvados-health "$FORMAT" "$ARCH" \
"Check health of all Arvados cluster services"
package_go_binary cmd/arvados-server keep-balance "$FORMAT" "$ARCH" \
"Rebalance and garbage-collect data blocks stored in Arvados Keep"
diff --git a/services/health/arvados-health.service b/cmd/arvados-server/arvados-health.service
similarity index 92%
rename from services/health/arvados-health.service
rename to cmd/arvados-server/arvados-health.service
index 4b8745d15..cf246b0ee 100644
--- a/services/health/arvados-health.service
+++ b/cmd/arvados-server/arvados-health.service
@@ -12,7 +12,8 @@ AssertPathExists=/etc/arvados/config.yml
StartLimitIntervalSec=0
[Service]
-Type=simple
+Type=notify
+EnvironmentFile=-/etc/arvados/environment
ExecStart=/usr/bin/arvados-health
# Set a reasonable default for the open file limit
LimitNOFILE=65536
diff --git a/cmd/arvados-server/cmd.go b/cmd/arvados-server/cmd.go
index ae1e3fbee..27c53eb5c 100644
--- a/cmd/arvados-server/cmd.go
+++ b/cmd/arvados-server/cmd.go
@@ -5,6 +5,7 @@
package main
import (
+ "context"
"encoding/json"
"fmt"
"io"
@@ -21,6 +22,8 @@ import (
"git.arvados.org/arvados.git/lib/install"
"git.arvados.org/arvados.git/lib/lsf"
"git.arvados.org/arvados.git/lib/recovercollection"
+ "git.arvados.org/arvados.git/lib/service"
+ "git.arvados.org/arvados.git/sdk/go/arvados"
"git.arvados.org/arvados.git/sdk/go/health"
"git.arvados.org/arvados.git/services/githttpd"
keepbalance "git.arvados.org/arvados.git/services/keep-balance"
@@ -28,6 +31,7 @@ import (
"git.arvados.org/arvados.git/services/keepproxy"
"git.arvados.org/arvados.git/services/keepstore"
"git.arvados.org/arvados.git/services/ws"
+ "github.com/prometheus/client_golang/prometheus"
)
var (
@@ -47,6 +51,7 @@ var (
"dispatch-cloud": dispatchcloud.Command,
"dispatch-lsf": lsf.DispatchCommand,
"git-httpd": githttpd.Command,
+ "health": healthCommand,
"install": install.Command,
"init": install.InitCommand,
"keep-balance": keepbalance.Command,
@@ -90,3 +95,7 @@ func (wb2command) RunCommand(prog string, args []string, stdin io.Reader, stdout
}
return 0
}
+
+var healthCommand cmd.Handler = service.Command(arvados.ServiceNameHealth, func(ctx context.Context, cluster *arvados.Cluster, _ string, _ *prometheus.Registry) service.Handler {
+ return &health.Aggregator{Cluster: cluster}
+})
diff --git a/lib/boot/supervisor.go b/lib/boot/supervisor.go
index a5d61b4a1..4b1526600 100644
--- a/lib/boot/supervisor.go
+++ b/lib/boot/supervisor.go
@@ -365,7 +365,7 @@ func (super *Supervisor) runCluster() error {
runNginx{},
runServiceCommand{name: "controller", svc: super.cluster.Services.Controller, depends: []supervisedTask{seedDatabase{}}},
runServiceCommand{name: "git-httpd", svc: super.cluster.Services.GitHTTP},
- runGoProgram{src: "services/health", svc: super.cluster.Services.Health},
+ 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},
diff --git a/services/health/main.go b/services/health/main.go
deleted file mode 100644
index bc57d36d0..000000000
--- a/services/health/main.go
+++ /dev/null
@@ -1,29 +0,0 @@
-// Copyright (C) The Arvados Authors. All rights reserved.
-//
-// SPDX-License-Identifier: AGPL-3.0
-
-package main
-
-import (
- "context"
- "os"
-
- "git.arvados.org/arvados.git/lib/cmd"
- "git.arvados.org/arvados.git/lib/service"
- "git.arvados.org/arvados.git/sdk/go/arvados"
- "git.arvados.org/arvados.git/sdk/go/health"
- "github.com/prometheus/client_golang/prometheus"
-)
-
-var (
- version = "dev"
- command cmd.Handler = service.Command(arvados.ServiceNameHealth, newHandler)
-)
-
-func newHandler(ctx context.Context, cluster *arvados.Cluster, _ string, _ *prometheus.Registry) service.Handler {
- return &health.Aggregator{Cluster: cluster}
-}
-
-func main() {
- os.Exit(command.RunCommand(os.Args[0], os.Args[1:], os.Stdin, os.Stdout, os.Stderr))
-}
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list