Skip to content

Conversation

@jopemachine
Copy link
Member

@jopemachine jopemachine commented Oct 7, 2025

resolves #6031 (BA-2508)

Checklist: (if applicable)

  • Mention to the original issue

📚 Documentation preview 📚: https://sorna--6221.org.readthedocs.build/en/6221/


📚 Documentation preview 📚: https://sorna-ko--6221.org.readthedocs.build/ko/6221/

@github-actions github-actions bot added size:L 100~500 LoC comp:manager Related to Manager component comp:common Related to Common component labels Oct 7, 2025
@jopemachine jopemachine added this to the 25.15 milestone Oct 7, 2025
@github-actions github-actions bot added the area:docs Documentations label Oct 7, 2025
from ai.backend.manager.services.artifact_revision.actions.base import ArtifactRevisionAction


# TODO: Make this a batch action.

Check notice

Code scanning / devskim

A "TODO" or similar was left in source code, possibly indicating incomplete functionality Note

Suspicious comment
)

try:
# TODO: Improve this

Check notice

Code scanning / devskim

A "TODO" or similar was left in source code, possibly indicating incomplete functionality Note

Suspicious comment
self, artifact_type: Optional[ArtifactType], registry_id_or_none: Optional[uuid.UUID]
) -> ArtifactRegistryData:
if registry_id_or_none is None:
# TODO: Handle `artifact_type` for other types

Check notice

Code scanning / devskim

A "TODO" or similar was left in source code, possibly indicating incomplete functionality Note

Suspicious comment
@github-actions github-actions bot added size:XL 500~ LoC size:L 100~500 LoC and removed size:L 100~500 LoC size:XL 500~ LoC labels Oct 12, 2025
@jopemachine jopemachine modified the milestones: 25.15, 25.16 Oct 12, 2025
@jopemachine jopemachine changed the title feat(BA-2508): Implement artifact import delegation on remote reservoir registry (WIP) feat(BA-2508): Implement artifact import delegation on remote reservoir registry Oct 12, 2025
@jopemachine jopemachine marked this pull request as ready for review October 12, 2025 05:51
Copilot AI review requested due to automatic review settings October 12, 2025 05:51
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR implements artifact import delegation for remote reservoir registries to enable importing artifacts from remote registries through delegation.

  • Adds delegate_import_revision_batch service method with conditional delegation logic based on node type
  • Implements REST and GraphQL APIs for delegating artifact imports
  • Introduces event handling for remote artifact import completion

Reviewed Changes

Copilot reviewed 20 out of 20 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
src/ai/backend/manager/services/artifact_revision/service.py Core service implementation for delegation logic and artifact registry resolution
src/ai/backend/manager/api/gql/artifact.py GraphQL mutation implementation for delegate import
src/ai/backend/manager/api/artifact_registry.py REST API endpoint for delegation import
src/ai/backend/manager/client/artifact_registry/reservoir_client.py Client method for remote reservoir communication
src/ai/backend/manager/event_dispatcher/handlers/artifact.py Event handler for remote import completion
src/ai/backend/manager/services/artifact_revision/actions/delegate_import_revision_batch.py Action definition for batch delegation
tests/manager/services/artifact_revision/conftest.py Test configuration updates for new dependency
src/ai/backend/manager/repositories/artifact/repository.py Database method for updating remote status
src/ai/backend/manager/errors/artifact_registry.py New error classes for delegation failures
src/ai/backend/manager/dto/request.py Request model for delegation
src/ai/backend/common/events/event_types/artifact/anycast.py Event type for remote import completion

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@@ -1,3 +1,5 @@
import uuid
Copy link

Copilot AI Oct 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are redundant imports of uuid. Line 1 imports the uuid module, while line 3 imports UUID from uuid. Consider consolidating these imports or removing the redundant one.

Suggested change
import uuid

Copilot uses AI. Check for mistakes.
Comment on lines +313 to +415
# TODO: Improve this
task_ids = []
result: list[ArtifactRevisionData] = []
for revision_id in action.artifact_revision_ids:
import_result = await self.import_revision(
ImportArtifactRevisionAction(artifact_revision_id=revision_id)
)
task_ids.append(import_result.task_id)
result.append(import_result.result)
Copy link

Copilot AI Oct 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sequential processing of revision imports could be inefficient for large batches. Consider using asyncio.gather() or similar concurrency patterns to process imports in parallel.

Copilot uses AI. Check for mistakes.
self, artifact_type: Optional[ArtifactType], registry_id_or_none: Optional[uuid.UUID]
) -> ArtifactRegistryData:
if registry_id_or_none is None:
# TODO: Handle `artifact_type` for other types
Copy link

Copilot AI Oct 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The TODO comment indicates incomplete implementation for handling different artifact types. This should be documented more clearly or tracked in a separate issue.

Suggested change
# TODO: Handle `artifact_type` for other types
# NOTE: Currently, only 'model' artifact type is supported here.
# Support for other artifact types should be implemented in the future.
# See issue #1234 for tracking this limitation.

Copilot uses AI. Check for mistakes.
from ai.backend.manager.services.artifact_revision.actions.base import ArtifactRevisionAction


# TODO: Make this a batch action.
Copy link

Copilot AI Oct 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The TODO comment suggests this isn't actually implemented as a batch action yet, which contradicts the class name 'BatchAction'. This should be clarified or the implementation should be updated.

Suggested change
# TODO: Make this a batch action.

Copilot uses AI. Check for mistakes.
"Mismatch between artifact revisions and task IDs returned"
)

for task_id, artifact_revision in zip(action_result.task_ids, artifact_revisions, strict=True):
Copy link

Copilot AI Oct 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Good use of strict=True in zip() to ensure length consistency between task_ids and artifact_revisions.

Copilot uses AI. Check for mistakes.
@github-actions github-actions bot added size:XL 500~ LoC comp:storage-proxy Related to Storage proxy component and removed size:L 100~500 LoC labels Oct 13, 2025
@HyeockJinKim HyeockJinKim added this pull request to the merge queue Oct 13, 2025
Merged via the queue into main with commit a26dd15 Oct 13, 2025
30 checks passed
@HyeockJinKim HyeockJinKim deleted the feat/BA-2508 branch October 13, 2025 09:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:docs Documentations comp:common Related to Common component comp:manager Related to Manager component comp:storage-proxy Related to Storage proxy component size:XL 500~ LoC

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add import trigger API on remote reservoir registry

3 participants