Skip to content

Commit

Permalink
chore: Add requested_slots field to compute session GQL (#1984)
Browse files Browse the repository at this point in the history
  • Loading branch information
fregataa committed Apr 1, 2024
1 parent d15d070 commit 02f079a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions changes/1984.misc.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add `requested_slots` field to compute session GQL type.
3 changes: 3 additions & 0 deletions src/ai/backend/manager/api/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -523,6 +523,9 @@ type ComputeSession implements Item {
vfolder_mounts: [String]
occupying_slots: JSONString
occupied_slots: JSONString

"""Added in 24.03.0"""
requested_slots: JSONString
num_queries: BigInt
containers: [ComputeContainer]
dependencies: [ComputeSession]
Expand Down
2 changes: 2 additions & 0 deletions src/ai/backend/manager/models/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -1191,6 +1191,7 @@ class Meta:
vfolder_mounts = graphene.List(lambda: graphene.String)
occupying_slots = graphene.JSONString()
occupied_slots = graphene.JSONString() # legacy
requested_slots = graphene.JSONString(description="Added in 24.03.0")

# statistics
num_queries = BigInt()
Expand Down Expand Up @@ -1259,6 +1260,7 @@ def parse_row(cls, ctx: GraphQueryContext, row: Row) -> Mapping[str, Any]:
"service_ports": row.main_kernel.service_ports,
"mounts": [mount.name for mount in row.vfolder_mounts],
"vfolder_mounts": row.vfolder_mounts,
"requested_slots": row.requested_slots.to_json(),
# statistics
"num_queries": row.num_queries,
}
Expand Down

0 comments on commit 02f079a

Please sign in to comment.