[ARVADOS] updated: 1.3.0-2497-ga77a85660

Git user git at public.arvados.org
Tue Apr 21 19:06:27 UTC 2020


Summary of changes:
 services/keepproxy/keepproxy_test.go | 22 ++++++++--------------
 1 file changed, 8 insertions(+), 14 deletions(-)

  discards  de1f02c44bf8da29b1c5194efc29daf781b750bc (commit)
       via  a77a856600ef5d22208eff74d909ff6d1dc4664d (commit)

This update added new revisions after undoing existing revisions.  That is
to say, the old revision is not a strict subset of the new revision.  This
situation occurs when you --force push a change and generate a repository
containing something like this:

 * -- * -- B -- O -- O -- O (de1f02c44bf8da29b1c5194efc29daf781b750bc)
            \
             N -- N -- N (a77a856600ef5d22208eff74d909ff6d1dc4664d)

When this happens we assume that you've already had alert emails for all
of the O revisions, and so we here report only the revisions in the N
branch from the common base, B.

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 a77a856600ef5d22208eff74d909ff6d1dc4664d
Author: Ward Vandewege <ward at jhvc.com>
Date:   Mon Apr 13 17:57:03 2020 -0400

    16328: If config.yml is available, use the keepstores defined there instead of
    the legacy autodiscover mechanism via the API server.
    
    Arvados-DCO-1.1-Signed-off-by: Ward Vandewege <ward at jhvc.com>

diff --git a/services/keepproxy/keepproxy.go b/services/keepproxy/keepproxy.go
index 2b15d7994..547e77e5f 100644
--- a/services/keepproxy/keepproxy.go
+++ b/services/keepproxy/keepproxy.go
@@ -116,6 +116,12 @@ func run(logger log.FieldLogger, cluster *arvados.Cluster) error {
 		return fmt.Errorf("Error setting up arvados client %v", err)
 	}
 
+	// If a config file is available, use the keepstores defined there
+	// instead of the legacy autodiscover mechanism via the API server
+	for k := range cluster.Services.Keepstore.InternalURLs {
+		arv.KeepServiceURIs = append(arv.KeepServiceURIs, k.String())
+	}
+
 	if cluster.SystemLogs.LogLevel == "debug" {
 		keepclient.DebugPrintf = log.Printf
 	}
diff --git a/services/keepproxy/keepproxy_test.go b/services/keepproxy/keepproxy_test.go
index aa3235680..31597aef0 100644
--- a/services/keepproxy/keepproxy_test.go
+++ b/services/keepproxy/keepproxy_test.go
@@ -40,6 +40,12 @@ var _ = Suite(&ServerRequiredSuite{})
 // Tests that require the Keep server running
 type ServerRequiredSuite struct{}
 
+// Gocheck boilerplate
+var _ = Suite(&ServerRequiredConfigYmlSuite{})
+
+// Tests that require the Keep servers running as defined in config.yml
+type ServerRequiredConfigYmlSuite struct{}
+
 // Gocheck boilerplate
 var _ = Suite(&NoKeepServerSuite{})
 
@@ -47,6 +53,7 @@ var _ = Suite(&NoKeepServerSuite{})
 type NoKeepServerSuite struct{}
 
 var TestProxyUUID = "zzzzz-bi6l4-lrixqc4fxofbmzz"
+var loadKeepstoresFromConfig bool
 
 // Wait (up to 1 second) for keepproxy to listen on a port. This
 // avoids a race condition where we hit a "connection refused" error
@@ -83,6 +90,22 @@ func (s *ServerRequiredSuite) TearDownSuite(c *C) {
 	arvadostest.StopAPI()
 }
 
+func (s *ServerRequiredConfigYmlSuite) SetUpSuite(c *C) {
+	arvadostest.StartAPI()
+	// config.yml defines 4 keepstores
+	arvadostest.StartKeep(4, false)
+	loadKeepstoresFromConfig = true
+}
+
+func (s *ServerRequiredConfigYmlSuite) SetUpTest(c *C) {
+	arvadostest.ResetEnv()
+}
+
+func (s *ServerRequiredConfigYmlSuite) TearDownSuite(c *C) {
+	arvadostest.StopKeep(4)
+	arvadostest.StopAPI()
+}
+
 func (s *NoKeepServerSuite) SetUpSuite(c *C) {
 	arvadostest.StartAPI()
 	// We need API to have some keep services listed, but the
@@ -105,6 +128,11 @@ func runProxy(c *C, bogusClientToken bool) *keepclient.KeepClient {
 	cluster, err := cfg.GetCluster("")
 	c.Assert(err, Equals, nil)
 
+	if !loadKeepstoresFromConfig {
+		// Do not load Keepstore InternalURLs from the config file
+		cluster.Services.Keepstore.InternalURLs = make(map[arvados.URL]arvados.ServiceInstance)
+	}
+
 	cluster.Services.Keepproxy.InternalURLs = map[arvados.URL]arvados.ServiceInstance{arvados.URL{Host: ":0"}: arvados.ServiceInstance{}}
 
 	listener = nil
@@ -463,6 +491,21 @@ func (s *ServerRequiredSuite) TestStripHint(c *C) {
 //   With a valid but non-existing prefix (expect "\n")
 //   With an invalid prefix (expect error)
 func (s *ServerRequiredSuite) TestGetIndex(c *C) {
+	getIndexWorker(c)
+}
+
+// Test GetIndex
+//   Uses config.yml
+//   Put one block, with 2 replicas
+//   With no prefix (expect the block locator, twice)
+//   With an existing prefix (expect the block locator, twice)
+//   With a valid but non-existing prefix (expect "\n")
+//   With an invalid prefix (expect error)
+func (s *ServerRequiredConfigYmlSuite) TestGetIndex(c *C) {
+	getIndexWorker(c)
+}
+
+func getIndexWorker(c *C) {
 	kc := runProxy(c, false)
 	defer closeListener()
 

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list