-
Notifications
You must be signed in to change notification settings - Fork 714
Update plugins documentation #6033
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
christopher-hakkaart
wants to merge
24
commits into
nextflow-io:master
Choose a base branch
from
christopher-hakkaart:docs-plugins
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 21 commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
c487aaa
Update plugins docs
christopher-hakkaart a046331
Add run command example
christopher-hakkaart 989af21
Update links
christopher-hakkaart 5471abc
Add repo link
christopher-hakkaart 3dfb945
Add Trace observers note
christopher-hakkaart e254b63
Revise defined registry
christopher-hakkaart 5a6e4d9
Add plugin create documentation
christopher-hakkaart 0a5f013
Merge branch 'master' into pr/christopher-hakkaart/6033
bentsherman 9053ca9
Fix plugin config scope example
bentsherman ce87361
Only support registry
christopher-hakkaart d68a8d7
Merge branch 'docs-plugins' of https://github.com/christopher-hakkaar…
christopher-hakkaart 2bb3960
cleanup
bentsherman e153d96
Remove registry URL
bentsherman 1be0336
cleanup migration guide
bentsherman 7bfc78d
cleanup gradle plugin guide
bentsherman 93691b8
Merge branch 'master' into docs-plugins
christopher-hakkaart fa2dc0f
Unlist h3 headings
christopher-hakkaart ea585de
Merge branch 'master' into pr/christopher-hakkaart/6033
bentsherman aa87a22
Replace nf-hello example with plugin template
bentsherman 758b818
Cleanup private beta notes
bentsherman e0866bc
Add transition plan for legacy index -> registry
bentsherman 5ab28f6
Merge branch 'master' into pr/christopher-hakkaart/6033
bentsherman de7aaa1
Apply suggestions from code review
bentsherman d011970
Unlist timeline subheadings
bentsherman File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
(gradle-plugin-page)= | ||
|
||
# Using the Nextflow Gradle plugin | ||
|
||
The [Nextflow Gradle plugin](https://github.com/nextflow-io/nextflow-plugin-gradle) simplifies plugin development by configuring default dependencies needed for Nextflow integration and defining Gradle tasks for building, testing, and publishing Nextflow plugins. | ||
|
||
:::{note} | ||
The Nextflow Gradle plugin and plugin registry are currently available as a private beta. See the {ref}`migration guide <migrating-plugin-page>` for more information. | ||
::: | ||
|
||
(gradle-plugin-create)= | ||
|
||
## Creating a plugin | ||
|
||
:::{versionadded} 25.04.0 | ||
::: | ||
|
||
The easiest way to get started with the Nextflow Gradle plugin is to use the `nextflow plugin create` sub-command, which creates a plugin project based on the [Nextflow plugin template](https://github.com/nextflow-io/nf-plugin-template/), which in turn uses the Gradle plugin. | ||
|
||
To create a Nextflow plugin with the Gradle plugin, simply run `nextflow plugin create` on the command line. It will prompt you for your plugin name, organization name, and project path. | ||
|
||
See {ref}`dev-plugins-template` for more information about the Nextflow plugin template. See {ref}`dev-plugins-extension-points` for more information about using plugin extension points. | ||
|
||
## Building a plugin | ||
|
||
To build a plugin, simply run `make assemble`. | ||
bentsherman marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
Plugins can also be installed locally without being published. To install a plugin locally: | ||
|
||
1. In the plugin root directory, run `make install`. | ||
|
||
:::{note} | ||
Running `make install` will add your plugin to your `$HOME/.nextflow/plugins` directory. | ||
::: | ||
|
||
2. Run your pipeline: | ||
|
||
```bash | ||
nextflow run main.nf -plugins <PLUGIN_NAME>@<VERSION> | ||
``` | ||
|
||
:::{note} | ||
Plugins can also be configured via nextflow configuration files. See {ref}`using-plugins-page` for more information. | ||
::: | ||
|
||
(gradle-plugin-test)= | ||
|
||
## Testing a plugin | ||
|
||
<h3> Unit tests </h3> | ||
|
||
Unit tests are small, focused tests designed to verify the behavior of individual plugin components. | ||
|
||
To run unit tests: | ||
|
||
1. Develop your unit tests. See [MyObserverTest.groovy](https://github.com/nextflow-io/nf-plugin-template/blob/main/src/test/groovy/acme/plugin/MyObserverTest.groovy) in the [plugin template](https://github.com/nextflow-io/nf-plugin-template) for an example unit test. | ||
|
||
2. In the plugin root directory, run `make test`. | ||
|
||
<h3> End-to-end tests </h3> | ||
|
||
End-to-end tests are comprehensive tests that verify the behavior of an entire plugin as it would be used in a Nextflow pipeline. End-to-end tests should be tailored to the needs of your plugin, but generally take the form of a small Nextflow pipeline. See the `validation` directory in the [plugin template](https://github.com/nextflow-io/nf-plugin-template) for an example end-to-end test. | ||
|
||
(gradle-plugin-publish)= | ||
|
||
## Publishing a plugin | ||
|
||
The Nextflow Gradle plugin allows you to publish your plugin to the Nextflow plugin registry from the command line. | ||
|
||
To publish your plugin: | ||
|
||
1. Create a file named `$HOME/.gradle/gradle.properties`, where `$HOME` is your home directory. | ||
|
||
2. Add the following properties: | ||
|
||
``` | ||
pluginRegistry.accessToken=<REGISTRY_ACCESS_TOKEN> | ||
``` | ||
|
||
Replace `<REGISTRY_ACCESS_TOKEN>` with your plugin registry access token. | ||
|
||
3. Run `make release`. |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,160 @@ | ||
(migrating-plugin-page)= | ||
|
||
# Migrating to the Nextflow plugin registry | ||
|
||
The Nextflow plugin ecosystem is evolving to support a more robust and user-friendly experience by simplifying the development, publishing, and discovery of Nextflow plugins. This page introduces the Nextflow plugin registry, the Nextflow Gradle plugin, and how to migrate to them. | ||
|
||
:::{note} | ||
The Nextflow plugin registry and Gradle plugin are currently available as a private beta. Plugin developers are encouraged to contact [info@nextflow.io](mailto:info@nextflow.io) for more information about accessing the registry. | ||
::: | ||
|
||
## Overview | ||
|
||
### Nextflow plugin registry | ||
|
||
The Nextflow plugin registry is a central repository for Nextflow plugins. It hosts an index of plugin metadata that supports plugin discovery, accessibility, and version tracking. Nextflow 25.04 and later can use the plugin registry as a drop-in replacement for the [legacy plugin index](https://github.com/nextflow-io/plugins) hosted on GitHub. | ||
|
||
### Nextflow Gradle plugin | ||
|
||
The [Nextflow Gradle plugin](https://github.com/nextflow-io/nextflow-plugin-gradle) simplifies the development of Nextflow plugins. It provides default configuration required for Nextflow integration, as well as custom Gradle tasks for building, testing, and publishing plugins. | ||
|
||
The Gradle plugin is versioned and published to the [Gradle Plugin Portal](https://plugins.gradle.org/), allowing developers to manage it like any other dependency. As the plugin ecosystem evolves, this Gradle plugin will enable easier maintenance and adoption of ongoing improvements to the Nextflow plugin framework. | ||
bentsherman marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
## Timeline | ||
|
||
The [legacy plugin index](https://github.com/nextflow-io/plugins) will be deprecated in favor of the Nextflow plugin registry. | ||
|
||
:::{note} | ||
The following timeline is tentative and subject to modification. | ||
::: | ||
|
||
### Nextflow 25.04 | ||
bentsherman marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
The Nextflow plugin registry is available as a private beta. Nextflow 25.04 can use the Nextflow plugin registry as an opt-in feature. The Nextflow plugin registry will be automatically kept up-to-date with the [legacy plugin index](https://github.com/nextflow-io/plugins). | ||
|
||
During this time, plugin developers are encouraged to experiment with the Gradle plugin and plugin registry. | ||
|
||
### Nextflow 25.10 | ||
bentsherman marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
The Nextflow plugin registry will be generally available. Nextflow 25.10 will use the plugin registry by default. The legacy plugin index will be **closed to new pull requests**. | ||
|
||
Developers will be required to publish to the Nextflow plugin registry instead. To ensure continued support for older versions of Nextflow, the legacy plugin index will be automatically kept up-to-date with the Nextflow plugin registry. | ||
bentsherman marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
### Nextflow 26.04 | ||
bentsherman marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
Nextflow 25.10 will only be able to use the Nextflow plugin registry. | ||
|
||
At some point in the future, the legacy plugin index will be **frozen** -- it will no longer receives updates from the Nextflow plugin registry. To ensure continued support for older versions of Nextflow, the legacy plugin index will remain available indefinitely. | ||
|
||
## Impact on plugin users | ||
|
||
No immediate actions are required for plugin users. The plugin configuration has not changed. | ||
|
||
## Impact on plugin developers | ||
|
||
Plugin developers will need to update their plugin to publish to the Nextflow plugin registry instead of the legacy plugin index. The easiest way to do this is to migrate to the Nextflow Gradle plugin, which simplifies the development process and supports publishing to the plugin registry from the command line. | ||
|
||
### Migrating to the Nextflow Gradle plugin | ||
|
||
To migrate an existing Nextflow plugin: | ||
|
||
1. Remove the following files and folders: | ||
- `buildSrc/` | ||
- `launch.sh` | ||
- `plugins/build.gradle` | ||
|
||
2. If your plugin has a `plugins` directory, move the `src` directory to the project root. | ||
|
||
:::{note} | ||
Plugin sources should be in `src/main/groovy` or `src/main/java`. | ||
::: | ||
|
||
3. Replace the contents of `settings.gradle` with the following: | ||
|
||
```groovy | ||
rootProject.name = '<PLUGIN_NAME>' | ||
``` | ||
|
||
Replace `PLUGIN_NAME` with your plugin name. | ||
|
||
4. In the project root, create a new `build.gradle` file with the following configuration: | ||
|
||
```groovy | ||
// Plugins | ||
plugins { | ||
id 'io.nextflow.nextflow-plugin' version '0.0.1-alpha4' | ||
} | ||
|
||
// Dependencies (optional) | ||
dependencies { | ||
<DEPENDENCY> | ||
} | ||
|
||
// Plugin version | ||
version = '<PLUGIN_VERSION>' | ||
|
||
nextflowPlugin { | ||
// Minimum Nextflow version | ||
nextflowVersion = '<MINIMUM_NEXTFLOW_VERSION>' | ||
|
||
// Plugin metadata | ||
provider = '<PROVIDER>' | ||
className = '<CLASS_NAME>' | ||
extensionPoints = [ | ||
'<EXTENSION_POINT>' | ||
] | ||
|
||
publishing { | ||
registry { | ||
authToken = project.findProperty('pluginRegistry.accessToken') | ||
} | ||
} | ||
} | ||
``` | ||
|
||
Replace the following: | ||
|
||
- `DEPENDENCY`: (Optional) Your plugins dependency libraries—for example, `commons-io:commons-io:2.18.0`. | ||
- `PLUGIN_VERSION:` Your plugin version—for example, `0.5.0`. | ||
- `MINIMUM_NEXTFLOW_VERSION`: The minimum Nextflow version required to run your plugin—for example, `25.04.0`. | ||
- `PROVIDER`: Your name or organization—for example, `acme`. | ||
- `CLASS_NAME`: Your plugin class name—for example, `acme.plugin.MyPlugin`. | ||
- `EXTENSION_POINT`: Your extension point identifiers that the plugin will implement or expose—for example, `acme.plugin.MyFactory`. | ||
|
||
5. Replace the contents of `Makefile` with the following: | ||
|
||
```Makefile | ||
# Build the plugin | ||
assemble: | ||
./gradlew assemble | ||
|
||
clean: | ||
rm -rf .nextflow* | ||
rm -rf work | ||
rm -rf build | ||
./gradlew clean | ||
|
||
# Run plugin unit tests | ||
test: | ||
./gradlew test | ||
|
||
# Install the plugin into local nextflow plugins dir | ||
install: | ||
./gradlew install | ||
|
||
# Publish the plugin | ||
release: | ||
./gradlew releasePlugin | ||
``` | ||
|
||
6. Update `README.md` with information about the structure of your plugin. | ||
|
||
7. In the plugin root directory, run `make assemble`. | ||
|
||
Alternatively, use the `nextflow plugin create` command to re-create your plugin with the plugin template, add your existing plugin code as needed. See {ref}`dev-plugins-template` for more information about the plugin template. | ||
bentsherman marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
### Publishing to the Nextflow plugin registry | ||
|
||
The Nextflow Gradle plugin supports publishing plugins from the command line. See {ref}`gradle-plugin-publish` for more information. | ||
|
||
Once you migrate to the Gradle plugin, you will no longer be able to publish to the legacy plugin index. See the [transition timeline](#timeline) for more information. |
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
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.