87 lines
2.4 KiB
Markdown
87 lines
2.4 KiB
Markdown
# k8s-dvfs
|
|
|
|
## Summary
|
|
|
|
`k8s-dvfs` is a Nextflow plugin scaffolded from the official plugin
|
|
template. Out of the box it provides:
|
|
|
|
- A custom function `sayHello` that can be imported into Nextflow scripts.
|
|
- A workflow observer that reacts to pipeline lifecycle events (start and
|
|
completion).
|
|
|
|
Replace this section with a description of what your plugin actually does.
|
|
|
|
Note: The **Summary**, **Get Started**, **Examples**, and **License** sections are
|
|
mandatory: they are required by the Nextflow Registry, which uses this
|
|
file as the plugin description. The **Plugin development** section below is
|
|
guidance for working on the plugin and can be removed before publishing.
|
|
|
|
## Get Started
|
|
|
|
Enable the plugin in your pipeline `nextflow.config`:
|
|
|
|
```groovy
|
|
plugins {
|
|
id 'k8s-dvfs@0.1.0'
|
|
}
|
|
```
|
|
|
|
Nextflow downloads the plugin from the Nextflow Registry the first time
|
|
the pipeline runs.
|
|
|
|
## Examples
|
|
|
|
Import and call the `sayHello` function from a Nextflow script:
|
|
|
|
```nextflow
|
|
include { sayHello } from 'plugin/k8s-dvfs'
|
|
|
|
workflow {
|
|
channel.of('Mundo', 'World').map { target -> sayHello(target) }
|
|
}
|
|
```
|
|
|
|
The bundled observer prints a message when the pipeline starts and completes,
|
|
so running any pipeline with the plugin enabled produces:
|
|
|
|
```
|
|
Pipeline is starting! 🚀
|
|
Pipeline complete! 👋
|
|
```
|
|
|
|
## Plugin development
|
|
|
|
This project was created from the [Nextflow plugin template](https://www.nextflow.io/docs/latest/guides/gradle-plugin.html#gradle-plugin-create).
|
|
|
|
### Building
|
|
|
|
To build the plugin:
|
|
|
|
```bash
|
|
make assemble
|
|
```
|
|
|
|
### Testing with Nextflow
|
|
|
|
The plugin can be tested without a local Nextflow installation:
|
|
|
|
1. Build and install the plugin to your local Nextflow installation: `make install`
|
|
2. Run a pipeline with the plugin: `nextflow run hello -plugins k8s-dvfs@0.1.0`
|
|
|
|
### Publishing
|
|
|
|
Plugins can be published to a central Nextflow registry to make them accessible to the Nextflow community.
|
|
|
|
Follow these steps to publish the plugin to the Nextflow Registry:
|
|
|
|
1. Create a file named `$HOME/.gradle/gradle.properties`, where `$HOME` is your home directory. Add the following properties:
|
|
* `npr.apiKey`: Your Nextflow Registry access token.
|
|
2. Package your plugin and publish it to the registry: `make release`.
|
|
|
|
## License
|
|
|
|
Apache License 2.0. See the [`COPYING`](COPYING) file for details.
|
|
|
|
Note: The above license is given for guidance only; however the Nextflow Registry
|
|
requires the plugin to include an OSS (open source software) license.
|