Repository navigation
fix(substrate): adapt to Substrate v0.4 API and harden actor RPCs - #457
Conversation
Bump github.com/agent-substrate/substrate to v0.4.1-0.20261009152331-f6a1dc72a35d and adapt to its API changes: - ContainerReadyz -> ContainerWakeupProbe. - SnapshotsConfig -> SnapshotConfig with PreferredFidelity VOLUMES (equivalent to the previous data-only snapshot / resume-from-golden). - WorkerAssignment.WorkerPodIp -> WorkerPodIps; use the first (primary) IP and build the readiness URL with net.JoinHostPort so IPv6 works. Make Substrate calls more robust: - Retry ResumeActor (ResourceExhausted/Aborted) and SuspendActor, DeleteActor, DeleteActorTemplate (Aborted) with jittered exponential backoff via github.com/cenkalti/backoff/v5. - When CreateActorTemplate rejects the built template (InvalidArgument/ Unimplemented), fall back to cloning the cluster's base template with task overrides, preserving cluster-specific settings such as SnapshotConfig. Other: - Add v1alpha1.DefaultSystemNamespace and replace hard-coded "ax-system". - Don't reuse an existing CLI tunnel that points at a different namespace/service.
|
/ok-to-test |
|
/cc @mayawang |
mayawang
left a comment
There was a problem hiding this comment.
Thanks @siyuanfoundation, porting to v0.4 this fast unblocks everyone, and the IPv6-safe address handling is a nice touch. I wrote up the retry policy for the open Substrate PRs in #468; the two asks for this PR are under "Per PR". Happy to approve once those are in.
| ActorTemplate: tmpl, | ||
| } | ||
| created, err := c.control.CreateActorTemplate(ctx, req) | ||
| if code := status.Code(err); (code == codes.InvalidArgument || code == codes.Unimplemented) && baseTemplate != "" { |
There was a problem hiding this comment.
This is the fallback #468 asks to drop. InvalidArgument is also what real errors come back as (a bad image reference, or limits larger than a worker), and the clone keeps the base template's template-level settings. Once #405 lands, the task's resource limits live at that level, so a rejected template would quietly run without them.
There was a problem hiding this comment.
dropped the fallback
| var err error | ||
| resp, err = c.control.ResumeActor(ctx, req) | ||
| return err | ||
| }, codes.ResourceExhausted, codes.Aborted) |
There was a problem hiding this comment.
Could this retry Aborted only? #465 handles ResourceExhausted with its background loop, and retrying it here for up to ~20s eats most of each of its attempts.
Signed-off-by: siyuanfoundation <[email protected]>
fixes: #443
Bump github.com/agent-substrate/substrate to v0.4.1-0.20261009152331-f6a1dc72a35d and adapt to its API changes:
Make Substrate calls more robust:
Other: