Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
91 changes: 76 additions & 15 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,28 +1,89 @@
config ?= compileClasspath

ifdef module
mm = :${module}:
else
mm = :app:
endif
#
# Build the Nextflow plugin
#
compile:
./gradlew assemble

#
# Clean and build the plugin
#
build:
./gradlew build

compile:
./gradlew assemble
#
# Clean build artifacts
#
clean:
./gradlew clean

#
# Run tests
#
test:
./gradlew test

#
# Run checks (test + lint)
#
check:
./gradlew check

image:
./gradlew jibDockerBuild
#
# Install plugin locally for testing (extract to development directory)
#
install: build
cp build/distributions/*.zip ~/.nextflow/plugins/
@echo "Also installing to development directory for testing with launch.sh..."
rm -rf /Users/edmundmiller/.worktrees/nextflow/cli-extension/plugins/nf-wave-cli
cd /Users/edmundmiller/.worktrees/nextflow/cli-extension/plugins && unzip -q ~/.nextflow/plugins/nf-wave-cli-*.zip -d nf-wave-cli
cd /Users/edmundmiller/.worktrees/nextflow/cli-extension/plugins/nf-wave-cli && mkdir -p build/classes/main build/target/libs
cd /Users/edmundmiller/.worktrees/nextflow/cli-extension/plugins/nf-wave-cli && cp -r classes/* build/classes/main/
cd /Users/edmundmiller/.worktrees/nextflow/cli-extension/plugins/nf-wave-cli && mv lib build/target/libs
@echo "Plugin installed for both runtime and development testing"

push:
# docker login
docker login -u pditommaso -p ${DOCKER_PASSWORD}
./gradlew jib
#
# Package the plugin for distribution
#
package:
./gradlew packagePlugin

#
# Show dependencies try `make deps config=runtime`, `make deps config=google`
# Show dependencies
#
deps:
./gradlew -q ${mm}dependencies --configuration ${config}
./gradlew -q dependencies --configuration ${config}

#
# Show plugin information
#
info:
@echo "Plugin: nf-wave-cli"
@echo "Version: $(shell cat VERSION)"
@echo "Built plugin: $(shell ls -1 build/distributions/*.zip 2>/dev/null || echo 'Not built yet')"

#
# Help target
#
help:
@echo "Available targets:"
@echo " compile - Build the plugin"
@echo " build - Clean and build the plugin"
@echo " clean - Clean build artifacts"
@echo " test - Run tests"
@echo " check - Run tests and checks"
@echo " install - Build and install plugin locally"
@echo " package - Package plugin for distribution"
@echo " deps - Show dependencies"
@echo " info - Show plugin information"
@echo " help - Show this help message"
@echo ""
@echo "CURRENT STATUS:"
@echo "This plugin is ready for first-class CLI integration but requires:"
@echo "1. Nextflow version with CommandExtensionPoint support (cli-extension branch)"
@echo "2. The CommandExtensionPoint interface to be available at compile time"
@echo ""
@echo "For now, the plugin provides traditional Wave CLI functionality via existing interfaces."

.PHONY: compile build clean test check install package deps info help
66 changes: 40 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Wave CLI
# wave-cli

Command line tool for [Wave containers provisioning service](https://github.com/seqeralabs/wave).
Nextflow plugin providing [Wave CLI](https://github.com/seqeralabs/wave-cli) functionality.

This plugin enables Wave container provisioning via the `nextflow plugin wave` command, providing all the CLI features of the standalone Wave CLI tool directly within Nextflow.

### Summary

Expand All @@ -19,18 +21,18 @@ that it can be used in your Docker (replace-with-your-own-fav-container-engine)

### Installation

Install the wave-cli plugin in your Nextflow environment:

#### Binary download

Download the Wave pre-compiled binary for your operating system from the
[GitHub releases page](https://github.com/seqeralabs/wave-cli/releases/latest) and give execute permission to it.

#### Homebrew (Linux and macOS)
```bash
nextflow plugin install wave-cli
```

If you use [Homebrew](https://brew.sh/), you can install like this:
Alternatively, add the plugin to your `nextflow.config`:

```bash
brew install seqeralabs/tap/wave-cli
```groovy
plugins {
id 'wave-cli'
}
```

### Get started
Expand All @@ -53,7 +55,7 @@ If you use [Homebrew](https://brew.sh/), you can install like this:


```bash
docker run --rm $(wave -f ./Dockerfile) cowsay "Hello world"
docker run --rm $(nextflow plugin wave -f ./Dockerfile) cowsay "Hello world"
```


Expand All @@ -72,7 +74,7 @@ If you use [Homebrew](https://brew.sh/), you can install like this:
2. Augment the container with the local layer and run with Docker:

```bash
container=$(wave -i alpine --layer new-layer)
container=$(nextflow plugin wave -i alpine --layer new-layer)
docker run $container sh -c hello.sh
```

Expand All @@ -98,14 +100,14 @@ If you use [Homebrew](https://brew.sh/), you can install like this:
3. Build and run the container on the fly:

```bash
container=$(wave -f Dockerfile --context build-context)
container=$(nextflow plugin wave -f Dockerfile --context build-context)
docker run $container sh -c hello.sh
```

#### Build a Conda multi-packages container

```bash
container=$(wave --conda-package bamtools=2.5.2 --conda-package samtools=1.17)
container=$(nextflow plugin nextflow plugin wave --conda-package bamtools=2.5.2 --conda-package samtools=1.17)
docker run $container sh -c 'bamtools --version && samtools --version'
```

Expand All @@ -128,49 +130,49 @@ docker run $container sh -c 'bamtools --version && samtools --version'
2. Build and run the container using the Conda environment:

```bash
container=$(wave --conda-file ./conda.yaml)
container=$(nextflow plugin wave --conda-file ./conda.yaml)
docker run $container sh -c 'bamtools --version'
```


#### Build a container by using a Conda lock file

```bash
container=$(wave --conda-package https://prefix.dev/envs/pditommaso/wave/6x60arx3od13/conda-lock.yml)
container=$(nextflow plugin nextflow plugin wave --conda-package https://prefix.dev/envs/pditommaso/wave/6x60arx3od13/conda-lock.yml)
docker run $container cowpy 'Hello, world!'
```


#### Build a Conda package container arm64 architecture

```bash
container=$(wave --conda-package fastp --platform linux/arm64)
container=$(nextflow plugin nextflow plugin wave --conda-package fastp --platform linux/arm64)
docker run --platform linux/arm64 $container sh -c 'fastp --version'
```

#### Build a Singularity container using a Conda package and pushing to a OCI registry

```bash
container=$(wave --singularity --conda-package bamtools=2.5.2 --build-repo docker.io/user/repo --freeze --await)
container=$(nextflow plugin wave --singularity --conda-package bamtools=2.5.2 --build-repo docker.io/user/repo --freeze --await)
singularity exec $container bamtools --version
```

#### Mirror (aka copy) a container to another registry

```bash
container=$(wave -i ubuntu:latest --mirror --build-repo <YOUR REGISTRY> --tower-token <YOUR ACCESS TOKEN> --await)
container=$(nextflow plugin wave -i ubuntu:latest --mirror --build-repo <YOUR REGISTRY> --tower-token <YOUR ACCESS TOKEN> --await)
docker pull $container
```

#### Build a container and scan it for vulnerabilities

```bash
wave --conda-package bamtools=2.5.2 --scan-mode required --await -o yaml
nextflow plugin wave --conda-package bamtools=2.5.2 --scan-mode required --await -o yaml
```

### Development

1. Install GraalVM-Java 21.0.1
1. Install Java 21

```bash
sdk install java 21.0.1-graal
Expand All @@ -188,14 +190,26 @@ wave --conda-package bamtools=2.5.2 --scan-mode required --await -o yaml
./gradlew check
```

3. Native compile
3. Build and install plugin locally for development

```bash
./gradlew app:nativeCompile
./gradlew installPlugin
```

4. Run the native binary
4. Test the plugin with Nextflow

```bash
./app/build/native/nativeCompile/wave --version
nextflow plugin wave --version
```

### Usage in Workflows

You can use Wave directly in your Nextflow workflows by installing the plugin and enabling Wave container provisioning in your `nextflow.config`:

```groovy
plugins {
id 'wave-cli'
}
```

Note: This plugin provides CLI functionality via `nextflow plugin wave`. For workflow-level Wave integration, use the official `nf-wave` plugin instead.
83 changes: 83 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
/*
* Copyright 2023-2025, Seqera Labs
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/

plugins {
id 'groovy'
id 'io.nextflow.nextflow-plugin' version '1.0.0-beta.6'
}

// read the version from the `VERSION` file
version = new File(rootDir,'VERSION').text.trim()
group = 'io.seqera'

java {
toolchain {
languageVersion = JavaLanguageVersion.of(21)
}
}

repositories {
mavenLocal()
mavenCentral()
maven { url = "https://s3-eu-west-1.amazonaws.com/maven.seqera.io/releases" }
maven { url = "https://s3-eu-west-1.amazonaws.com/maven.seqera.io/snapshots" }
}

dependencies {
// Nextflow plugin dependencies are automatically handled by the nextflow-plugin gradle plugin
compileOnly 'io.nextflow:nextflow-plugin-gradle:1.0.0-beta.6'

// Add core Nextflow as compile dependency for CommandExtensionPoint
compileOnly files('/Users/edmundmiller/.worktrees/nextflow/cli-extension/modules/nextflow/build/libs/nextflow-25.06.0-edge.jar')

// Keep existing Wave API dependencies
implementation 'io.seqera:wave-api:0.16.0'
implementation 'io.seqera:wave-utils:0.15.1'

// CLI and utility dependencies
implementation 'info.picocli:picocli:4.6.1'
implementation 'com.squareup.moshi:moshi:1.15.2'
implementation 'com.squareup.moshi:moshi-adapters:1.15.2'
implementation 'dev.failsafe:failsafe:3.1.0'
implementation 'org.apache.commons:commons-lang3:3.12.0'
implementation 'org.yaml:snakeyaml:2.1'
implementation 'dev.langchain4j:langchain4j-open-ai:0.29.0'
implementation 'org.semver4j:semver4j:5.4.0'
annotationProcessor 'info.picocli:picocli-codegen:4.6.1'

// Bump commons-io version to address security vulnerabilities
runtimeOnly 'commons-io:commons-io:2.18.0'

// Test dependencies - aligned with Nextflow's Groovy 4.x
testImplementation "org.spockframework:spock-core:2.3-groovy-4.0"
testImplementation "org.spockframework:spock-junit4:2.3-groovy-4.0"
testImplementation "cglib:cglib-nodep:3.3.0"
testImplementation "org.objenesis:objenesis:3.4"
}

test {
useJUnitPlatform()
}

// Plugin configuration - Final working configuration
// Only these properties are supported by io.nextflow.gradle.NextflowPluginConfig:
nextflowPlugin {
className = 'io.seqera.wave.plugin.WavePlugin'
provider = 'Paolo Di Tommaso'
description = 'Nextflow plugin providing first-class Wave CLI commands'
nextflowVersion = '25.04.0'
}
4 changes: 2 additions & 2 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
*/
pluginManagement {
repositories {
mavenLocal()
mavenCentral()
gradlePluginPortal()
}
Expand All @@ -20,8 +21,7 @@ plugins {
id("org.gradle.toolchains.foojay-resolver-convention") version "0.7.0"
}

rootProject.name = 'wave-cli'
include('app')
rootProject.name = 'nf-wave-cli'

// enable for local development
// includeBuild("../libseqera")
Loading
Loading