lablup / lablup/backend.ai

Expose per-mount subpath/alias/permission on the legacy ComputeSession GraphQL node

Open
#11,964 0 comments 0 reactions 0 assignees View on GitHub
comp:manager type:enhance
Dominant language
Python
Stars
670
Forks
183
Avg merge
15h 13m
Merged PRs (30d)
368

Description

Part of the per-mount metadata epic: #11962

## Goal

Surface per-mount **subpath**, **alias** (mount destination), and **permission** on the legacy Graphene `ComputeSession` / `ComputeSessionNode` so the current WebUI (still on the legacy schema) can render it without waiting for the SessionV2 migration.

## Context

Today the legacy schema only exposes:
- `mounts` → vfolder names (`gql_legacy/session.py:1022`)
- `vfolder_mounts` → vfolder UUIDs (`:1023`, `:249`)
- `vfolder_nodes` connection → the vfolder **entity**, dropping per-mount fields (resolver `:471`)

The full `VFolderMount` objects (with `vfsubpath`, `kernel_path`, `mount_perm`) are on `SessionRow.vfolder_mounts` / `row.vfolders_sorted_by_id`, available where the resolvers already run.

## Changes

1. Add a new field on `ComputeSession` (and `ComputeSessionNode`), e.g. `vfolder_mount_infos`, returning a `graphene.List` of a new `VFolderMountInfo` Graphene `ObjectType` with: `vfolder_id`, `name`, `subpath` (`"."` → `null`), `mount_destination` (from `kernel_path`), `permission` (from `mount_perm`), `usage_mode`.
- Populate directly from `row.vfolders_sorted_by_id` (already a `list[VFolderMount]`) in `from_row` / `from_dataclass` (`:335`, `:391`) — same source the existing `mounts`/`vfolder_mounts` fields use.
- Add `description="Added in ."` per legacy convention.
2. Keep existing `mounts` / `vfolder_mounts` fields unchanged for backward compatibility.
3. Run `scripts/generate-graphql-schema.sh` to refresh the schema.

## Notes

- This is a deliberate, scoped exception to the v2-first rule, justified by the UI still consuming the legacy schema. Do not expand the legacy surface beyond these read-only mount fields.
- Pairs with #11936 (same vfolder mounted at multiple subpaths) — per-mount rows are required to disambiguate duplicate vfolder entries.

## Verification

Query `compute_session_nodes { vfolder_mount_infos { vfolder_id name subpath mount_destination permission usage_mode } }` against a session created with explicit subpath + custom mount path.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.