Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
e96a7a3
feat(BA-4904): add GraphQL ResourceSlotType node with root queries an…
HyeockJinKim Mar 5, 2026
4731d2f
fix(BA-4904): fix mypy return type in resolve_nodes by using cls.from…
HyeockJinKim Mar 5, 2026
65093d2
changelog: add news fragment for PR #9708
HyeockJinKim Mar 5, 2026
70b0df2
fix: let ResourceSlotTypeNotFound raise instead of silently returning…
HyeockJinKim Mar 6, 2026
fa41767
chore: update api schema dump
HyeockJinKim Mar 6, 2026
6efa2de
fix(BA-4904): change version strings from 26.4.0 to 26.3.0
HyeockJinKim Mar 6, 2026
0cec971
refactor(BA-4904): extract _row_to_slot_type_data helper in service.py
HyeockJinKim Mar 6, 2026
b9a0a58
chore: update api schema dump
HyeockJinKim Mar 6, 2026
1e9310a
refactor(BA-4904): replace AllSlotTypesAction with search pattern for…
HyeockJinKim Mar 6, 2026
bef273c
chore: update api schema dump
HyeockJinKim Mar 6, 2026
24a5c7c
feat(BA-4904): use search actions with pagination for agent/kernel re…
HyeockJinKim Mar 6, 2026
3666865
feat(BA-4904): add slot-specific actions to avoid full-list fetch + l…
HyeockJinKim Mar 6, 2026
60a2e6a
feat(BA-4904): honor required flag in resolve_nodes and propagate exc…
HyeockJinKim Mar 6, 2026
14ad692
fix(BA-4904): address remaining PR review feedback
HyeockJinKim Mar 6, 2026
2100a2a
chore: update api schema dump
HyeockJinKim Mar 6, 2026
610321d
Add filter/order support for AgentResourceSlot and KernelResourceAllo…
HyeockJinKim Mar 6, 2026
7ffe35e
chore: update api schema dump
HyeockJinKim Mar 6, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changes/9708.feature.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add GraphQL ResourceSlotTypeGQL node with root queries (resource_slot_type, resource_slot_types) and relay connections on AgentV2GQL (resource_slots) and KernelV2GQL (resource_allocations).
268 changes: 268 additions & 0 deletions docs/manager/graphql-reference/supergraph.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,76 @@ type AgentResource
free: JSON!
}

"""Added in 26.3.0. Relay-style connection for per-slot agent resources."""
type AgentResourceConnection
@join__type(graph: STRAWBERRY)
{
"""Pagination data for this connection"""
pageInfo: PageInfo!

"""Contains the nodes in this connection"""
edges: [AgentResourceSlotEdge!]!
count: Int!
}

"""
Added in 26.3.0. Per-slot resource capacity and usage entry for an agent.
Represents one row from the agent_resources table.
"""
type AgentResourceSlot implements Node
@join__implements(graph: STRAWBERRY, interface: "Node")
@join__type(graph: STRAWBERRY)
{
"""The Globally Unique ID of this object"""
id: ID!

"""Resource slot identifier (e.g., 'cpu', 'mem', 'cuda.device')."""
slotName: String!

"""Total hardware resource capacity for this slot on the agent."""
capacity: Decimal!

"""
Amount of this slot currently consumed by running and scheduled sessions.
"""
used: Decimal!
}

"""An edge in a connection."""
type AgentResourceSlotEdge
@join__type(graph: STRAWBERRY)
{
"""A cursor for use in pagination"""
cursor: String!

"""The item at the end of the edge"""
node: AgentResourceSlot!
}

"""Added in 26.3.0. Filter criteria for querying agent resource slots."""
input AgentResourceSlotFilter
@join__type(graph: STRAWBERRY)
{
slotName: StringFilter = null
}

"""Added in 26.3.0. Ordering specification for agent resource slots."""
input AgentResourceSlotOrderBy
@join__type(graph: STRAWBERRY)
{
field: AgentResourceSlotOrderField!
direction: OrderDirection! = ASC
}

"""Added in 26.3.0. Fields available for ordering agent resource slots."""
enum AgentResourceSlotOrderField
@join__type(graph: STRAWBERRY)
{
SLOT_NAME @join__enumValue(graph: STRAWBERRY)
CAPACITY @join__enumValue(graph: STRAWBERRY)
USED @join__enumValue(graph: STRAWBERRY)
}

"""Added in 25.15.0"""
type AgentStats
@join__type(graph: STRAWBERRY)
Expand Down Expand Up @@ -525,6 +595,9 @@ type AgentV2 implements Node
Added in 26.3.0. List of sessions running on this agent with pagination support.
"""
sessions(filter: SessionV2Filter = null, orderBy: [SessionV2OrderBy!] = null, before: String = null, after: String = null, first: Int = null, last: Int = null, limit: Int = null, offset: Int = null): SessionV2Connection!

"""Added in 26.3.0. Per-slot resource capacity and usage for this agent."""
resourceSlots(filter: AgentResourceSlotFilter = null, orderBy: [AgentResourceSlotOrderBy!] = null, first: Int = null, after: String = null, last: Int = null, before: String = null, limit: Int = null, offset: Int = null): AgentResourceConnection!
}

"""
Expand Down Expand Up @@ -5443,6 +5516,68 @@ type KernelNode implements Node
preopen_ports: [Int]
}

"""
Added in 26.3.0. Per-slot resource allocation entry for a kernel.
Represents one row from the resource_allocations table.
"""
type KernelResourceAllocation implements Node
@join__implements(graph: STRAWBERRY, interface: "Node")
@join__type(graph: STRAWBERRY)
{
"""The Globally Unique ID of this object"""
id: ID!

"""Resource slot identifier (e.g., 'cpu', 'mem', 'cuda.device')."""
slotName: String!

"""Amount of this resource slot originally requested for the kernel."""
requested: Decimal!

"""Amount currently used. May be null if not yet measured."""
used: Decimal
}

"""An edge in a connection."""
type KernelResourceAllocationEdge
@join__type(graph: STRAWBERRY)
{
"""A cursor for use in pagination"""
cursor: String!

"""The item at the end of the edge"""
node: KernelResourceAllocation!
}

"""
Added in 26.3.0. Filter criteria for querying kernel resource allocations.
"""
input KernelResourceAllocationFilter
@join__type(graph: STRAWBERRY)
{
slotName: StringFilter = null
}

"""
Added in 26.3.0. Ordering specification for kernel resource allocations.
"""
input KernelResourceAllocationOrderBy
@join__type(graph: STRAWBERRY)
{
field: KernelResourceAllocationOrderField!
direction: OrderDirection! = ASC
}

"""
Added in 26.3.0. Fields available for ordering kernel resource allocations.
"""
enum KernelResourceAllocationOrderField
@join__type(graph: STRAWBERRY)
{
SLOT_NAME @join__enumValue(graph: STRAWBERRY)
REQUESTED @join__enumValue(graph: STRAWBERRY)
USED @join__enumValue(graph: STRAWBERRY)
}

"""
Added in 26.2.0. Represents a kernel (compute container) in Backend.AI.
"""
Expand Down Expand Up @@ -5491,6 +5626,9 @@ type KernelV2 implements Node

"""Added in 26.3.0. The session this kernel belongs to."""
session: SessionV2

"""Added in 26.3.0. Per-slot resource allocation for this kernel."""
resourceAllocations(filter: KernelResourceAllocationFilter = null, orderBy: [KernelResourceAllocationOrderBy!] = null, first: Int = null, after: String = null, last: Int = null, before: String = null, limit: Int = null, offset: Int = null): ResourceAllocationConnection!
}

"""
Expand Down Expand Up @@ -7740,6 +7878,21 @@ enum NotificationRuleType
ENDPOINT_LIFECYCLE_CHANGED @join__enumValue(graph: STRAWBERRY)
}

"""
Added in 26.3.0. Display number format configuration for a resource slot type.
"""
type NumberFormat
@join__type(graph: STRAWBERRY)
{
"""
Whether to use binary (1024-based) prefix instead of decimal (1000-based).
"""
binary: Boolean!

"""Number of decimal places to display."""
roundLength: Int!
}

"""Added in 25.14.0"""
type ObjectStorage implements Node
@join__implements(graph: STRAWBERRY, interface: "Node")
Expand Down Expand Up @@ -9329,6 +9482,16 @@ type Query
"""
adminSessionsV2(filter: SessionV2Filter = null, orderBy: [SessionV2OrderBy!] = null, before: String = null, after: String = null, first: Int = null, last: Int = null, limit: Int = null, offset: Int = null): SessionV2Connection! @join__field(graph: STRAWBERRY)

"""
Added in 26.3.0. Returns a single resource slot type by slot_name, or null.
"""
resourceSlotType(slotName: String!): ResourceSlotType @join__field(graph: STRAWBERRY)

"""
Added in 26.3.0. Returns resource slot types with pagination and filtering.
"""
resourceSlotTypes(filter: ResourceSlotTypeFilter = null, orderBy: [ResourceSlotTypeOrderBy!] = null, before: String = null, after: String = null, first: Int = null, last: Int = null, limit: Int = null, offset: Int = null): ResourceSlotTypeConnection! @join__field(graph: STRAWBERRY)

"""
Added in 26.2.0.

Expand Down Expand Up @@ -9829,6 +9992,20 @@ type ResourceAllocation
used: ResourceSlot
}

"""
Added in 26.3.0. Relay-style connection for per-slot kernel resource allocations.
"""
type ResourceAllocationConnection
@join__type(graph: STRAWBERRY)
{
"""Pagination data for this connection"""
pageInfo: PageInfo!

"""Contains the nodes in this connection"""
edges: [KernelResourceAllocationEdge!]!
count: Int!
}

type ResourceConfig
@join__type(graph: STRAWBERRY)
{
Expand Down Expand Up @@ -10185,6 +10362,97 @@ input ResourceSlotInput
entries: [ResourceSlotEntryInput!]!
}

"""
Added in 26.3.0. A registered resource slot type describing display metadata
and formatting rules for a specific resource (e.g., cpu, mem, cuda.device).
"""
type ResourceSlotType implements Node
@join__implements(graph: STRAWBERRY, interface: "Node")
@join__type(graph: STRAWBERRY)
{
"""The Globally Unique ID of this object"""
id: ID!

"""
Unique identifier for the resource slot (e.g., 'cpu', 'mem', 'cuda.device').
"""
slotName: String!

"""Category of the slot type (e.g., 'count', 'bytes', 'unique-count')."""
slotType: String!

"""Human-readable name for display in UIs."""
displayName: String!

"""Longer description of what this resource slot represents."""
description: String!

"""
Unit label used when displaying resource amounts (e.g., 'GiB', 'cores').
"""
displayUnit: String!

"""Icon identifier for UI rendering (e.g., 'cpu', 'memory', 'gpu')."""
displayIcon: String!

"""Number formatting rules (binary vs decimal prefix, rounding)."""
numberFormat: NumberFormat!

"""Display ordering rank. Lower values appear first."""
rank: Int!
}

"""
Added in 26.3.0. Relay-style connection for paginated resource slot types.
"""
type ResourceSlotTypeConnection
@join__type(graph: STRAWBERRY)
{
"""Pagination data for this connection"""
pageInfo: PageInfo!

"""Contains the nodes in this connection"""
edges: [ResourceSlotTypeEdge!]!
count: Int!
}

"""An edge in a connection."""
type ResourceSlotTypeEdge
@join__type(graph: STRAWBERRY)
{
"""A cursor for use in pagination"""
cursor: String!

"""The item at the end of the edge"""
node: ResourceSlotType!
}

"""Added in 26.3.0. Filter criteria for querying resource slot types."""
input ResourceSlotTypeFilter
@join__type(graph: STRAWBERRY)
{
slotName: StringFilter = null
slotType: StringFilter = null
displayName: StringFilter = null
}

"""Added in 26.3.0. Ordering specification for resource slot types."""
input ResourceSlotTypeOrderBy
@join__type(graph: STRAWBERRY)
{
field: ResourceSlotTypeOrderField!
direction: OrderDirection! = ASC
}

"""Added in 26.3.0. Fields available for ordering resource slot types."""
enum ResourceSlotTypeOrderField
@join__type(graph: STRAWBERRY)
{
SLOT_NAME @join__enumValue(graph: STRAWBERRY)
RANK @join__enumValue(graph: STRAWBERRY)
DISPLAY_NAME @join__enumValue(graph: STRAWBERRY)
}

"""
Added in 26.2.0. Resource weight with default indicator. Shows whether this resource type's weight was explicitly set or uses default.
"""
Expand Down
Loading
Loading