-
Notifications
You must be signed in to change notification settings - Fork 677
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
Support prefetching plugins metadata from an http api #5887
base: master
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for nextflow-docs-staging canceled.
|
modules/nf-commons/src/main/nextflow/plugin/PluginsFacade.groovy
Outdated
Show resolved
Hide resolved
modules/nf-commons/src/main/nextflow/plugin/PluginsFacade.groovy
Outdated
Show resolved
Hide resolved
71fa033
to
db98839
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not major comments apart if I'm not wrong there isnt any unit test for this pre-fetching mechanism ?
modules/nf-commons/src/main/nextflow/plugin/PluginsFacade.groovy
Outdated
Show resolved
Hide resolved
Signed-off-by: Tom Sellman <[email protected]>
db98839
to
ba28c09
Compare
Added unit tests |
Signed-off-by: Paolo Di Tommaso <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, i've made a couple of minor comments and changes.
* repository types to perform some data-loading optimisations. | ||
*/ | ||
void prefetchMetadata(List<PluginSpec> plugins) { | ||
for( def repo : this.@repositories ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess this uses direct field access to by-pass the invocation of refresh
in the getter. Worth to highlight it in a comment if that's the case
def split = specs.split { plugin -> isEmbedded() && defaultPlugins.hasPlugin(plugin.id) } | ||
def (skip, toStart) = [split[0], split[1]] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure to understand this logic, a comment to explain the need for splitting the list of plugins would help.
Also this method looks like an implementation detail, may not be needed to expose it as public
This adds an implementation of p4fj's
UpdateRepository
which can download plugin metadata from an http api.It also adds a new interface
PrefetchUpdateRepository
which extends p4fj's interface to add aprefetch()
method. When initialising plugins, Nextflow will call this prefetch method on any UpdateRepository which implements this interface, allowing the repository to optimise how it downloads plugin metadata (for example, only loading metadata for required plugins rather than for all plugins).Use of the new http update repository can be enabled with the new
NXF_PLUGINS_INDEX_URL
environment variable. If set, this overrides the defaultindexUrl
location of theplugins.json
metadata file. If the supplied url ends in.json
then Nextflow will use the existing update repository implementation, otherwise it will use the new http api implementation.Unless this new env var is set, these changes should have no effect on Nextflow's behaviour.