Repository navigation
[BREAKING] Refactor: Provide a general storage abstraction layer - #66
Conversation
Signed-off-by: 0oshowero0 <[email protected]>
Signed-off-by: 0oshowero0 <[email protected]>
|
TODO: UT |
There was a problem hiding this comment.
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
TransferQueueStorageManagerprovides common functionality for controller notifications - New
AsyncTransferQueueStorageSimpleUnitManagermanages 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.
|
TODO:
|
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]>
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]>
Signed-off-by: 0oshowero0 <[email protected]>
refactor: renew README.md, fix import error, and fix errors in sync_demo.py
Signed-off-by: 0oshowero0 <[email protected]>
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]>
#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]>
…StorageManager (#8) 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]>
Signed-off-by: jianjunzhong <[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]>
There was a problem hiding this comment.
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.
| elif isinstance(self.controller_infos, dict): | ||
| raw_controller_infos = self.controller_infos | ||
| self.controller_infos = {} | ||
| for controller_info in raw_controller_infos.items(): |
There was a problem hiding this comment.
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.
| for controller_info in raw_controller_infos.items(): | |
| for controller_info in raw_controller_infos.values(): |
| @@ -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: | |||
There was a problem hiding this comment.
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.
| 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): |
There was a problem hiding this comment.
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.
Co-authored-by: Copilot <[email protected]>
Signed-off-by: 0oshowero0 <[email protected]>
Signed-off-by: 0oshowero0 <[email protected]>
TransferQueueStorageManagerabs class, acts as a general entry point for storage layerAsyncTransferQueueStorageSimpleUnitManagerclass to manage TransferQueueSimpleUnitTransferQueueClient, provide a general Client interface