[ARVADOS] updated: 1.1.4-383-g9f7687081
Git user
git at public.curoverse.com
Thu Jun 14 11:05:16 EDT 2018
Summary of changes:
lib/dispatchcloud/node_size_test.go | 3 +--
.../crunch-dispatch-slurm/crunch-dispatch-slurm.go | 20 +++++++++++---------
2 files changed, 12 insertions(+), 11 deletions(-)
via 9f768708156197decac1e6dc5dedf3a730a06fad (commit)
from 6714a5e7fcf4d5fde2ecd5a7f9f6504cb5ca374b (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 9f768708156197decac1e6dc5dedf3a730a06fad
Author: Lucas Di Pentima <ldipentima at veritasgenetics.com>
Date: Thu Jun 14 12:04:22 2018 -0300
13581: Adds log message when no instance types are configured.
Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <ldipentima at veritasgenetics.com>
diff --git a/lib/dispatchcloud/node_size_test.go b/lib/dispatchcloud/node_size_test.go
index 31944cfa5..e2a729f4d 100644
--- a/lib/dispatchcloud/node_size_test.go
+++ b/lib/dispatchcloud/node_size_test.go
@@ -32,8 +32,7 @@ func (*NodeSizeSuite) TestChooseUnsatisfiable(c *check.C) {
{Price: 2.2, RAM: 2000000000, VCPUs: 4, Name: "small2"},
{Price: 4.4, RAM: 4000000000, VCPUs: 8, Name: "small4", Scratch: GiB},
}}, ctr)
- err, ok := err.(ConstraintsNotSatisfiableError)
- c.Check(ok, check.Equals, true)
+ c.Check(err, check.FitsTypeOf, ConstraintsNotSatisfiableError{})
}
for _, rc := range []arvados.RuntimeConstraints{
diff --git a/services/crunch-dispatch-slurm/crunch-dispatch-slurm.go b/services/crunch-dispatch-slurm/crunch-dispatch-slurm.go
index 8c5b220b4..d1f19dd7b 100644
--- a/services/crunch-dispatch-slurm/crunch-dispatch-slurm.go
+++ b/services/crunch-dispatch-slurm/crunch-dispatch-slurm.go
@@ -277,15 +277,17 @@ func (disp *Dispatcher) runContainer(_ *dispatch.Dispatcher, ctr arvados.Contain
var text string
if err, ok := err.(dispatchcloud.ConstraintsNotSatisfiableError); ok {
var logBuf bytes.Buffer
- logBuf.WriteString(fmt.Sprintf("cannot run container %s: %s\n", ctr.UUID, err))
- if len(err.AvailableTypes) > 0 {
- logBuf.WriteString("Available instance types:\n")
- }
- for _, t := range err.AvailableTypes {
- logBuf.WriteString(fmt.Sprintf(
- "Type %q: %d VCPUs, %d RAM, %d Scratch, %f Price\n",
- t.Name, t.VCPUs, t.RAM, t.Scratch, t.Price,
- ))
+ fmt.Fprintf(&logBuf, "cannot run container %s: %s\n", ctr.UUID, err)
+ if len(err.AvailableTypes) == 0 {
+ fmt.Fprint(&logBuf, "No instance types are configured.\n")
+ } else {
+ fmt.Fprint(&logBuf, "Available instance types:\n")
+ for _, t := range err.AvailableTypes {
+ fmt.Fprintf(&logBuf,
+ "Type %q: %d VCPUs, %d RAM, %d Scratch, %f Price\n",
+ t.Name, t.VCPUs, t.RAM, t.Scratch, t.Price,
+ )
+ }
}
text = logBuf.String()
disp.UpdateState(ctr.UUID, dispatch.Cancelled)
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list