From 919802ef820cd9dabd5a467007905d3b20bef585 Mon Sep 17 00:00:00 2001 From: Gyubong Lee Date: Tue, 12 Nov 2024 09:07:48 +0900 Subject: [PATCH] fix: Broken `ComputeContainer` GQL (#3042) Co-authored-by: Joongi Kim Backported-from: main (24.12) Backported-to: 23.09 Backport-of: 3042 --- changes/3042.fix.md | 1 + src/ai/backend/manager/models/kernel.py | 8 ++++++++ 2 files changed, 9 insertions(+) create mode 100644 changes/3042.fix.md diff --git a/changes/3042.fix.md b/changes/3042.fix.md new file mode 100644 index 0000000000..9a28b7ce51 --- /dev/null +++ b/changes/3042.fix.md @@ -0,0 +1 @@ +Fix regression of `ComputeContainer` GraphQL queries due to newly introduced relationship fields diff --git a/src/ai/backend/manager/models/kernel.py b/src/ai/backend/manager/models/kernel.py index 4901f2c8dd..2285d15c04 100644 --- a/src/ai/backend/manager/models/kernel.py +++ b/src/ai/backend/manager/models/kernel.py @@ -1022,6 +1022,14 @@ async def batch_load_detail( .where( (kernels.c.id.in_(container_ids)), ) + .options( + noload("*"), + selectinload( + KernelRow.group_row, + KernelRow.user_row, + KernelRow.image_row, + ), + ) ) if domain_name is not None: query = query.where(kernels.c.domain_name == domain_name)