[ARVADOS] updated: 1.3.0-9-g4d27cabda
Git user
git at public.curoverse.com
Thu Dec 13 10:37:51 EST 2018
Summary of changes:
lib/dispatchcloud/node_size.go | 2 ++
lib/dispatchcloud/node_size_test.go | 12 ++++++++++++
2 files changed, 14 insertions(+)
via 4d27cabda122ebda4c8688580af9088c8732a074 (commit)
from 934d880aa5d10ed3382f9924a9a9f5694b41f266 (commit)
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 4d27cabda122ebda4c8688580af9088c8732a074
Author: Peter Amstutz <pamstutz at veritasgenetics.com>
Date: Thu Dec 13 10:37:26 2018 -0500
14495: Add warnings when estimateDockerImageSize gets bad input
Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <pamstutz at veritasgenetics.com>
diff --git a/lib/dispatchcloud/node_size.go b/lib/dispatchcloud/node_size.go
index 7706e411b..339e042c1 100644
--- a/lib/dispatchcloud/node_size.go
+++ b/lib/dispatchcloud/node_size.go
@@ -38,10 +38,12 @@ var pdhRegexp = regexp.MustCompile(`^[0-9a-f]{32}\+(\d+)$`)
func estimateDockerImageSize(collectionPDH string) int64 {
m := pdhRegexp.FindStringSubmatch(collectionPDH)
if m == nil {
+ log.Printf("estimateDockerImageSize: '%v' did not match pdhRegexp, returning 0", collectionPDH)
return 0
}
n, err := strconv.ParseInt(m[1], 10, 64)
if err != nil || n < 122 {
+ log.Printf("estimateDockerImageSize: short manifest %v or error (%v), returning 0", n, err)
return 0
}
// To avoid having to fetch the collection, take advantage of
diff --git a/lib/dispatchcloud/node_size_test.go b/lib/dispatchcloud/node_size_test.go
index e94853816..eef86f747 100644
--- a/lib/dispatchcloud/node_size_test.go
+++ b/lib/dispatchcloud/node_size_test.go
@@ -128,4 +128,16 @@ func (*NodeSizeSuite) TestScratchForDockerImage(c *check.C) {
// Estimated size is 384 MiB (402653184 bytes)
// Want to reserve 2x the estimated size, so 805306368 bytes
c.Check(n, check.Equals, int64(805306368))
+
+ n = EstimateScratchSpace(&arvados.Container{
+ ContainerImage: "d5025c0f29f6eef304a7358afa82a822+-342",
+ })
+ // Parse error will return 0
+ c.Check(n, check.Equals, int64(0))
+
+ n = EstimateScratchSpace(&arvados.Container{
+ ContainerImage: "d5025c0f29f6eef304a7358afa82a822+34",
+ })
+ // Short manifest will return 0
+ c.Check(n, check.Equals, int64(0))
}
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list