lablup / lablup/backend.ai

Add active resource overview API for domains and projects

Open
#9,727 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
670
Forks
183
Avg merge
15h 13m
Merged PRs (30d)
368

Description

Add API endpoints (GraphQL + REST) to query real-time aggregated resource allocation for active sessions, scoped by domain or project.

Currently DomainV2GQL / ProjectV2GQL only expose fair_share (scheduling priority) and usage_buckets (historical usage). There is no API to query the current total occupied resources across active sessions within a domain or project.

The scheduler internally aggregates this via ResourceOccupancySnapshot, but it is scoped to scaling_group and not exposed externally.

With the resource_allocations normalization (BEP-1047, BA-4308), efficient SQL-level SUM + GROUP BY aggregation is now possible.

This Epic covers:
- Repository/Service layer for SQL aggregation
- GraphQL resolver fields on DomainV2 / ProjectV2
- REST API endpoints
- Usage ratio calculation against total_resource_slots

JIRA Issue: BA-4914

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.