[feat] Add RayStorage to backend choices#27
Conversation
Signed-off-by: Evelynn-V <liwenlin0223l@gmail.com>
Signed-off-by: Evelynn-V <liwenlin0223l@gmail.com>
Signed-off-by: Evelynn-V <liwenlin0223l@gmail.com>
Signed-off-by: Evelynn-V <liwenlin0223l@gmail.com>
Signed-off-by: Evelynn-V <liwenlin0223l@gmail.com>
Signed-off-by: Evelynn-V <liwenlin0223l@gmail.com>
There was a problem hiding this comment.
Pull request overview
Adds a Ray-backed storage manager so TransferQueue can use the Ray/RDT KV backend via a dedicated RayStorageManager, aligning with the backend naming/initialization approach introduced in PR #26.
Changes:
- Introduces
RayStorageManagerregistered as theRayStorebackend type. - Exposes
RayStorageManagerthroughtransfer_queue.storageandtransfer_queue.storage.managersexports. - Adds a default
backend.RayStoreblock totransfer_queue/config.yaml(withclient_name: RayStorageClient).
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
transfer_queue/storage/managers/ray_storage_manager.py |
New storage manager wrapper for Ray KV backend; validates/defaults client_name and delegates to KVStorageManager. |
transfer_queue/storage/managers/__init__.py |
Re-exports RayStorageManager from the managers package. |
transfer_queue/storage/__init__.py |
Re-exports RayStorageManager from the storage package. |
transfer_queue/config.yaml |
Adds default configuration section for backend.RayStore. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| RayStore: | ||
| client_name: RayStorageClient | ||
|
|
There was a problem hiding this comment.
Consider adding a short inline comment/header for this new RayStore block (matching the existing "# For SimpleStorage" section), and also update the earlier backend.storage_backend comment list to include RayStore so users discover the new backend option from the default config.
| def __init__(self, controller_info: ZMQServerInfo, config: dict[str, Any]): | ||
| client_name = config.get("client_name", None) | ||
|
|
||
| if client_name is None: | ||
| logger.info("Missing 'client_name' in config, using default value('RayStorageClient')") | ||
| config["client_name"] = "RayStorageClient" | ||
| elif client_name != "RayStorageClient": | ||
| raise ValueError(f"Invalid 'client_name': {client_name} in config. Expecting 'RayStorageClient'") | ||
| super().__init__(controller_info, config) |
There was a problem hiding this comment.
RayStorageManager introduces backend-specific config validation (defaulting/validating client_name) but there are no unit tests covering this behavior. Add a small test that constructs the manager (with controller connect mocked like other tests) to verify: (1) missing client_name is defaulted to RayStorageClient, and (2) a non-RayStorageClient value raises the expected ValueError.
|
look good to merge |
| zmq_info: null | ||
|
|
||
| RayStore: | ||
| client_name: RayStorageClient |
There was a problem hiding this comment.
We don't need to assign this since each StorageManger is bounded with its dedicated client
| def __init__(self, controller_info: ZMQServerInfo, config: dict[str, Any]): | ||
| client_name = config.get("client_name", None) | ||
|
|
||
| if client_name is None: |
There was a problem hiding this comment.
We don't need to assign this since each StorageManger is bounded with its dedicated client
RayStorage to backend choices
| logger = logging.getLogger(__name__) | ||
| logger.setLevel(os.getenv("TQ_LOGGING_LEVEL", logging.WARNING)) |
Round 1 (Copilot Ascend#5, Ascend#9, Ascend#10, Ascend#17, Ascend#20): - fix(serial_utils): preserve scalar shape in round-trip serialization - fix(zmq_utils): add strict=True to zip calls - fix(metadata): use warnings.warn for parse_dtype fallback - refactor(metadata): remove dead _convert_legacy_sample_meta code - fix(simple_backend): downgrade storage unit log to DEBUG Round 2 (Copilot Ascend#24, 0oshowero0 Ascend#27, Ascend#28): - perf(simple_backend): track active keys with _active_keys set for O(1) capacity check, replacing O(K×F) existing_keys scan in put_data - docs(tutorial): merge demonstrate_batch_meta_construction() and demonstrate_batch_meta() into demonstrate_batch_meta_operations(), eliminating 3 duplicate demos and fixing misleading function name Signed-off-by: 看我72遍 <m.pb@msn.com>
Background
In order to align with the backend mentioned in the PR#26, I have extracted the RayStorageManager to manage the RDT backend
Use Case