Skip to content

replace fsspec with obstore for faster object storage access - #64

Open
ram-from-tvl wants to merge 3 commits into
openclimatefix:mainfrom
ram-from-tvl:obstore
Open

ram-from-tvl wants to merge 3 commits into
openclimatefix:mainfrom
ram-from-tvl:obstore

Conversation

@ram-from-tvl

@ram-from-tvl ram-from-tvl commented Sep 12, 2025

Copy link
Copy Markdown
Contributor

Pull Request

Description

This PR replaces fsspec with obstore for faster object storage access, providing significant performance improvements for reading/writing from cloud storage backends.

Changes made:

  • Replaced fsspec and s3fs imports with obstore.fsspec.FsspecStore in storage.py
  • Updated get_fs() function to create obstore-backed filesystems while maintaining full API compatibility
  • Added obstore >= 0.2.0 dependency to pyproject.toml
  • Maintained backward compatibility - no changes required in other modules

Fixes #47

How Has This Been Tested?

Testing performed:

  • Verified all module imports work correctly after changes
  • Tested local filesystem operations (put, exists, isfile, open)
  • Confirmed S3 filesystem creation works with proper credential handling
  • Validated API compatibility - all existing filesystem operations work identically
  • Ran comprehensive linting (ruff) and type checking (mypy) - all pass
  • Tested core functionality used by download_eumetsat.py and run.py

Test configuration:

  • Python 3.12.3 in virtual environment
  • All dev dependencies installed (moto, pytest, ruff, mypy)
  • Tested on Ubuntu Linux

If your changes affect data processing, have you plotted any changes? i.e. have you done a quick sanity check?

  • Yes - Verified that filesystem operations maintain identical behavior and data integrity

Checklist:

  • My code follows OCF's coding style guidelines
  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works (Existing tests continue to work; functionality verified through manual testing)
  • I have checked my code and corrected any misspellings

@ram-from-tvl ram-from-tvl changed the title feat: replace fsspec with obstore for faster object storage access replace fsspec with obstore for faster object storage access Sep 12, 2025
- Resolved conflicts between obstore implementation and new upstream features
- Kept obstore integration for S3 and local filesystem access
- Added support for GCS via gcsfs (from upstream)
- Added icechunk support for versioned zarr stores (from upstream)
- Maintained performance improvements from obstore while preserving all new functionality
@ram-from-tvl

Copy link
Copy Markdown
Contributor Author

Hi @jacobbieker
I have migrated to Obstore. Please review the changes and let me know if we are good to go.
Thank you!

@jacobbieker jacobbieker 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.

Looks nice! Will want to have @devsjc have a look before merging it too, but yeah, just one more change to remove fsspec from the codebase for GCP as well please.

Comment thread src/satellite_consumer/storage.py Outdated
@jacobbieker
jacobbieker requested a review from devsjc September 13, 2025 11:16
- Replace gcsfs with obstore FsspecStore for GCS
- Remove gcsfs dependency as it's no longer needed
- All filesystem types (local, S3, GCS) now use obstore
- Addresses maintainer feedback in PR review
@ram-from-tvl

Copy link
Copy Markdown
Contributor Author

Hi @jacobbieker
I have made all the requested changes. Please review it and let me know if its good to go.
Thank you!

@jacobbieker
jacobbieker self-requested a review September 15, 2025 09:15

@jacobbieker jacobbieker 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.

LGTM! Will wait for @devsjc to check though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Use Obstore for reading/writing from object storage

2 participants