Skip to content

Commit 8d5901e

Browse files
jopemachineclaude
andcommitted
feat(BA-6054): expose subpath on v2 REST/GraphQL session MountItemInput
Follow-up to BA-6040 (#11608). Add `subpath` to the v2 `MountItemInput` DTO so v2 REST and GraphQL session-creation callers can mount a vfolder subpath via `EnqueueSessionInput.mounts`. Propagate the field through the session adapter and the kernel execution spec adapter to `MountInfoEntry`, and regenerate the v2/supergraph GraphQL schemas. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent de5cae7 commit 8d5901e

6 files changed

Lines changed: 20 additions & 0 deletions

File tree

docs/manager/graphql-reference/supergraph.graphql

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17112,6 +17112,9 @@ input SessionMountItemInput
1711217112

1711317113
"""Mount permission ('rw' or 'ro')."""
1711417114
permission: String = null
17115+
17116+
"""Subpath within the vfolder to mount. Null mounts the vfolder root."""
17117+
subpath: String = null
1711517118
}
1711617119

1711717120
"""Added in 25.13.0."""

docs/manager/graphql-reference/v2-schema.graphql

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11636,6 +11636,9 @@ input SessionMountItemInput {
1163611636

1163711637
"""Mount permission ('rw' or 'ro')."""
1163811638
permission: String = null
11639+
11640+
"""Subpath within the vfolder to mount. Null mounts the vfolder root."""
11641+
subpath: String = null
1163911642
}
1164011643

1164111644
"""Added in 26.4.2. Additional resource options for session creation."""

src/ai/backend/common/dto/manager/v2/session/request.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,14 @@ class MountItemInput(BaseRequestModel):
261261
permission: str | None = Field(
262262
default=None, description="Mount permission override ('rw' or 'ro')."
263263
)
264+
subpath: str | None = Field(
265+
default=None,
266+
min_length=1,
267+
description=(
268+
"Subpath within the vfolder to mount. Omit (null) to mount the vfolder root."
269+
" Empty string is rejected."
270+
),
271+
)
264272

265273

266274
class BatchConfigInput(BaseRequestModel):

src/ai/backend/manager/api/adapter_options/session/options.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,7 @@ def _mount_items_to_entries(items: Sequence[MountItemInput]) -> list[MountInfoEn
200200
vfolder_id=VFolderUUID(item.vfolder_id),
201201
mount_destination=item.mount_path,
202202
mount_perm=perm or MountPermission.READ_WRITE,
203+
subpath=item.subpath,
203204
)
204205
)
205206
return result

src/ai/backend/manager/api/adapters/session/adapter.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,7 @@ async def enqueue(
251251
vfolder_id=VFolderUUID(m.vfolder_id),
252252
mount_destination=m.mount_path,
253253
mount_perm=(MountPermission(m.permission) if m.permission else None),
254+
subpath=m.subpath,
254255
)
255256
for m in input.mounts
256257
]

src/ai/backend/manager/api/gql/session/types.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -533,6 +533,10 @@ class SessionMountItemInputGQL(PydanticInputMixin[MountItemInputDTO]):
533533
vfolder_id: ID = gql_field(description="Virtual folder UUID.")
534534
mount_path: str | None = gql_field(default=None, description="Custom mount path.")
535535
permission: str | None = gql_field(default=None, description="Mount permission ('rw' or 'ro').")
536+
subpath: str | None = gql_field(
537+
default=None,
538+
description="Subpath within the vfolder to mount. Null mounts the vfolder root.",
539+
)
536540

537541

538542
@gql_pydantic_input(

0 commit comments

Comments
 (0)