[ARVADOS] updated: 1.1.0-151-g60a60a1
Git user
git at public.curoverse.com
Thu Nov 30 12:50:18 EST 2017
Summary of changes:
services/keep-web/handler.go | 3 +++
services/keep-web/status_test.go | 1 +
services/keepstore/handlers.go | 3 +++
services/keepstore/pull_worker_test.go | 1 +
services/ws/router.go | 2 ++
services/ws/server_test.go | 16 ++++++++++++++++
6 files changed, 26 insertions(+)
via 60a60a176c77488cfacc7fd02e03b7b8c69de587 (commit)
from 7209d0ade292bebbc8d92f8200778b3250e4130a (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
commit 60a60a176c77488cfacc7fd02e03b7b8c69de587
Author: Lucas Di Pentima <ldipentima at veritasgenetics.com>
Date: Thu Nov 30 14:49:38 2017 -0300
10666: Added Version information to status.json on keep-web,
keepstore & ws.
Added tests.
Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <ldipentima at veritasgenetics.com>
diff --git a/services/keep-web/handler.go b/services/keep-web/handler.go
index fd36218..161864a 100644
--- a/services/keep-web/handler.go
+++ b/services/keep-web/handler.go
@@ -24,6 +24,7 @@ import (
"git.curoverse.com/arvados.git/sdk/go/health"
"git.curoverse.com/arvados.git/sdk/go/httpserver"
"git.curoverse.com/arvados.git/sdk/go/keepclient"
+ arvadosVersion "git.curoverse.com/arvados.git/sdk/go/version"
"golang.org/x/net/webdav"
)
@@ -90,8 +91,10 @@ func (h *handler) setup() {
func (h *handler) serveStatus(w http.ResponseWriter, r *http.Request) {
status := struct {
cacheStats
+ Version string
}{
cacheStats: h.Config.Cache.Stats(),
+ Version: arvadosVersion.GetVersion(),
}
json.NewEncoder(w).Encode(status)
}
diff --git a/services/keep-web/status_test.go b/services/keep-web/status_test.go
index 5f2d44c..0a2b9eb 100644
--- a/services/keep-web/status_test.go
+++ b/services/keep-web/status_test.go
@@ -31,6 +31,7 @@ func (s *UnitSuite) TestStatus(c *check.C) {
err := json.NewDecoder(resp.Body).Decode(&status)
c.Check(err, check.IsNil)
c.Check(status["Cache.Requests"], check.Equals, float64(0))
+ c.Check(status["Version"], check.Not(check.Equals), "")
}
func (s *IntegrationSuite) TestNoStatusFromVHost(c *check.C) {
diff --git a/services/keepstore/handlers.go b/services/keepstore/handlers.go
index 2d90aba..5cd3aa8 100644
--- a/services/keepstore/handlers.go
+++ b/services/keepstore/handlers.go
@@ -31,6 +31,7 @@ import (
"git.curoverse.com/arvados.git/sdk/go/health"
"git.curoverse.com/arvados.git/sdk/go/httpserver"
+ arvadosVersion "git.curoverse.com/arvados.git/sdk/go/version"
log "github.com/Sirupsen/logrus"
)
@@ -311,6 +312,7 @@ type NodeStatus struct {
TrashQueue WorkQueueStatus
RequestsCurrent int
RequestsMax int
+ Version string
}
var st NodeStatus
@@ -346,6 +348,7 @@ func (rtr *router) StatusHandler(resp http.ResponseWriter, req *http.Request) {
// populate the given NodeStatus struct with current values.
func (rtr *router) readNodeStatus(st *NodeStatus) {
+ st.Version = arvadosVersion.GetVersion()
vols := KeepVM.AllReadable()
if cap(st.Volumes) < len(vols) {
st.Volumes = make([]*volumeStatusEnt, len(vols))
diff --git a/services/keepstore/pull_worker_test.go b/services/keepstore/pull_worker_test.go
index 9e547f3..7a82970 100644
--- a/services/keepstore/pull_worker_test.go
+++ b/services/keepstore/pull_worker_test.go
@@ -271,6 +271,7 @@ func (s *PullWorkerTestSuite) performTest(testData PullWorkerTestData, c *C) {
c.Check(getStatusItem("PullQueue", "InProgress"), Equals, float64(0))
c.Check(getStatusItem("PullQueue", "Queued"), Equals, float64(0))
+ c.Check(getStatusItem("Version"), Not(Equals), "")
response := IssueRequest(&testData.req)
c.Assert(response.Code, Equals, testData.responseCode)
diff --git a/services/ws/router.go b/services/ws/router.go
index 2b9bd66..5fa1674 100644
--- a/services/ws/router.go
+++ b/services/ws/router.go
@@ -15,6 +15,7 @@ import (
"git.curoverse.com/arvados.git/sdk/go/ctxlog"
"git.curoverse.com/arvados.git/sdk/go/health"
+ arvadosVersion "git.curoverse.com/arvados.git/sdk/go/version"
"github.com/Sirupsen/logrus"
"golang.org/x/net/websocket"
)
@@ -123,6 +124,7 @@ func (rtr *router) DebugStatus() interface{} {
func (rtr *router) Status() interface{} {
return map[string]interface{}{
"Clients": atomic.LoadInt64(&rtr.status.ReqsActive),
+ "Version": arvadosVersion.GetVersion(),
}
}
diff --git a/services/ws/server_test.go b/services/ws/server_test.go
index c1caa2a..b1f9438 100644
--- a/services/ws/server_test.go
+++ b/services/ws/server_test.go
@@ -5,6 +5,7 @@
package main
import (
+ "encoding/json"
"io/ioutil"
"net/http"
"sync"
@@ -90,6 +91,21 @@ func (s *serverSuite) TestHealth(c *check.C) {
}
}
+func (s *serverSuite) TestStatus(c *check.C) {
+ go s.srv.Run()
+ defer s.srv.Close()
+ s.srv.WaitReady()
+ req, err := http.NewRequest("GET", "http://"+s.srv.listener.Addr().String()+"/status.json", nil)
+ c.Assert(err, check.IsNil)
+ resp, err := http.DefaultClient.Do(req)
+ c.Check(err, check.IsNil)
+ c.Check(resp.StatusCode, check.Equals, http.StatusOK)
+ var status map[string]interface{}
+ err = json.NewDecoder(resp.Body).Decode(&status)
+ c.Check(err, check.IsNil)
+ c.Check(status["Version"], check.Not(check.Equals), "")
+}
+
func (s *serverSuite) TestHealthDisabled(c *check.C) {
s.cfg.ManagementToken = ""
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list