feat: Add pluggable cloud transfer system with scheme-based dispatch#24
Merged
tomdurrant merged 5 commits intomainfrom Feb 18, 2026
Merged
feat: Add pluggable cloud transfer system with scheme-based dispatch#24tomdurrant merged 5 commits intomainfrom
tomdurrant merged 5 commits intomainfrom
Conversation
Replaces DataBlob's tight coupling to AnyPath and HTTP with a flexible transfer plugin system supporting file://, http://, https://, and oceanum:// schemes via entry points. Core Infrastructure: - TransferBase: Abstract interface for get/exists/list/put/delete/stat operations - Registry: Loads transfer plugins via importlib.metadata.entry_points() - get_transfer(): Dispatches to appropriate transfer based on URI scheme - parse_scheme(): Normalizes scheme handling (case-insensitive, empty->file) - UnsupportedOperation: Exception for unavailable operations on a scheme Built-in Transfer Implementations: - FileTransfer: Local filesystem operations (copy/symlink + full CRUD) - HttpTransfer: HTTP/HTTPS downloads (delegates to existing http_handler) - OceanumTransfer: Oceanum DataMesh operations via fsspec DataBlob Integration: - Refactored DataBlob.get() to use transfer registry (80 lines -> 12 lines) - Removed HttpUrl type constraint, now accepts plain str URIs - Maintains backwards compatibility with AnyPath inputs - Preserves link=True semantics for local files Entry Points: - Declared in pyproject.toml: file, http, https (->http), oceanum - Plugins loaded at runtime via importlib.metadata Tests: - 48 new transfer-specific tests (registry, file, http, oceanum) - Updated DataBlob HTTP tests to accept str type instead of HttpUrl - All tests use mocking for external services (respx for HTTP, fsspec mocks)
- Add TransferManager class with transfer_files signature - Add TransferFailurePolicy enum (CONTINUE, FAIL_FAST) - Add TransferItemResult and TransferBatchResult dataclasses - Implement join_prefix() utility for URI/path joining - Add comprehensive tests for join_prefix() Part of Wave 1 (Tasks 2-3) for WW3 output transfer postprocessor.
Add TransferManager.transfer_files() supporting fan-out to multiple destination prefixes with configurable failure policies (CONTINUE/FAIL_FAST). Changes: - Implement transfer_files() with sequential file→destination fan-out - Use get_transfer() for backend resolution and join_prefix() for URIs - Record detailed TransferItemResult for each operation - Add TransferBatchResult.all_succeeded() convenience method - Export TransferManager types in public API - Add comprehensive tests covering success and failure scenarios All tests passing (6/6 for TransferManager, 8/8 for join_prefix).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR introduces a new pluggable transfer system that enables multi-destination file transfers with scheme-based dispatch. The implementation uses cloudpathlib to support various cloud storage protocols.
Changes
Core Features
New Modules
src/rompy/transfer/: Complete transfer subsystembase.py: Abstract base classes and interfacesmanager.py: TransferManager implementationregistry.py: Scheme-based handler registrycloud.py: Cloud storage handlers (S3, GCS, Azure)file.py: Local file system transfershttp.py: HTTP/HTTPS transfersoceanum.py: Oceanum platform integrationutils.py: Utility functions includingjoin_prefixexceptions.py: Custom exception classesTests
Refactoring
src/rompy/core/data.pyto integrate with new transfer systemFiles Changed
21 files changed, 2053 insertions(+), 80 deletions(-)
Commits
2aa600f: Added cloudpath based cloud transfer protocolsaa1e641: Implement TransferManager for multi-destination file transfers04a36a4: Add TransferManager types and join_prefix utility2f4d166: add to gitignore379fdb6: feat: add pluggable transfer system with scheme-based dispatch