-
Notifications
You must be signed in to change notification settings - Fork 79
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
Develop a plugin interface to add new downloaders #328
Comments
So I've been poking at this a little. Harmony and HyP3 both have python clients which allow you to interact with those services, so building an earthaccess plugin with those should be straight forward -- most of the work is just translating the earthaccess search results into the form needed by those services. Just sketching out with pseudo code, this could look like: # HyP3
results = earthaccess.search(...)
jobs = earthaccess.hyp3.submit_rtc_jobs(results, **kwargs)
jobs.watch()
ds = earthaccess.smart_open(jobs) # xarray dataset
# Harmony
results = earthaccess.search(...)
jobs = earthaccess.harmony.mosaic(results, **kwargs)
jobs.watch()
ds = earthaccess.smart_open(jobs) # xarray dataset
# SBAS -> HyP3
results = earthaccess.search(...)
stacks = earthaccess.asf.sbas(results, **kwargs)
jobs = earthaccess.hyp3.submit_insar_jobs(stacks, **kwargs)
jobs.watch()
ds = earthaccess.smart_open(jobs) # xarray dataset |
Really there's three fundamental interfaces for services:
|
Some thoughts on how to do this borrowing from @jhkennedy 's comments above. Abstract Plugin Interface:
Plugin Discovery: Earthaccess would then discover and load any plugins located in the 'plugins' directory. This could load a list of available plugins that the Later on we could move towards letting the user install the plugins via a command like this: Steps to implement a plugin:
I would like to implement the PluginInterface class, test the discovery functionality to see how everything might work, and then regroup for feedback on a hackday! |
I feel like plugins should be independent repositories so they can be packaged separately. That way we don't need to maintain optional dependencies within this repo for every plugin, and it gives plugin authors more autonomy. I like xarray's documentation about this! I think they're prescribing that the plugin's pyproject.toml would define metadata needed for xarray to discover it. I need to understand better how that discovery works. I like this model. |
That's a great idea. I also am interested in better understanding the plug-in discovery mechanism. So far I have been thinking of the plug-in code as a part of earthaccess. But I will explore what |
I was hoping to catch some news at the end of today's hack day, sorry I missed you! |
@mfisher87 - No worries, I dropped off a little early because I was stuck on failing units tests for the services PR. (Luis offered to take a look at the PR as the units tests for Python 3.10 - 3.12 are failing but Python 3.9 are succeeding.) But we didn't get to talk about the plugin architecture. Maybe we can reserve a little bit of time during the next hackday to discuss! |
Sounds like a good plan :) |
We would like to make data services more accessible, but we don't want earthaccess to be coupled with the APIs of all the different services.
It was suggested by Bri that we add support for asynchronous ordering as an access method. @andypbarrett suggested support for NSIDC subsetter. It was suggested by Joseph that a plugin system would be a good way to decouple this significant complexity from the main earthaccess codebase. I think we have broad agreement that this is a good way forward. Does that sound right?
Next up we need to talk about the interface! We need to be thoughtful about breaking changes here, because those will create work for all plugin projects (and those downstream of the plugins). What does developing a plugin look like? How will earthaccess discover/register installed plugins? What context will earthaccess provide to the plugin (and if that includes credentials, how should we warn users about using only trusted plugins?)? What information will be reported back from the plugin to earthaccess? How do we test that we haven't committed any breaking changes to the interface, and if so, apply the correct version change?
Identified tasks (please edit me!)
🚀 ❤️
EDIT: cc @BriannaLind @jhkennedy
The text was updated successfully, but these errors were encountered: