feat(BA-2820, BA-2821): Implement API layer of model deployment#6394
Conversation
…created in middleware
There was a problem hiding this comment.
Pull Request Overview
This PR implements the API layer for model deployment functionality, introducing GraphQL endpoints and service methods for managing model deployments, revisions, replicas, and auto-scaling rules. The implementation includes:
- Service layer methods for deployment lifecycle operations (create, update, destroy, batch operations)
- GraphQL API definitions for model deployments, revisions, replicas, and auto-scaling rules
- Data loader registry for efficient batch loading of related entities
- Exception classes for model deployment domain errors
Reviewed Changes
Copilot reviewed 61 out of 66 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
src/ai/backend/manager/services/deployment/service.py |
Implements service layer methods with mock data returns for deployment operations |
src/ai/backend/manager/services/deployment/processors.py |
Defines processors and protocol for handling deployment actions |
src/ai/backend/manager/api/gql/model_deployment/*.py |
GraphQL type definitions and resolvers for deployments, revisions, replicas |
src/ai/backend/manager/api/gql/base.py |
Helper utilities for pagination, global IDs, and JSON serialization |
src/ai/backend/manager/api/gql/data_loader/registry.py |
DataLoader registry for batch loading entities |
src/ai/backend/manager/data/deployment/*.py |
Data types, creators, and modifiers for deployment entities |
src/ai/backend/common/exception.py |
New exception classes for model deployment errors |
docs/manager/graphql-reference/*.graphql |
Updated GraphQL schema documentation |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| """ | ||
| All available GraphQL queries. | ||
| Type name changed from 'Queries' to 'Query' in 25.13.0 | ||
| Type name changed from 'Queries' to 'Query' in 25.15.0 |
There was a problem hiding this comment.
The version number mentioned (25.15.0) appears inconsistent with other version numbers in the PR which reference 25.16.0. This should likely be 25.15.0 if it refers to a previous change, or be updated to match the current PR's version.
| Type name changed from 'Queries' to 'Query' in 25.15.0 | |
| Type name changed from 'Queries' to 'Query' in 25.16.0 |
| @classmethod | ||
| def from_dataclass(cls, data: ExtraVFolderMountData) -> "ExtraVFolderMount": | ||
| return cls( | ||
| # TODO: fix id generation logic |
Check notice
Code scanning / devskim
A "TODO" or similar was left in source code, possibly indicating incomplete functionality Note
| ) | ||
| active_revision_id: OptionalState[UUID] = field( | ||
| default_factory=OptionalState[UUID].nop | ||
| ) # TODO: Check if TriState is more appropriate |
Check notice
Code scanning / devskim
A "TODO" or similar was left in source code, possibly indicating incomplete functionality Note
| ), | ||
| network_access=DeploymentNetworkSpec( | ||
| open_to_public=True, | ||
| url="http://example.com", |
Check warning
Code scanning / devskim
An HTTP-based URL without TLS was detected. Warning
| ), | ||
| network_access=DeploymentNetworkSpec( | ||
| open_to_public=True, | ||
| url="http://example.com", |
Check warning
Code scanning / devskim
An HTTP-based URL without TLS was detected. Warning
| ), | ||
| network_access=DeploymentNetworkSpec( | ||
| open_to_public=True, | ||
| url="http://example.com", |
Check warning
Code scanning / devskim
An HTTP-based URL without TLS was detected. Warning
Resolve #6396 #6397 (BA-2820, BA-2821)
Following of #5754 and #5672
The work from #5752 and #5672 was lost during the merge with #5548 due to a force push, so I am creating and submitting a new PR
Checklist: (if applicable)
ai.backend.testdocsdirectory📚 Documentation preview 📚: https://sorna--6394.org.readthedocs.build/en/6394/
📚 Documentation preview 📚: https://sorna-ko--6394.org.readthedocs.build/ko/6394/