From 3138570c6b743721370102d331e37fb1b583b50f Mon Sep 17 00:00:00 2001 From: jochen Date: Sun, 25 Oct 2026 17:28:00 +0100 Subject: [PATCH] Let the build modules follow their capacity on the bus, so a node raised from capacity 0 starts pulling (issue 1887) g14's Go builder sat idle at capacity 2 because nothing woke its parked puller. mesh-build-go, mesh-build-node and mesh-build-image now pin mesh-sdk b9911dc1, whose puller watches the config value capacity as mesh-config resolved it and wakes on each change, and hand it that watch. --- modules/mesh-build-go/cmd/mesh-build-go/asks.go | 6 +++++- modules/mesh-build-go/go.mod | 2 +- modules/mesh-build-go/go.sum | 4 ++-- modules/mesh-build-image/cmd/mesh-build-image/asks.go | 6 +++++- modules/mesh-build-image/go.mod | 2 +- modules/mesh-build-image/go.sum | 4 ++-- modules/mesh-build-node/cmd/mesh-build-node/asks.go | 6 +++++- modules/mesh-build-node/go.mod | 2 +- modules/mesh-build-node/go.sum | 4 ++-- 9 files changed, 24 insertions(+), 12 deletions(-) diff --git a/modules/mesh-build-go/cmd/mesh-build-go/asks.go b/modules/mesh-build-go/cmd/mesh-build-go/asks.go index bb0713da..98e98a2c 100644 --- a/modules/mesh-build-go/cmd/mesh-build-go/asks.go +++ b/modules/mesh-build-go/cmd/mesh-build-go/asks.go @@ -80,8 +80,12 @@ func (m *Module) Puller(steps []StepTool, source buildstep.AskSource) *buildstep source = buildstep.SeatAsks{Language: delivery.AskGo} } capacity := m.Capacity + // The capacity's own change wakes the puller (issue 1887): the runtime's watch of the config value as mesh-config + // resolved it; the settings file is read only when that watch cannot start. A test's Capacity is its own. + var watch func(string, func(stdio.ProvisionChange) error) error if capacity == nil { capacity = buildstep.NodeCapacity(m.Settings, buildstep.DefaultCapacities, m.Node, m.Say) + watch = buildstep.WatchConfigServed } ask := m.askSteps(steps) var load func(string) ([]byte, error) @@ -92,7 +96,7 @@ func (m *Module) Puller(steps []StepTool, source buildstep.AskSource) *buildstep } } return &buildstep.Puller{Source: source, Language: delivery.AskGo, Node: m.Node, Put: m.Steps, Load: load, - Capacity: capacity, Logf: m.Say, + Capacity: capacity, WatchConfig: watch, Logf: m.Say, Run: func(ctx context.Context, a delivery.StepAsk) (any, error) { if err := m.Check(ctx); err != nil { return nil, err diff --git a/modules/mesh-build-go/go.mod b/modules/mesh-build-go/go.mod index a5118d4a..77ee589d 100644 --- a/modules/mesh-build-go/go.mod +++ b/modules/mesh-build-go/go.mod @@ -3,7 +3,7 @@ module meshbuildgo go 1.26.0 require ( - git.novox.be/novox/mesh-sdk/go v0.1.14-0.20261024125710-bfc3883af980 + git.novox.be/novox/mesh-sdk/go v0.1.14-0.20261025162610-b9911dc1c135 github.com/distribution/distribution/v3 v3.1.2 github.com/nats-io/nats-server/v2 v2.11.17 github.com/nats-io/nats.go v1.54.0 diff --git a/modules/mesh-build-go/go.sum b/modules/mesh-build-go/go.sum index f32f243f..1c802779 100644 --- a/modules/mesh-build-go/go.sum +++ b/modules/mesh-build-go/go.sum @@ -1,5 +1,5 @@ -git.novox.be/novox/mesh-sdk/go v0.1.14-0.20261024125710-bfc3883af980 h1:ZEEeYibEPD1rngOAqbODzRY5rUStGC46OpyQwtNCYbs= -git.novox.be/novox/mesh-sdk/go v0.1.14-0.20261024125710-bfc3883af980/go.mod h1:ouERNpZizzwZ0HLEtAypsY9FR20FyUgUYRni6J7kVCY= +git.novox.be/novox/mesh-sdk/go v0.1.14-0.20261025162610-b9911dc1c135 h1:1bd54/hyCGgy1vUv3B2jV9HFzk3h7so15lIYgd9EzSE= +git.novox.be/novox/mesh-sdk/go v0.1.14-0.20261025162610-b9911dc1c135/go.mod h1:ouERNpZizzwZ0HLEtAypsY9FR20FyUgUYRni6J7kVCY= github.com/alicebob/miniredis/v2 v2.35.0 h1:QwLphYqCEAo1eu1TqPRN2jgVMPBweeQcR21jeqDCONI= github.com/alicebob/miniredis/v2 v2.35.0/go.mod h1:TcL7YfarKPGDAthEtl5NBeHZfeUQj6OXMm/+iu5cLMM= github.com/antithesishq/antithesis-sdk-go v0.7.0-default-no-op h1:Z/MZK75wC/NSrkgqeNIa7jexam9uWzhLmFTSCPI/kn0= diff --git a/modules/mesh-build-image/cmd/mesh-build-image/asks.go b/modules/mesh-build-image/cmd/mesh-build-image/asks.go index e72a4d05..fe987adc 100644 --- a/modules/mesh-build-image/cmd/mesh-build-image/asks.go +++ b/modules/mesh-build-image/cmd/mesh-build-image/asks.go @@ -37,8 +37,12 @@ func (m *Module) Puller(steps []StepTool, source buildstep.AskSource) *buildstep source = buildstep.SeatAsks{Language: delivery.AskImage} } capacity := m.Capacity + // The capacity's own change wakes the puller (issue 1887): the runtime's watch of the config value as mesh-config + // resolved it; the settings file is read only when that watch cannot start. A test's Capacity is its own. + var watch func(string, func(stdio.ProvisionChange) error) error if capacity == nil { capacity = buildstep.NodeCapacity(m.Settings, buildstep.DefaultCapacities, m.Node, m.Say) + watch = buildstep.WatchConfigServed } ask := m.askSteps(steps) var load func(string) ([]byte, error) @@ -46,7 +50,7 @@ func (m *Module) Puller(steps []StepTool, source buildstep.AskSource) *buildstep load = func(key string) ([]byte, error) { return m.ReadSteps.Get(key) } } return &buildstep.Puller{Source: source, Language: delivery.AskImage, Node: m.Node, Put: m.Steps, Load: load, - Capacity: capacity, Logf: m.Say, + Capacity: capacity, WatchConfig: watch, Logf: m.Say, Run: func(ctx context.Context, a delivery.StepAsk) (any, error) { if err := m.Check(ctx); err != nil { return nil, err diff --git a/modules/mesh-build-image/go.mod b/modules/mesh-build-image/go.mod index 11d4dde0..fccb53e1 100644 --- a/modules/mesh-build-image/go.mod +++ b/modules/mesh-build-image/go.mod @@ -3,7 +3,7 @@ module meshbuildimage go 1.26.0 require ( - git.novox.be/novox/mesh-sdk/go v0.1.14-0.20261023213200-403a5d72ab93 + git.novox.be/novox/mesh-sdk/go v0.1.14-0.20261025162610-b9911dc1c135 github.com/nats-io/nats-server/v2 v2.11.17 github.com/nats-io/nats.go v1.54.0 ) diff --git a/modules/mesh-build-image/go.sum b/modules/mesh-build-image/go.sum index 744af4c5..d7e5bacc 100644 --- a/modules/mesh-build-image/go.sum +++ b/modules/mesh-build-image/go.sum @@ -1,5 +1,5 @@ -git.novox.be/novox/mesh-sdk/go v0.1.14-0.20261023213200-403a5d72ab93 h1:FAiFY2KBKEoZSH49OZTt7/zRBIQxyl5g/KhYrpggbN4= -git.novox.be/novox/mesh-sdk/go v0.1.14-0.20261023213200-403a5d72ab93/go.mod h1:ouERNpZizzwZ0HLEtAypsY9FR20FyUgUYRni6J7kVCY= +git.novox.be/novox/mesh-sdk/go v0.1.14-0.20261025162610-b9911dc1c135 h1:1bd54/hyCGgy1vUv3B2jV9HFzk3h7so15lIYgd9EzSE= +git.novox.be/novox/mesh-sdk/go v0.1.14-0.20261025162610-b9911dc1c135/go.mod h1:ouERNpZizzwZ0HLEtAypsY9FR20FyUgUYRni6J7kVCY= github.com/antithesishq/antithesis-sdk-go v0.7.0-default-no-op h1:Z/MZK75wC/NSrkgqeNIa7jexam9uWzhLmFTSCPI/kn0= github.com/antithesishq/antithesis-sdk-go v0.7.0-default-no-op/go.mod h1:FQyySiasQQM8735Ddel3MRojmy4dA1IqCeyJ5jmPMbI= github.com/google/go-tpm v0.9.8 h1:slArAR9Ft+1ybZu0lBwpSmpwhRXaa85hWtMinMyRAWo= diff --git a/modules/mesh-build-node/cmd/mesh-build-node/asks.go b/modules/mesh-build-node/cmd/mesh-build-node/asks.go index fa3becaf..2e7c4f2e 100644 --- a/modules/mesh-build-node/cmd/mesh-build-node/asks.go +++ b/modules/mesh-build-node/cmd/mesh-build-node/asks.go @@ -45,8 +45,12 @@ func (m *Module) Puller(steps []StepTool, source buildstep.AskSource) *buildstep source = buildstep.SeatAsks{Language: delivery.AskNode} } capacity := m.Capacity + // The capacity's own change wakes the puller (issue 1887): the runtime's watch of the config value as mesh-config + // resolved it; the settings file is read only when that watch cannot start. A test's Capacity is its own. + var watch func(string, func(stdio.ProvisionChange) error) error if capacity == nil { capacity = buildstep.NodeCapacity(m.Settings, buildstep.DefaultCapacities, m.Node, m.Say) + watch = buildstep.WatchConfigServed } ask := m.askSteps(steps) var load func(string) ([]byte, error) @@ -54,7 +58,7 @@ func (m *Module) Puller(steps []StepTool, source buildstep.AskSource) *buildstep load = func(key string) ([]byte, error) { return m.ReadSteps.Get(key) } } return &buildstep.Puller{Source: source, Language: delivery.AskNode, Node: m.Node, Put: m.Steps, Load: load, - Capacity: capacity, Logf: m.Say, + Capacity: capacity, WatchConfig: watch, Logf: m.Say, Run: func(ctx context.Context, a delivery.StepAsk) (any, error) { if err := m.Prepare(ctx); err != nil { return nil, err diff --git a/modules/mesh-build-node/go.mod b/modules/mesh-build-node/go.mod index 612d489b..25d8dcaf 100644 --- a/modules/mesh-build-node/go.mod +++ b/modules/mesh-build-node/go.mod @@ -3,7 +3,7 @@ module meshbuildnode go 1.26.0 require ( - git.novox.be/novox/mesh-sdk/go v0.1.14-0.20261023213200-403a5d72ab93 + git.novox.be/novox/mesh-sdk/go v0.1.14-0.20261025162610-b9911dc1c135 github.com/distribution/distribution/v3 v3.1.2 github.com/nats-io/nats.go v1.54.0 ) diff --git a/modules/mesh-build-node/go.sum b/modules/mesh-build-node/go.sum index f7f15fa5..97baed83 100644 --- a/modules/mesh-build-node/go.sum +++ b/modules/mesh-build-node/go.sum @@ -1,5 +1,5 @@ -git.novox.be/novox/mesh-sdk/go v0.1.14-0.20261023213200-403a5d72ab93 h1:FAiFY2KBKEoZSH49OZTt7/zRBIQxyl5g/KhYrpggbN4= -git.novox.be/novox/mesh-sdk/go v0.1.14-0.20261023213200-403a5d72ab93/go.mod h1:ouERNpZizzwZ0HLEtAypsY9FR20FyUgUYRni6J7kVCY= +git.novox.be/novox/mesh-sdk/go v0.1.14-0.20261025162610-b9911dc1c135 h1:1bd54/hyCGgy1vUv3B2jV9HFzk3h7so15lIYgd9EzSE= +git.novox.be/novox/mesh-sdk/go v0.1.14-0.20261025162610-b9911dc1c135/go.mod h1:ouERNpZizzwZ0HLEtAypsY9FR20FyUgUYRni6J7kVCY= github.com/alicebob/miniredis/v2 v2.35.0 h1:QwLphYqCEAo1eu1TqPRN2jgVMPBweeQcR21jeqDCONI= github.com/alicebob/miniredis/v2 v2.35.0/go.mod h1:TcL7YfarKPGDAthEtl5NBeHZfeUQj6OXMm/+iu5cLMM= github.com/antithesishq/antithesis-sdk-go v0.7.0-default-no-op h1:Z/MZK75wC/NSrkgqeNIa7jexam9uWzhLmFTSCPI/kn0=