[ARVADOS] created: 2.1.0-2492-gdcf8de623
Git user
git at public.arvados.org
Tue May 17 05:36:28 UTC 2022
at dcf8de623d744458d7e39a1efe3814349de76649 (commit)
commit dcf8de623d744458d7e39a1efe3814349de76649
Author: Tom Clegg <tom at curii.com>
Date: Tue May 17 01:36:06 2022 -0400
18983: Warn if LocalKeepBlobBuffersPerVCPU > 0 but will not be used.
Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom at curii.com>
diff --git a/lib/config/load.go b/lib/config/load.go
index 8f8ab2bf2..dba799787 100644
--- a/lib/config/load.go
+++ b/lib/config/load.go
@@ -340,6 +340,7 @@ func (ldr *Loader) Load() (*arvados.Config, error) {
ldr.checkEnum("Containers.LocalKeepLogsToContainerLog", cc.Containers.LocalKeepLogsToContainerLog, "none", "all", "errors"),
ldr.checkEmptyKeepstores(cc),
ldr.checkUnlistedKeepstores(cc),
+ ldr.checkLocalKeepBlobBuffers(cc),
ldr.checkStorageClasses(cc),
ldr.checkCUDAVersions(cc),
// TODO: check non-empty Rendezvous on
@@ -437,6 +438,24 @@ cluster:
return nil
}
+func (ldr *Loader) checkLocalKeepBlobBuffers(cc arvados.Cluster) error {
+ kbb := cc.Containers.LocalKeepBlobBuffersPerVCPU
+ if kbb == 0 {
+ return nil
+ }
+ for uuid, vol := range cc.Volumes {
+ if len(vol.AccessViaHosts) > 0 {
+ ldr.Logger.Warnf("LocalKeepBlobBuffersPerVCPU is %d but will not be used because at least one volume (%s) uses AccessViaHosts -- suggest changing to 0", kbb, uuid)
+ return nil
+ }
+ if !vol.ReadOnly && vol.Replication < cc.Collections.DefaultReplication {
+ ldr.Logger.Warnf("LocalKeepBlobBuffersPerVCPU is %d but will not be used because at least one volume (%s) has lower replication than DefaultReplication (%d < %d) -- suggest changing to 0", kbb, uuid, vol.Replication, cc.Collections.DefaultReplication)
+ return nil
+ }
+ }
+ return nil
+}
+
func (ldr *Loader) checkStorageClasses(cc arvados.Cluster) error {
classOnVolume := map[string]bool{}
for volid, vol := range cc.Volumes {
diff --git a/lib/config/load_test.go b/lib/config/load_test.go
index 4ae9a513c..feb05cb95 100644
--- a/lib/config/load_test.go
+++ b/lib/config/load_test.go
@@ -237,7 +237,7 @@ Clusters:
InternalURLs:
"http://host.example:12345": {}
Volumes:
- zzzzz-nyw5e-aaaaaaaaaaaaaaa: {}
+ zzzzz-nyw5e-aaaaaaaaaaaaaaa: {Replication: 2}
`, &logbuf).Load()
c.Assert(err, check.IsNil)
c.Log(logbuf.String())
@@ -601,6 +601,31 @@ func (s *LoadSuite) TestListKeys(c *check.C) {
}
}
+func (s *LoadSuite) TestWarnUnusedLocalKeep(c *check.C) {
+ var logbuf bytes.Buffer
+ _, err := testLoader(c, `
+Clusters:
+ z1111:
+ Volumes:
+ z:
+ Replication: 1
+`, &logbuf).Load()
+ c.Assert(err, check.IsNil)
+ c.Check(logbuf.String(), check.Matches, `(?ms).*LocalKeepBlobBuffersPerVCPU is 1 but will not be used because at least one volume \(z\) has lower replication than DefaultReplication \(1 < 2\) -- suggest changing to 0.*`)
+
+ logbuf.Reset()
+ _, err = testLoader(c, `
+Clusters:
+ z1111:
+ Volumes:
+ z:
+ AccessViaHosts:
+ "http://0.0.0.0:12345": {}
+`, &logbuf).Load()
+ c.Assert(err, check.IsNil)
+ c.Check(logbuf.String(), check.Matches, `(?ms).*LocalKeepBlobBuffersPerVCPU is 1 but will not be used because at least one volume \(z\) uses AccessViaHosts -- suggest changing to 0.*`)
+}
+
func (s *LoadSuite) TestImplicitStorageClasses(c *check.C) {
// If StorageClasses and Volumes.*.StorageClasses are all
// empty, there is a default storage class named "default".
diff --git a/sdk/go/health/aggregator_test.go b/sdk/go/health/aggregator_test.go
index 481054c4d..2978d0735 100644
--- a/sdk/go/health/aggregator_test.go
+++ b/sdk/go/health/aggregator_test.go
@@ -48,6 +48,7 @@ func (s *AggregatorSuite) SetUpTest(c *check.C) {
cluster.SystemRootToken = arvadostest.SystemRootToken
cluster.Collections.BlobSigningKey = arvadostest.BlobSigningKey
cluster.Volumes["z"] = arvados.Volume{StorageClasses: map[string]bool{"default": true}}
+ cluster.Containers.LocalKeepBlobBuffersPerVCPU = 0
s.handler = &Aggregator{Cluster: cluster}
s.req = httptest.NewRequest("GET", "/_health/all", nil)
s.req.Header.Set("Authorization", "Bearer "+arvadostest.ManagementToken)
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list