[ARVADOS] updated: 1.3.0-2497-gde1f02c44

Git user git at public.arvados.org
Tue Apr 21 15:21:10 UTC 2020


Summary of changes:
 services/keepproxy/keepproxy_test.go | 54 +++++++++++++++++++++++++++++++++---
 1 file changed, 50 insertions(+), 4 deletions(-)

  discards  0887e53403ebe3ffe4ef1d64090c0663be1ee270 (commit)
       via  de1f02c44bf8da29b1c5194efc29daf781b750bc (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 (0887e53403ebe3ffe4ef1d64090c0663be1ee270)
            \
             N -- N -- N (de1f02c44bf8da29b1c5194efc29daf781b750bc)

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

    If config.yml is available, use the keepstores defined there instead of
    the legacy autodiscover mechanism via the API server.
    
    refs #16328
    
    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..d0b39b82a 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{})
 
@@ -83,6 +89,20 @@ func (s *ServerRequiredSuite) TearDownSuite(c *C) {
 	arvadostest.StopAPI()
 }
 
+func (s *ServerRequiredConfigYmlSuite) SetUpSuite(c *C) {
+	arvadostest.StartAPI()
+	arvadostest.StartKeep(4, false)
+}
+
+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
@@ -99,12 +119,25 @@ func (s *NoKeepServerSuite) TearDownSuite(c *C) {
 	arvadostest.StopAPI()
 }
 
-func runProxy(c *C, bogusClientToken bool) *keepclient.KeepClient {
+func runProxy(c *C, options ...bool) *keepclient.KeepClient {
+	bogusClientToken := false
+	if len(options) > 0 && options[0] {
+		bogusClientToken = true
+	}
+	loadKeepstoresFromConfig := false
+	if len(options) > 1 && options[1] {
+		loadKeepstoresFromConfig = true
+	}
 	cfg, err := config.NewLoader(nil, ctxlog.TestLogger(c)).Load()
 	c.Assert(err, Equals, nil)
 	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
@@ -115,6 +148,7 @@ func runProxy(c *C, bogusClientToken bool) *keepclient.KeepClient {
 	waitForListener()
 
 	client := arvados.NewClientFromEnv()
+
 	arv, err := arvadosclient.New(client)
 	c.Assert(err, Equals, nil)
 	if bogusClientToken {
@@ -463,7 +497,22 @@ 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) {
-	kc := runProxy(c, false)
+	GetIndexWorker(c, false)
+}
+
+// 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, true)
+}
+
+func GetIndexWorker(c *C, useConfig bool) {
+	kc := runProxy(c, false, useConfig)
 	defer closeListener()
 
 	// Put "index-data" blocks

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list