Skip to content

feat: persist volume path to database and pass through gRPC#2297

Draft
joe-lombrozo-s-bot[bot] wants to merge 2 commits intomainfrom
joe/volume-path-persistence
Draft

feat: persist volume path to database and pass through gRPC#2297
joe-lombrozo-s-bot[bot] wants to merge 2 commits intomainfrom
joe/volume-path-persistence

Conversation

@joe-lombrozo-s-bot
Copy link
Copy Markdown
Contributor

Persists the volume filesystem path so the orchestrator doesn't need to recompute it from volume type + team ID + volume ID on every operation.

Changes

Database:

  • New migration adds nullable volume_path column to volumes table
  • CreateVolume accepts optional path, UpdateVolumePath added for post-creation update

Proto:

  • VolumeInfo: optional string volume_path = 4
  • CreateVolumeResponse: string volume_path = 1 (orchestrator returns computed path)
  • SandboxVolumeMount: optional string volume_path = 5

Orchestrator:

  • CreateVolume returns the computed full path in the response
  • getVolumeRootPath / getFilesystemAndPath use persisted path when present, fall back to BuildVolumePath when empty
  • NFS handler: same fallback — ChrootPath when path is set, Chroot (type-based lookup) otherwise
  • New Builder.ChrootPath() method for direct path chroot

API:

  • volume_create.go: stores orchestrator-returned path via UpdateVolumePath within the same transaction
  • volume_token.go: adds volpath JWT claim (when path is set)
  • volume_util.go: passes path through toVolumeKey
  • sandbox_create.go: passes volume path to sandbox mount config
  • sandbox_resume.go: passes volume path from snapshot config
  • nodemanager/sandboxes.go: persists volume path in snapshot mount config

Backwards compatible: existing volumes without volume_path continue working via the legacy path computation. All new fields are optional/nullable.

Adds volume_path persistence throughout the stack so the orchestrator
no longer needs to recompute filesystem paths for volumes.

Changes:
- DB: add nullable volume_path column to volumes table
- Proto: add optional volume_path to VolumeInfo, SandboxVolumeMount,
  and CreateVolumeResponse
- Orchestrator: CreateVolume returns the computed path; getVolumeRootPath
  and getFilesystemAndPath use persisted path when available, falling
  back to BuildVolumePath for existing volumes without a path
- NFS handler: same fallback pattern for chroot resolution
- API: store orchestrator-returned path in DB after creation, include
  in JWT (volpath claim), pass through to sandbox mounts and resume
- Types: add VolumePath to SandboxVolumeMountConfig for snapshot
  persistence

Fully backwards-compatible: existing volumes without volume_path
continue to work via the legacy path computation.
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