Repository navigation
Conversation
d0add72 to
5efe3c9
Compare
There was a problem hiding this comment.
Claude Review: Reviewed with a focus on the object shape and how it holds up against the later changes in the series (template reference, actor references on the volume, delete trigger). The handler, store, authz and CLI code follow the Tag precedent closely and read fine.
c1365a3 to
5d9d73e
Compare
Alexis MacAskill (amacaskill)
left a comment
There was a problem hiding this comment.
Note on syncing the Shared External Volumes design doc:
This PR is up to date on volume_type, volumes[].external.template (in docs/guides/csi-volumes.md), --volume-context / --preview, and DeleteExternalVolume leaving underlying storage intact, and you noted on ateapi.proto that the ExternalVolumeStatus / storage_volume_id alignment will be handled in the follow-up PR. However, the Shared External Volumes design doc is still outdated on these — could you update the design doc when you get a chance so other docs referencing it stay in sync? Specifically:
volumes[].externalnesting (from PR #2653): The design doc (Tab 1 "Changes to ActorTemplate" & Tab 2 CUJsS1,S3,C3,C4) still uses top-levelvolumes[].externalVolumeTemplateandvolumes[].externalVolumeRefinstead ofvolumes[].external.templateandvolumes[].external.ref(which you flagged on our FusionFS doc).ExternalVolumefields (from PR #3744): In Tab 1 ("New API Type: ExternalVolume"), updateDriver string→volume_type(to match this PR), and addvolume_context(map<string, string>).- CLI flags & delete behavior (from PR #3744): Add
--volume-contextand--previewto thekubectl ate create externalvolumeexamples, and update Tab 2S1(which currently says "the user deletes the ExternalVolume, which deletes the disk", whereasDeleteExternalVolumeonly removes the Substrate DB record and leaves storage in place). ExternalVolume.status&ActorStatusvolume status (for PR 2): Update theExternalVolumesketch to nest output-only fields (assigned_actorswithObjectRef actor+string actor_uid, andstate) underExternalVolume.statusper API Style Guide §8, note the rename of the existing per-actorExternalVolumeStatusmessage (storage_volume_id→volume_id) to avoid colliding withExternalVolume's status type, and reconcile.status.externalVolumes.volumes[](Tab 1) vs..status.actorVolumes[](Tab 2S3/D6).
Cross-resource references are named after the resource they point to (docs/api-style-guide.md 2.3), as agent-substrate#3744 does for its references to the same resource. Rename ExternalVolumeSource.ref to external_volume before it is served. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
5d9d73e to
c94af04
Compare
Alexis MacAskill (amacaskill)
left a comment
There was a problem hiding this comment.
LGTM! Thanks for addressing all the review comments.
Cross-resource references are named after the resource they point to (docs/api-style-guide.md 2.3), as agent-substrate#3744 does for its references to the same resource. Rename ExternalVolumeSource.ref to external_volume before it is served. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Cross-resource references are named after the resource they point to (docs/api-style-guide.md 2.3), as agent-substrate#3744 does for its references to the same resource. Rename ExternalVolumeSource.ref to external_volume before it is served. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
c94af04 to
731ccef
Compare
731ccef to
9b016b2
Compare
9b016b2 to
2b2c893
Compare
Cross-resource references are named after the resource they point to (docs/api-style-guide.md 2.3), as agent-substrate#3744 does for its references to the same resource. Rename ExternalVolumeSource.ref to external_volume before it is served. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2b2c893 to
c0a3d7b
Compare
hajiler
left a comment
There was a problem hiding this comment.
This review was produced by an AI agent (Jetski) run by the PR author.
Adversarial pass over the store, migration, authz wiring, handlers and CLI at c0a3d7b, skipping everything already raised in the earlier threads. I found no correctness or security bug. Create writes the record and its external_volume_keys row in one transaction. All four RPCs have defaultRPCPermissions entries. Get and Delete check the external_volume object and an all-atespaces List needs a global viewer. The migration only adds tables. go build, go test -race ./cmd/ateapi/... (including the Postgres-backed suites), apitool validate, proto-breaking, codegen, gofmt, go-modules and licenses all pass. Rebase onto #4021: the only non-generated mention of the old actor-side name is the comment above ValidateCustom_ExternalVolume_VolumeId (ExternalVolumeStatus.storage_volume_id, apivalidation/external_volume.go:50). It is left over from the earlier self-contained thread. After #4021 it names a message that no longer exists, and later the wrong one. The rebase also has to drop #4021's two buf.yaml ignore_only entries. There is no status field yet to type ExternalVolumeStatus. Commit message, outside the diff: "its Postgres table" should be "tables" (external_volumes and external_volume_keys). The paragraph that starts "This adds ..." lists the diff, which AGENTS.md asks not to restate. The global (driver_name, volume_id) uniqueness, the one rule beyond CRUD, is not mentioned.
c2f3b0d to
ebf8afd
Compare
ebf8afd to
93b9945
Compare
ActorStatus.external_volumes is typed ExternalVolumes, with one ExternalVolumeStatus per mounted volume. Shared volumes add an atespace-scoped ExternalVolume resource, and the API style guide requires its status field to be typed ExternalVolumeStatus. Both messages are still behind the ExternalVolumes preview gate, so rename them now to ActorExternalVolumes and ActorExternalVolumeStatus. Field names, numbers and validation tags are unchanged. ate-api-server stores actors as binary protobuf keyed by field number, and protojson writes field names, so stored data and JSON output are unaffected. What changes is the Go type names in the public api/ateapi/v1 package and the proto full names. buf breaking reports the rename as a deleted message and a retyped field. Add a temporary ignore_only entry in buf.yaml for PACKAGE_MESSAGE_NO_DELETE and FIELD_SAME_TYPE on ateapi.proto. The entry disables both rules for every message in the file, so remove it when the ExternalVolume API lands. Signed-off-by: Elijah Rodriguez <elijahrb@google.com>
ignore_only keys on the file path, so the two entries disable PACKAGE_MESSAGE_NO_DELETE and FIELD_SAME_TYPE for every message in ateapi.proto. Say so in the comment and in the preview-gates doc, and mark the entries with a TODO to remove them when the ExternalVolume API lands. Signed-off-by: Elijah Rodriguez <elijahrb@google.com>
An ExternalVolume is an atespace-scoped record of a storage volume. The server writes it: status.csi holds the CSI driver name, the volume ID and the volume context the node plugin needs to mount the volume. An atespace cannot be deleted while it holds one. This adds the resource, its Postgres tables and store methods, the OpenFGA type, the Get and List RPCs, and kubectl ate get external-volume. Both RPCs require the ExternalVolumes preview gate. external_volume_keys keeps (driver_name, volume_id) unique across atespaces. Nothing creates an ExternalVolume yet. Actor templates still provision a volume per actor from external.template. The server-side creation and an import RPC come in later changes. Signed-off-by: Elijah Rodriguez-Beltran <elijahrb@google.com>
93b9945 to
17c3a48
Compare
Part 1 of Shared Volumes #1637 (design: Substrate Shared External Volumes).
Depends on #4021, which frees the
ExternalVolumeStatusname. Until it merges, this PR also shows its two commits andhack/verify/proto-breaking.shfails. Review the last commit.An
ExternalVolumeis an atespace-scoped record of a storage volume. For now it is read-only for users, the server will create the record.status.csiis aCSIVolumeholdingdriverName,volumeIdandvolumeContext, which the node plugin needs to mount the volume.000002_external_volumes.sql;external_volumesisON DELETE RESTRICTto atespaces), store methods and contract tests.external_volume_keyskeeps(driver_name, volume_id)unique across atespaces.GetExternalVolumeandListExternalVolumes. There is no Create, Update or Delete RPC.external_volumetype. Atespace viewers get and list.kubectl ate get external-volume, docs.Nothing creates an
ExternalVolumeyet, so the functional tests cover onlyNOT_FOUND, the empty list, validation and authorization. The store keepsCreateExternalVolumeandDeleteExternalVolumefor the follow-up that writes records.CSIVolumecarries the same validation tags the fields had before, with+k8s:immutablereplaced by+k8s:update=NoModifyandNoUnset. validation-gen only generates code for types a request carries, so nothing enforces the tags yet. The two custom checks are kept asValidateCSIVolumeIDandValidateCSIVolumeContextuntil a request carries aCSIVolume.Changed since the earlier review rounds:
CreateExternalVolume,DeleteExternalVolume, the global-owner create permission, andkubectl ate {create,delete} external-volumeare removed. The fields moved from the top level tostatus.csi.Follow-ups:
ExternalVolume(ateapi: record each actor-provisioned volume as an ExternalVolume #3746). Validate storage_volume_id path containment when constructing CSI staging directories #2935 (staging path built from the raw volume ID) lands first, sincevolumeIdallows/.ImportExternalVolumeRPC to register a volume that already exists in the storage system.AI use: Claude Code drafted parts of the implementation, the rework to the read-only shape and this description; I reviewed every change.
go test -raceforcmd/ateapi/...(apivalidation, authz, store on Postgres, controlapi, the functional suite) andcmd/kubectl-ate/...; golangci-lint, gofmt, proto-fmt, boilerplate, codegen. Not run locally:apitool validate, the rest ofhack/verify-all.sh. No e2e: nothing creates the resource on a cluster yet.