Skip to content
This repository was archived by the owner on Jan 21, 2026. It is now read-only.

[BREAKING] Refactor: Provide a general storage abstraction layer - #66

Merged
0oshowero0 merged 42 commits into
TransferQueue:devfrom
0oshowero0:han/unified_storage_abstract
Oct 25, 2025
Merged

0oshowero0 merged 42 commits into
TransferQueue:devfrom
0oshowero0:han/unified_storage_abstract

Conversation

@0oshowero0

Copy link
Copy Markdown
Member
  1. Provide TransferQueueStorageManager abs class, acts as a general entry point for storage layer
  2. Implement AsyncTransferQueueStorageSimpleUnitManager class to manage TransferQueueSimpleUnit
  3. Disentangle the complex storage related operations from TransferQueueClient, provide a general Client interface

@0oshowero0

Copy link
Copy Markdown
Member Author

TODO: UT

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 introduces a general storage abstraction layer for the Transfer Queue system, refactoring storage operations from the client to dedicated storage managers. The key goal is to decouple complex storage-related operations from the client and provide a cleaner architecture.

  • Abstract base class TransferQueueStorageManager provides common functionality for controller notifications
  • New AsyncTransferQueueStorageSimpleUnitManager manages storage units and implements the storage interface
  • Refactored client to use storage managers instead of direct storage unit communication

Reviewed Changes

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

Show a summary per file
File Description
transfer_queue/storage.py Introduces storage manager abstraction and implementation
transfer_queue/metadata.py Removes storage-specific fields from metadata classes
transfer_queue/controller.py Removes storage unit management and mapping logic
transfer_queue/client.py Refactors to use storage manager instead of direct storage operations
recipe/simple_use_case/async_demo.py Updates demo to use new storage manager initialization pattern

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

Comment thread transfer_queue/storage.py Resolved
Comment thread transfer_queue/storage.py Resolved
Comment thread transfer_queue/storage.py Resolved
Comment thread transfer_queue/storage.py Resolved
Comment thread transfer_queue/storage.py Resolved
Comment thread transfer_queue/metadata.py Resolved
Comment thread transfer_queue/client.py Resolved
@0oshowero0

Copy link
Copy Markdown
Member Author

TODO:

  1. Now TransferQueueClient may not be able to be passed through Ray (not serializable). Need to investigate if there is a simple way to solve it.
  2. TransferQueueClient needs a single controller_infos, while TransferQueueStorageManager requires all controller_infos. Need to reconcile.

jianjunzhong and others added 3 commits October 21, 2025 16:38
refactor: renew README.md, fix import error, and fix errors in sync_demo.py
Signed-off-by: 0oshowero0 <[email protected]>
0oshowero0 and others added 6 commits October 21, 2025 17:02
Signed-off-by: 0oshowero0 <[email protected]>
Signed-off-by: 0oshowero0 <[email protected]>
…#2)

* feat: enhance handshake process with timeout and retransmission logic

Signed-off-by: jianjunzhong <[email protected]>

* fix: issues in comments

Signed-off-by: jianjunzhong <[email protected]>

* fix: fix issues in comments

Signed-off-by: jianjunzhong <[email protected]>

* Update transfer_queue/storage.py

Co-authored-by: Copilot <[email protected]>

* Update transfer_queue/storage.py

Co-authored-by: Copilot <[email protected]>

---------

Signed-off-by: jianjunzhong <[email protected]>
Co-authored-by: Han Zhenyu 韩振宇 <[email protected]>
Co-authored-by: Copilot <[email protected]>
jianjunzhong and others added 13 commits October 23, 2025 14:32
#3)

* docs: improve docstrings for clarity and consistency across storage.py

Signed-off-by: jianjunzhong <[email protected]>

* docs: update examples in build_storage_meta_groups and _register_servers for clarity

Signed-off-by: jianjunzhong <[email protected]>

---------

Signed-off-by: jianjunzhong <[email protected]>
…#5)

* docs: improve docstrings for clarity and consistency across client.py

* Update transfer_queue/client.py

Co-authored-by: Copilot <[email protected]>

* fix comments

* fix comments

---------

Co-authored-by: liuximeng <[email protected]>
Co-authored-by: Han Zhenyu 韩振宇 <[email protected]>
Co-authored-by: Copilot <[email protected]>
* Enable Controller UT

* fix codecheck

* fix codecheck

---------

Co-authored-by: liuximeng <[email protected]>
…impleStorageManager (#7)

* feat: update tests for SimpleStorageUnit and add new tests for AsyncSimpleStorageManager

Signed-off-by: jianjunzhong <[email protected]>

* refactor: simplify mock operations and adjust performance test parameters for faster execution

Signed-off-by: jianjunzhong <[email protected]>

---------

Signed-off-by: jianjunzhong <[email protected]>
* Handle TODOs in the demo

* fix codecheck

* Apply suggestion from @Copilot

Co-authored-by: Copilot <[email protected]>

---------

Co-authored-by: liuximeng <[email protected]>
Co-authored-by: Han Zhenyu 韩振宇 <[email protected]>
Co-authored-by: Copilot <[email protected]>
Signed-off-by: 0oshowero0 <[email protected]>
Signed-off-by: 0oshowero0 <[email protected]>
Signed-off-by: 0oshowero0 <[email protected]>
Signed-off-by: 0oshowero0 <[email protected]>
Signed-off-by: 0oshowero0 <[email protected]>
@0oshowero0
0oshowero0 requested a review from Copilot October 25, 2025 06:34

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull Request Overview

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


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread transfer_queue/storage.py
elif isinstance(self.controller_infos, dict):
raw_controller_infos = self.controller_infos
self.controller_infos = {}
for controller_info in raw_controller_infos.items():

Copilot AI Oct 25, 2025

Copy link

Choose a reason for hiding this comment

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

The .items() call returns tuples of (key, value), but the code treats controller_info as if it's the value only. This will cause incorrect type checking. Should iterate over .values() instead or destructure the tuple properly.

Suggested change
for controller_info in raw_controller_infos.items():
for controller_info in raw_controller_infos.values():

Copilot uses AI. Check for mistakes.
Comment thread transfer_queue/metadata.py Resolved
Comment thread transfer_queue/controller.py Outdated
@@ -407,8 +368,6 @@ def _generate_batch_meta(
Generate BatchMeta by resolving storage locations for given global indexes.

For each global index, looks up the corresponding storage node address using:

Copilot AI Oct 25, 2025

Copy link

Choose a reason for hiding this comment

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

Docstring mentions looking up storage node addresses but the implementation no longer does this after refactoring. The docstring should be updated to reflect that this method now only creates metadata without storage location mapping.

Copilot uses AI. Check for mistakes.
Comment thread transfer_queue/client.py
body={"local_indexes": local_indexes},
)
@dynamic_socket(socket_name="request_handle_socket")
async def check_current_step_consumption(self, task_name: str, global_step: int):

Copilot AI Oct 25, 2025

Copy link

Choose a reason for hiding this comment

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

Method check_current_step_consumption has async signature but the implementation is just pass. If this is intentional placeholder, add a TODO comment or docstring explaining when it will be implemented. The similar method check_current_step_production has the same issue.

Copilot uses AI. Check for mistakes.
Comment thread pyproject.toml Resolved
0oshowero0 and others added 3 commits October 25, 2025 14:36
Signed-off-by: 0oshowero0 <[email protected]>
Signed-off-by: 0oshowero0 <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants