Skip to content

Enable CSI based external volumes for agents - #552

Open
hajiler wants to merge 6 commits into
agent-substrate:mainfrom
hajiler:external-volumes-for-agent-branch
Open

Enable CSI based external volumes for agents#552
hajiler wants to merge 6 commits into
agent-substrate:mainfrom
hajiler:external-volumes-for-agent-branch

Conversation

@hajiler

@hajiler hajiler commented Jul 27, 2026

Copy link
Copy Markdown

#232

Integrate the with the volume interface created in #405, to enable CSI managed external volumes throughout the agent lifecycle.

  • [ X] Tests pass
  • Appropriate changes to documentation are included in the PR

@hajiler
hajiler force-pushed the external-volumes-for-agent-branch branch 5 times, most recently from 1f35e1d to c447f89 Compare July 29, 2026 00:06
@hajiler
hajiler force-pushed the external-volumes-for-agent-branch branch from c447f89 to f07fb92 Compare July 29, 2026 00:29
@hajiler
hajiler marked this pull request as ready for review July 29, 2026 00:31

@msau42 Michelle Au (msau42) left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a way to squash the dynamic plugin registration commit with the earlier commits that used a binary flag? It would probably be less confusing for other reviewers that go commit by commit because the binary flag changes get completely replaced later on.

Also in the PR description can you provide a high level summary of the driver registration approach?

Comment thread pkg/csi/client.go
@@ -0,0 +1,58 @@
// Copyright 2026 Google LLC

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Put these under internal/volumes since we don't expect consumers of substrate to need this.

Comment thread pkg/csi/plugin.go

resp, err := p.client.ControllerPublishVolume(ctx, req)
if err != nil {
if status.Code(err) == codes.Unimplemented {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a followup item to determine this ahead of time by querying the csi driver's controller capabilities. The log message will be very spammy. Same thing with all the volume operations

Comment thread pkg/csi/plugin.go
return fmt.Errorf("CSI ControllerPublishVolume failed: %w", err)
}

// NOTE: CSI ControllerPublishVolume returns PublishContext (metadata needed for mounting).

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a followup item for it

Comment thread pkg/csi/plugin.go
}

// Helper to provide standard capabilities for general volume operations.
func getStandardCapabilities() []*csi.VolumeCapability {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add followup item that we may need to expose access modes

if err := s.volumePlugin.DeleteVolume(ctx, vol.GetStorageVolumeId()); err != nil {
plugin, ok := s.volumePlugins[vol.GetVolumeType()]
if !ok {
slog.ErrorContext(ctx, "No volume plugin found for type during cleanup", slog.String("volume_type", vol.GetVolumeType()), slog.String("volume_id", vol.GetStorageVolumeId()))

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should be a blocking error otherwise we will leak disks

ControllerEndpoint string `json:"controllerEndpoint"`

// NodeSocketOverride is an optional override for the CSI Node service socket
// on the worker nodes. If empty, ATE defaults to the standard path.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the standard path?


# Define paths
DRIVER_DIR="${ROOT}/bin/csi-driver-host-path"
DEPLOY_DIR="${DRIVER_DIR}/deploy/kubernetes-1.27"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a very old version of hostpath driver

@@ -0,0 +1,121 @@
# Copyright 2026 Google LLC

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add "-kind" suffix since this looks specific to kind clusters

capabilities:
drop:
- ALL
privileged: true

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What needs this?

@@ -0,0 +1,92 @@
# Copyright 2026 Google LLC

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The manifests are not strictly for e2e testing, so I would move them to the driver registration commit

@@ -0,0 +1,121 @@
# Copyright 2026 Google LLC

@msau42 Michelle Au (msau42) Jul 29, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to invoke these scripts as part of install-ate-kind.sh? Maybe optional?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants