[ARVADOS] created: 1.3.0-2543-g7e16d43dd
Git user
git at public.arvados.org
Mon May 11 18:27:56 UTC 2020
at 7e16d43dd62c05c0b150d1980cab5067ed18e128 (commit)
commit 7e16d43dd62c05c0b150d1980cab5067ed18e128
Author: Lucas Di Pentima <lucas at di-pentima.com.ar>
Date: Mon May 11 15:26:28 2020 -0300
16118: Keep-web initializes its client pool from config instead of envvars.
Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <lucas at di-pentima.com.ar>
diff --git a/sdk/go/arvadosclient/pool.go b/sdk/go/arvadosclient/pool.go
index 732080770..bb7867aef 100644
--- a/sdk/go/arvadosclient/pool.go
+++ b/sdk/go/arvadosclient/pool.go
@@ -6,6 +6,8 @@ package arvadosclient
import (
"sync"
+
+ "git.arvados.org/arvados.git/sdk/go/arvados"
)
// A ClientPool is a pool of ArvadosClients. This is useful for
@@ -14,7 +16,7 @@ import (
// credentials. See arvados-git-httpd for an example, and sync.Pool
// for more information about garbage collection.
type ClientPool struct {
- // Initialize new clients by coping this one.
+ // Initialize new clients by copying this one.
Prototype *ArvadosClient
pool *sync.Pool
@@ -25,7 +27,20 @@ type ClientPool struct {
// MakeClientPool returns a new empty ClientPool, using environment
// variables to initialize the prototype.
func MakeClientPool() *ClientPool {
- proto, err := MakeArvadosClient()
+ return MakeClientPoolWith(nil)
+}
+
+// MakeClientPoolWith returns a new empty ClientPool with a previously
+// initialized arvados.Client.
+func MakeClientPoolWith(client *arvados.Client) *ClientPool {
+ var err error
+ var proto *ArvadosClient
+
+ if client == nil {
+ proto, err = MakeArvadosClient()
+ } else {
+ proto, err = New(client)
+ }
return &ClientPool{
Prototype: proto,
lastErr: err,
diff --git a/sdk/go/keepclient/discover.go b/sdk/go/keepclient/discover.go
index 744ff8268..726c3fb30 100644
--- a/sdk/go/keepclient/discover.go
+++ b/sdk/go/keepclient/discover.go
@@ -19,7 +19,7 @@ import (
"git.arvados.org/arvados.git/sdk/go/arvadosclient"
)
-// ClearCache clears the Keep service discovery cache.
+// RefreshServiceDiscovery clears the Keep service discovery cache.
func RefreshServiceDiscovery() {
var wg sync.WaitGroup
defer wg.Wait()
@@ -35,8 +35,8 @@ func RefreshServiceDiscovery() {
}
}
-// ClearCacheOnSIGHUP installs a signal handler that calls
-// ClearCache when SIGHUP is received.
+// RefreshServiceDiscoveryOnSIGHUP installs a signal handler that calls
+// RefreshServiceDiscovery when SIGHUP is received.
func RefreshServiceDiscoveryOnSIGHUP() {
svcListCacheMtx.Lock()
defer svcListCacheMtx.Unlock()
diff --git a/services/keep-web/handler.go b/services/keep-web/handler.go
index 563a59df0..643ca4f58 100644
--- a/services/keep-web/handler.go
+++ b/services/keep-web/handler.go
@@ -76,7 +76,9 @@ func parseCollectionIDFromURL(s string) string {
}
func (h *handler) setup() {
- h.clientPool = arvadosclient.MakeClientPool()
+ // Errors will be handled at the client pool.
+ arv, _ := arvados.NewClientFromConfig(h.Config.cluster)
+ h.clientPool = arvadosclient.MakeClientPoolWith(arv)
keepclient.RefreshServiceDiscoveryOnSIGHUP()
keepclient.DefaultBlockCache.MaxBlocks = h.Config.cluster.Collections.WebDAVCache.MaxBlockEntries
commit b07264d87d8777c2981696a2f02ea17d74a179e2
Author: Lucas Di Pentima <lucas at di-pentima.com.ar>
Date: Thu May 7 18:38:08 2020 -0300
16118: Fixes ExternalURL configs for keep-web & websocket.
Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <lucas at di-pentima.com.ar>
diff --git a/lib/boot/supervisor.go b/lib/boot/supervisor.go
index c444ec300..bc8210e53 100644
--- a/lib/boot/supervisor.go
+++ b/lib/boot/supervisor.go
@@ -591,12 +591,13 @@ func (super *Supervisor) autofillConfig(cfg *arvados.Config) error {
svc == &cluster.Services.GitHTTP ||
svc == &cluster.Services.Health ||
svc == &cluster.Services.Keepproxy ||
- svc == &cluster.Services.WebDAV ||
- svc == &cluster.Services.WebDAVDownload ||
svc == &cluster.Services.Workbench1 {
svc.ExternalURL = arvados.URL{Scheme: "https", Host: fmt.Sprintf("%s:%s", super.ListenHost, nextPort(super.ListenHost))}
+ } else if svc == &cluster.Services.WebDAV ||
+ svc == &cluster.Services.WebDAVDownload {
+ svc.ExternalURL = arvados.URL{Scheme: "https", Host: fmt.Sprintf("%s:%s", super.ListenHost, nextPort(super.ListenHost)), Path: "/"}
} else if svc == &cluster.Services.Websocket {
- svc.ExternalURL = arvados.URL{Scheme: "wss", Host: fmt.Sprintf("%s:%s", super.ListenHost, nextPort(super.ListenHost))}
+ svc.ExternalURL = arvados.URL{Scheme: "wss", Host: fmt.Sprintf("%s:%s", super.ListenHost, nextPort(super.ListenHost)), Path: "/websocket"}
}
}
if len(svc.InternalURLs) == 0 {
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list