-
Notifications
You must be signed in to change notification settings - Fork 727
Package directive #6342
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
Draft
edmundmiller
wants to merge
11
commits into
master
Choose a base branch
from
package-directive
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.
Draft
Package directive #6342
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
5660c20
test(#6092): Add Pixi environment support
edmundmiller 99b820a
test(#6092): Add Pixi environment tests
edmundmiller 0f30843
test(#6092): Add integration tests for PixiCache functionality
edmundmiller fd2a15c
test: Update sayHello process to use cowpy
edmundmiller cf53a68
feat: Add preview.package feature flag
edmundmiller 0fc9973
feat: Add core package management abstraction
edmundmiller 1817f1f
feat: Add package directive to process configuration
edmundmiller 8d4955b
feat: Update bash wrapper for unified package activation
edmundmiller 52f14ed
feat: Add nf-conda package manager plugin
edmundmiller 146deee
feat: Add nf-pixi package manager plugin
edmundmiller c04e140
feat: Add Wave integration for unified package management
edmundmiller 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 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,219 @@ | ||
# Unified Package Management System | ||
|
||
This document describes the new unified package management system in Nextflow, introduced as a preview feature behind the `nextflow.preview.package` flag. | ||
|
||
## Overview | ||
|
||
The unified package management system provides a consistent interface for managing packages across different package managers (conda, pixi, mamba, etc.) through a single `package` directive. | ||
|
||
## Enabling the Feature | ||
|
||
Add this to your `nextflow.config`: | ||
|
||
```groovy | ||
nextflow.preview.package = true | ||
``` | ||
|
||
## Basic Usage | ||
|
||
### Single Package | ||
|
||
```groovy | ||
process example { | ||
package "samtools=1.17", provider: "conda" | ||
|
||
script: | ||
""" | ||
samtools --version | ||
""" | ||
} | ||
``` | ||
|
||
### Multiple Packages | ||
|
||
```groovy | ||
process example { | ||
package ["samtools=1.17", "bcftools=1.18"], provider: "conda" | ||
|
||
script: | ||
""" | ||
samtools --version | ||
bcftools --version | ||
""" | ||
} | ||
``` | ||
|
||
### Using Default Provider | ||
|
||
Configure a default provider in your config: | ||
|
||
```groovy | ||
packages { | ||
provider = 'conda' | ||
} | ||
``` | ||
|
||
Then use: | ||
|
||
```groovy | ||
process example { | ||
package "samtools=1.17" // uses default provider | ||
|
||
script: | ||
""" | ||
samtools --version | ||
""" | ||
} | ||
``` | ||
|
||
### Advanced Configuration | ||
|
||
```groovy | ||
process example { | ||
package { | ||
provider = "conda" | ||
packages = ["samtools=1.17", "bcftools=1.18"] | ||
channels = ["conda-forge", "bioconda"] | ||
options = [ | ||
createTimeout: "30 min" | ||
] | ||
} | ||
|
||
script: | ||
""" | ||
samtools --version | ||
bcftools --version | ||
""" | ||
} | ||
``` | ||
|
||
### Environment Files | ||
|
||
```groovy | ||
process example { | ||
package { | ||
provider = "conda" | ||
environment = file("environment.yml") | ||
} | ||
|
||
script: | ||
""" | ||
python script.py | ||
""" | ||
} | ||
``` | ||
|
||
## Supported Providers | ||
|
||
- `conda` - Anaconda/Miniconda package manager | ||
- `pixi` - Fast conda alternative with lockfiles | ||
- `mamba` - Fast conda alternative | ||
- `micromamba` - Minimal conda implementation | ||
|
||
## Configuration | ||
|
||
### Global Configuration | ||
|
||
```groovy | ||
// nextflow.config | ||
nextflow.preview.package = true | ||
|
||
packages { | ||
provider = 'conda' // default provider | ||
} | ||
|
||
// Provider-specific configurations | ||
conda { | ||
channels = ['conda-forge', 'bioconda'] | ||
createTimeout = '20 min' | ||
} | ||
|
||
pixi { | ||
cacheDir = '/tmp/pixi-cache' | ||
} | ||
``` | ||
|
||
## Wave Integration | ||
|
||
The unified package system integrates with Wave for containerization: | ||
|
||
```groovy | ||
process example { | ||
package "samtools=1.17", provider: "conda" | ||
|
||
script: | ||
""" | ||
samtools --version | ||
""" | ||
} | ||
``` | ||
|
||
Wave will automatically create a container with the specified packages. | ||
|
||
## Backward Compatibility | ||
|
||
Old `conda` and `pixi` directives continue to work but show deprecation warnings when the preview feature is enabled: | ||
|
||
```groovy | ||
process oldStyle { | ||
conda 'samtools=1.17' // Shows deprecation warning | ||
|
||
script: | ||
""" | ||
samtools --version | ||
""" | ||
} | ||
``` | ||
|
||
## Migration Guide | ||
|
||
### From conda directive | ||
|
||
**Before:** | ||
```groovy | ||
process example { | ||
conda 'samtools=1.17 bcftools=1.18' | ||
script: "samtools --version" | ||
} | ||
``` | ||
|
||
**After:** | ||
```groovy | ||
process example { | ||
package ["samtools=1.17", "bcftools=1.18"], provider: "conda" | ||
script: "samtools --version" | ||
} | ||
``` | ||
|
||
### From pixi directive | ||
|
||
**Before:** | ||
```groovy | ||
process example { | ||
pixi 'samtools bcftools' | ||
script: "samtools --version" | ||
} | ||
``` | ||
|
||
**After:** | ||
```groovy | ||
process example { | ||
package ["samtools", "bcftools"], provider: "pixi" | ||
script: "samtools --version" | ||
} | ||
``` | ||
|
||
## Plugin Architecture | ||
|
||
The system is extensible through plugins. Package managers are implemented as plugins that extend the `PackageProviderExtension` interface: | ||
|
||
- `nf-conda` - Conda support | ||
- `nf-pixi` - Pixi support | ||
|
||
Custom package managers can be added by implementing the `PackageProvider` interface and registering as a plugin. | ||
|
||
## Examples | ||
|
||
See the test files for complete examples: | ||
- `tests/package-test.nf` - Basic usage examples | ||
- `tests/integration-test.nf` - Integration and backward compatibility tests |
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
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.