Skip to content

Add fsspec base implementation for File Source plugins #20698

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 9 commits into
base: dev
Choose a base branch
from

Conversation

davelopez
Copy link
Contributor

@davelopez davelopez commented Jul 25, 2025

This PR adds a base FsspecFilesSource class as an adapter to integrate any fsspec-compatible backend to the Galaxy FilesSources framework.

  • Includes the migration of the TempFilesSource to FsspecFilesSource for testing purposes.
  • Adds a non-production MemoryFilesSource to test the base integration without a real backend.

TODO

  • More testing

xref #20415

How to test the changes?

  • I've included appropriate automated tests.
  • This is a refactoring of components with existing test coverage.
  • Instructions for manual testing are as follows:
    1. [add testing steps and prerequisites here if you didn't write automated tests covering all your changes]

License

  • I agree to license these and all my past contributions to the core galaxy codebase under the MIT license.

@davelopez davelopez added kind/enhancement kind/refactoring cleanup or refactoring of existing code, no functional changes area/backend labels Jul 25, 2025
@github-actions github-actions bot added this to the 25.1 milestone Jul 25, 2025
@davelopez davelopez marked this pull request as draft July 25, 2025 14:59
@davelopez davelopez force-pushed the add_fsspec_support branch from 5333af2 to ae3d450 Compare July 28, 2025 14:01
@davelopez davelopez marked this pull request as ready for review July 28, 2025 14:35
@davelopez
Copy link
Contributor Author

I think the basic implementation is ready for review.
I can follow up on improving the testing around file sources and start migrating some of the other plugins, like the s3fs one.

Copy link
Member

@jmchilton jmchilton left a comment

Choose a reason for hiding this comment

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

Implementation seems good to me. Since you're working on this component - I wanted to make the case that documentation would be really nice as you're implementing new components. In particular if you could create Pydantic models for the inputs supported by our framework - instead of passing kwds around so much. We could generate documentation for these plugins like we have for the user-defined variants (https://docs.galaxyproject.org/en/master/admin/data.html#file-source-types) and we could be more sure of what needs to be ported when we do have to migrate implementations.

@davelopez
Copy link
Contributor Author

I will happily work on those Pydantic models!
Do you think it would be better to make these changes along with the PR, in a follow-up PR, or even in a PR before implementing these changes?

For file source system integration with fsspec
- Introduced _is_templated method to check if property values are templated.
- Updated get_prop method to evaluate templated properties using user context.
- Enhanced ensure_required_dependency method to print dependency checks.
- Added _initialize_listings_expiry method to manage listings expiry time.
- Improved listing methods with pagination and glob pattern support.
Since there is not TempFileSystem in fsspec we need to manually box and unbox the paths to a temp folder `root_path` using a regular LocalFileSystem
This mostly to test the the base class without requiring configuration for any real fsspec compatible backend
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/backend kind/enhancement kind/refactoring cleanup or refactoring of existing code, no functional changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants