diff --git a/modules/mesh-build-go/cmd/mesh-build-go/asks_test.go b/modules/mesh-build-go/cmd/mesh-build-go/asks_test.go index 20f6d788..7759b452 100644 --- a/modules/mesh-build-go/cmd/mesh-build-go/asks_test.go +++ b/modules/mesh-build-go/cmd/mesh-build-go/asks_test.go @@ -144,10 +144,10 @@ func TestManifestClaimsTheGoBuildSeatAndReadsItsCapacity(t *testing.T) { if w, fault := buildstep.NodeBuildHours(moduleDir+"/files/settings.json", "g14", t.Errorf)(); w != nil || fault != "" { t.Errorf("the settings template holds build hours %v (%s)", w, fault) } - var capacity string + var capacity float64 _ = json.Unmarshal(doc.Config[buildstep.CapacitySetting].Default, &capacity) - if capacity != buildstep.DefaultCapacities { - t.Errorf("the capacity's default = %q, want %q", capacity, buildstep.DefaultCapacities) + if capacity != 0 { + t.Errorf("the capacity's default = %g, want 0", capacity) } settings := resource(t, m, "settings") if settings["path"] != "${dir:state}/settings.json" { diff --git a/modules/mesh-build-go/files/settings.json b/modules/mesh-build-go/files/settings.json index 56bb28d4..3b65dd1c 100644 --- a/modules/mesh-build-go/files/settings.json +++ b/modules/mesh-build-go/files/settings.json @@ -1,5 +1,5 @@ { - "capacity": "shanks=3,ace=2,g14=0,novox=0", + "capacity": 0, "cores-per-step": 6, "build-hours": "" } diff --git a/modules/mesh-build-go/module.json b/modules/mesh-build-go/module.json index 7526d1a0..6cd433e4 100644 --- a/modules/mesh-build-go/module.json +++ b/modules/mesh-build-go/module.json @@ -25,10 +25,10 @@ ], "config": { "capacity": { - "type": "string", - "description": "How many asks of the Go build seat this module runs at once on each node, as node=asks pairs separated by commas, such as shanks=3,ace=2 (novox/hq ADR 0525 §5); a node set to 0 pulls nothing, a node not named runs one at a time. The control-node and the laptop build nothing.", - "pattern": "|[a-z0-9_-]+=[0-9]+(,[a-z0-9_-]+=[0-9]+)*", - "default": "shanks=3,ace=2,g14=0,novox=0" + "type": "number", + "description": "How many asks of the Go build seat this module runs at once on this node (novox/hq ADR 0525 §5); 0 pulls nothing. It is set per node in the mesh's configuration; a node with no value builds nothing.", + "minimum": 0, + "default": 0 }, "build-hours": { "type": "string", diff --git a/modules/mesh-build-image/files/settings.json b/modules/mesh-build-image/files/settings.json index 73ee4fa8..4a445c34 100644 --- a/modules/mesh-build-image/files/settings.json +++ b/modules/mesh-build-image/files/settings.json @@ -1,5 +1,5 @@ { - "capacity": "shanks=3,ace=2,g14=0,novox=0", + "capacity": 0, "cores-per-step": 2, "build-hours": "" } diff --git a/modules/mesh-build-image/module.json b/modules/mesh-build-image/module.json index c83b9d88..b19d36b3 100644 --- a/modules/mesh-build-image/module.json +++ b/modules/mesh-build-image/module.json @@ -20,10 +20,10 @@ ], "config": { "capacity": { - "type": "string", - "description": "How many asks of the image build seat this module runs at once on each node, as node=asks pairs separated by commas, such as shanks=3,ace=2 (novox/hq ADR 0525 §5); a node set to 0 pulls nothing, a node not named runs one at a time. The control-node and the laptop build nothing.", - "pattern": "|[a-z0-9_-]+=[0-9]+(,[a-z0-9_-]+=[0-9]+)*", - "default": "shanks=3,ace=2,g14=0,novox=0" + "type": "number", + "description": "How many asks of the image build seat this module runs at once on this node (novox/hq ADR 0525 §5); 0 pulls nothing. It is set per node in the mesh's configuration; a node with no value builds nothing.", + "minimum": 0, + "default": 0 }, "build-hours": { "type": "string", diff --git a/modules/mesh-build-node/cmd/mesh-build-node/asks_test.go b/modules/mesh-build-node/cmd/mesh-build-node/asks_test.go index 8ae9a43d..5a2f0172 100644 --- a/modules/mesh-build-node/cmd/mesh-build-node/asks_test.go +++ b/modules/mesh-build-node/cmd/mesh-build-node/asks_test.go @@ -102,10 +102,10 @@ func TestManifestTakesTheBuildCapacity(t *testing.T) { if w, fault := buildstep.NodeBuildHours(moduleDir+"/files/settings.json", "g14", t.Errorf)(); w != nil || fault != "" { t.Errorf("the settings template holds build hours %v (%s)", w, fault) } - var capacity string + var capacity float64 _ = json.Unmarshal(doc.Config[buildstep.CapacitySetting].Default, &capacity) - if capacity != buildstep.DefaultCapacities { - t.Errorf("the capacity's default = %q", capacity) + if capacity != 0 { + t.Errorf("the capacity's default = %g, want 0", capacity) } if resource(t, m, "settings")["path"] != "${dir:state}/settings.json" { t.Error("no settings file") diff --git a/modules/mesh-build-node/files/settings.json b/modules/mesh-build-node/files/settings.json index 73ee4fa8..4a445c34 100644 --- a/modules/mesh-build-node/files/settings.json +++ b/modules/mesh-build-node/files/settings.json @@ -1,5 +1,5 @@ { - "capacity": "shanks=3,ace=2,g14=0,novox=0", + "capacity": 0, "cores-per-step": 2, "build-hours": "" } diff --git a/modules/mesh-build-node/module.json b/modules/mesh-build-node/module.json index baf8b291..ebd4dd72 100644 --- a/modules/mesh-build-node/module.json +++ b/modules/mesh-build-node/module.json @@ -21,10 +21,10 @@ ], "config": { "capacity": { - "type": "string", - "description": "How many asks of the Node build seat this module runs at once on each node, as node=asks pairs separated by commas, such as shanks=3,ace=2 (novox/hq ADR 0525 §5); a node set to 0 pulls nothing, a node not named runs one at a time. The control-node and the laptop build nothing.", - "pattern": "|[a-z0-9_-]+=[0-9]+(,[a-z0-9_-]+=[0-9]+)*", - "default": "shanks=3,ace=2,g14=0,novox=0" + "type": "number", + "description": "How many asks of the Node build seat this module runs at once on this node (novox/hq ADR 0525 §5); 0 pulls nothing. It is set per node in the mesh's configuration; a node with no value builds nothing.", + "minimum": 0, + "default": 0 }, "build-hours": { "type": "string",