Repository navigation
chore(substrate): bump substrate to v0.6.0 and update control/dataplane integration - #517
Conversation
|
/cc @mayawang |
|
@siyuanfoundation What's the status of this change? It would be great to support 0.6.0. |
|
@siyuanfoundation #515 landed, so this needs a rebase on main. Happy to review right after. One heads-up: #521 builds its CI cache key from github.com/agent-substrate/substrate, so whichever of the two lands second should switch it to go.ate.dev/substrate. |
…ne integration
Upgrade agent-substrate from v0.5.0 to v0.6.0 and adapt AX's Substrate
client, controller, CLI, manifests, and E2E harness to the breaking
changes introduced in Substrate v0.6.0:
1. Module path rename (github.com/agent-substrate/substrate -> go.ate.dev/substrate):
- Substrate v0.6.0 moved its canonical Go module path to go.ate.dev/substrate
and dropped pkg/sandboxclass.
- Update go.mod, go.sum, and all ateapipb imports across internal/substrate,
internal/controller, and test/e2e.
2. ActorTemplate resource requirements and proto removals:
- Substrate v0.6.0 replaced the repeated ResourceLimit slice on ActorTemplate
with ResourceRequirements{Limits: Resources{CpuMillicores, MemoryBytes}}
and enforces in ate-api-server validation that every ActorTemplate sets
both non-zero cpu_millicores and memory_bytes. It also removed
ActorTemplate.SandboxConfig and DeleteActorRequest.AnyState.
- Add v1alpha1.ParseCPUMillicores and v1alpha1.ParseMemoryBytes to convert
Kubernetes resource quantity strings to int64 millicores and bytes.
- Update substrate.ResourceLimits, BuildActorTemplate, and
EnsureActorTemplateWithImage to populate *ateapipb.ResourceRequirements,
defaulting unset CPU/memory dimensions to DefaultCPUMillicores (1000m) and
DefaultMemoryBytes (512Mi).
3. Worker binary rename (cmd/ateom-gvisor -> cmd/ateworker-gvisor):
- Substrate v0.6.0 renamed the gVisor worker entrypoint from cmd/ateom-gvisor
to cmd/ateworker-gvisor.
- Update test/e2e/manifests/workerpool.yaml to use
ko://go.ate.dev/substrate/cmd/ateworker-gvisor.
4. Dataplane (atenet-router) mandatory mTLS on port 443:
- Substrate v0.6.0 removed plaintext port 80 from atenet-router and now
serves ingress exclusively over mTLS on port 443 using certificates signed
by servicedns.podcert.ate.dev/identity (server) and
podidentity.podcert.ate.dev/identity (client SPIFFE ID).
- Mount the podidentity.podcert.ate.dev/identity projected volume into
ax-server (deploy/ax-server.yaml and test/e2e/manifests/ax-server.yaml),
configure ATENET_ROUTER_ADDR to https://atenet-router.ate-system.svc.cluster.local:443,
and update the task reconciler's readiness probe client to present the
podidentity client certificate and verify the servicedns trust bundle.
- Add guest.DialTargetTLS and tunnel.RouterTLSConfig (which loads the live
servicedns ClusterTrustBundle and issues/caches a short-lived
PodCertificateRequest for ax-server) so 'ax ssh' connects to
svc/atenet-router:443 over mTLS.
5. E2E setup CLI migration to cmd/ate-setup:
- Substrate v0.6.0 replaced the standalone install-ate-kind.sh logic with a
thin wrapper around 'go run ./cmd/ate-setup', requiring the 'deploy ate-system'
subcommand, explicit '--credential-provider', '--ateapi-authz-bootstrap-owners'
(to authorize ax-server's ServiceAccount alongside ate-client), and
'--ingress-allowed-spiffe-ids' (to permit ax-server's SPIFFE ID at the
Envoy router).
- Update hack/setup-e2e-kind.sh to pass the new ate-setup flags and raise
fs.inotify.max_user_instances on the Kind node.
Signed-off-by: siyuanfoundation <[email protected]>
2103b1a to
6918fdb
Compare
mayawang
left a comment
There was a problem hiding this comment.
Thanks @siyuanfoundation, big upgrade and tests pass on main including e2e. Approving. Two notes for follow-ups: tasks without limits now get 1 CPU / 512 MiB by default, which is worth documenting (and maybe configurable, since active coding agents can need more); and with SandboxConfig gone, choosing gVisor vs microVM now only works through the worker selector, so #344 and #368 become the same piece of work.
…ne integration (google#517) Upgrade agent-substrate from v0.5.0 to v0.6.0 and adapt AX's Substrate client, controller, CLI, manifests, and E2E harness to the breaking changes introduced in Substrate v0.6.0: 1. Module path rename (github.com/agent-substrate/substrate -> go.ate.dev/substrate): - Substrate v0.6.0 moved its canonical Go module path to go.ate.dev/substrate and dropped pkg/sandboxclass. - Update go.mod, go.sum, and all ateapipb imports across internal/substrate, internal/controller, and test/e2e. 2. ActorTemplate resource requirements and proto removals: - Substrate v0.6.0 replaced the repeated ResourceLimit slice on ActorTemplate with ResourceRequirements{Limits: Resources{CpuMillicores, MemoryBytes}} and enforces in ate-api-server validation that every ActorTemplate sets both non-zero cpu_millicores and memory_bytes. It also removed ActorTemplate.SandboxConfig and DeleteActorRequest.AnyState. - Add v1alpha1.ParseCPUMillicores and v1alpha1.ParseMemoryBytes to convert Kubernetes resource quantity strings to int64 millicores and bytes. - Update substrate.ResourceLimits, BuildActorTemplate, and EnsureActorTemplateWithImage to populate *ateapipb.ResourceRequirements, defaulting unset CPU/memory dimensions to DefaultCPUMillicores (1000m) and DefaultMemoryBytes (512Mi). 3. Worker binary rename (cmd/ateom-gvisor -> cmd/ateworker-gvisor): - Substrate v0.6.0 renamed the gVisor worker entrypoint from cmd/ateom-gvisor to cmd/ateworker-gvisor. - Update test/e2e/manifests/workerpool.yaml to use ko://go.ate.dev/substrate/cmd/ateworker-gvisor. 4. Dataplane (atenet-router) mandatory mTLS on port 443: - Substrate v0.6.0 removed plaintext port 80 from atenet-router and now serves ingress exclusively over mTLS on port 443 using certificates signed by servicedns.podcert.ate.dev/identity (server) and podidentity.podcert.ate.dev/identity (client SPIFFE ID). - Mount the podidentity.podcert.ate.dev/identity projected volume into ax-server (deploy/ax-server.yaml and test/e2e/manifests/ax-server.yaml), configure ATENET_ROUTER_ADDR to https://atenet-router.ate-system.svc.cluster.local:443, and update the task reconciler's readiness probe client to present the podidentity client certificate and verify the servicedns trust bundle. - Add guest.DialTargetTLS and tunnel.RouterTLSConfig (which loads the live servicedns ClusterTrustBundle and issues/caches a short-lived PodCertificateRequest for ax-server) so 'ax ssh' connects to svc/atenet-router:443 over mTLS. 5. E2E setup CLI migration to cmd/ate-setup: - Substrate v0.6.0 replaced the standalone install-ate-kind.sh logic with a thin wrapper around 'go run ./cmd/ate-setup', requiring the 'deploy ate-system' subcommand, explicit '--credential-provider', '--ateapi-authz-bootstrap-owners' (to authorize ax-server's ServiceAccount alongside ate-client), and '--ingress-allowed-spiffe-ids' (to permit ax-server's SPIFFE ID at the Envoy router). - Update hack/setup-e2e-kind.sh to pass the new ate-setup flags and raise fs.inotify.max_user_instances on the Kind node. Signed-off-by: siyuanfoundation <[email protected]>
Substrate v0.6.0 requires every ActorTemplate to specify non-zero CPU and memory limits (google#517). Update the 'Sizing the sandbox' section in docs/manifests.md and the ValidateResources doc comment in pkg/apis/v1alpha1/resources.go to reflect that omitted CPU and memory limits default to 1 CPU (1000m) and 512Mi memory. Signed-off-by: siyuanfoundation <[email protected]>
Substrate v0.6.0 requires every ActorTemplate to specify non-zero CPU and memory limits (#517). Update the 'Sizing the sandbox' section in docs/manifests.md and the ValidateResources doc comment in pkg/apis/v1alpha1/resources.go to reflect that omitted CPU and memory limits default to 1 CPU (1000m) and 512Mi memory. Signed-off-by: siyuanfoundation <[email protected]>
Summary
Upgrades
agent-substratefromv0.5.0tov0.6.0(go.ate.dev/substrate v0.6.0) and updates AX's Substrate client, controller, CLI, deployment manifests, and E2E suite for the breaking changes inv0.6.0.Why Substrate v0.6.0 Mandates These Changes
Canonical module path rename (
github.com/agent-substrate/substrate->go.ate.dev/substrate)v0.6.0moved its module path togo.ate.dev/substrateand removedpkg/sandboxclass.go.mod,go.sum, and allateapipbimports acrossinternal/substrate,internal/controller, andtest/e2e.ActorTemplateresource schema and removed proto fieldsv0.6.0replacedrepeated ResourceLimitonActorTemplatewithResourceRequirements{Limits: Resources{CpuMillicores: int64, MemoryBytes: int64}}, addedate-api-servervalidation requiring bothcpu_millicores != 0andmemory_bytes != 0on everyActorTemplate, and removedActorTemplate.SandboxConfigandDeleteActorRequest.AnyState.v1alpha1.ParseCPUMillicoresandv1alpha1.ParseMemoryBytes, updatedsubstrate.ResourceLimits,BuildActorTemplate, andEnsureActorTemplateWithImageto populate*ateapipb.ResourceRequirements(defaulting unset dimensions toDefaultCPUMillicores = 1000andDefaultMemoryBytes = 512 << 20), and removed obsolete field references.Worker binary rename (
cmd/ateom-gvisor->cmd/ateworker-gvisor)v0.6.0renamed the gVisor worker binary entrypoint fromcmd/ateom-gvisortocmd/ateworker-gvisor.test/e2e/manifests/workerpool.yamltoko://go.ate.dev/substrate/cmd/ateworker-gvisor.Dataplane (
atenet-router) mandatory mTLS on port443v0.6.0removed plaintext port80fromatenet-routerand now serves ingress exclusively over mTLS on port443, verifying client SPIFFE certificates issued bypodidentity.podcert.ate.dev/identityand presenting server certificates issued byservicedns.podcert.ate.dev/identity.podidentity.podcert.ate.dev/identityprojected volume intoax-server(deploy/ax-server.yamlandtest/e2e/manifests/ax-server.yaml), updatedATENET_ROUTER_ADDRtohttps://atenet-router.ate-system.svc.cluster.local:443, and configured the task reconciler's readiness probe HTTP client (newProbeHTTPClient) to present thepodidentityclient certificate and trust theservicednsCA bundle.guest.DialTargetTLSandtunnel.RouterTLSConfig(which loads the liveservicednsClusterTrustBundleand issues/caches a short-livedPodCertificateRequestforax-server) soax sshconnects tosvc/atenet-router:443over mTLS.E2E installer migration to
cmd/ate-setupv0.6.0replaced the standaloneinstall-ate-kind.shimplementation with a wrapper aroundgo run ./cmd/ate-setup, requiring thedeploy ate-systemsubcommand,--credential-provider,--ateapi-authz-bootstrap-owners, and--ingress-allowed-spiffe-ids.hack/setup-e2e-kind.shto pass the newate-setupflags and ensurefs.inotify.max_user_instancesis sufficient on the Kind node.Verification
go test ./...passes across all packages../hack/run-e2e-kind.shpasses all 8 E2E tests against Substratev0.6.0.