[ARVADOS] created: 2.1.0-2492-ga3bc246cd
Git user
git at public.arvados.org
Tue May 17 04:01:57 UTC 2022
at a3bc246cd76f0c774f9f166328706751df119dc1 (commit)
commit a3bc246cd76f0c774f9f166328706751df119dc1
Author: Tom Clegg <tom at curii.com>
Date: Tue May 17 00:01:46 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".
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list