-
Notifications
You must be signed in to change notification settings - Fork 718
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
21
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
21 commits
Select commit
Hold shift + click to select a range
15cf708
test(#6092): Add Pixi environment support
edmundmiller 3e4e74c
test(#6092): Add Pixi environment tests
edmundmiller 08bd78d
test(#6092): Add integration tests for PixiCache functionality
edmundmiller c7f2085
test: Update sayHello process to use cowpy
edmundmiller c437cbe
feat: Add preview.package feature flag
edmundmiller 42a1d48
feat: Add core package management abstraction
edmundmiller f84ff4a
feat: Add package directive to process configuration
edmundmiller 503d412
feat: Update bash wrapper for unified package activation
edmundmiller b1051fa
feat: Add nf-conda package manager plugin
edmundmiller 2c53f95
feat: Add nf-pixi package manager plugin
edmundmiller 778d059
feat: Add Wave integration for unified package management
edmundmiller ada8d29
test: Add comprehensive test suite for package management
edmundmiller 7258685
docs: Add unified package management documentation
edmundmiller 4ff0532
fix: update package system to use ISession interface consistently
edmundmiller 51ae824
build: configure package manager plugins for proper compilation
edmundmiller b3e3f26
style: move inline imports to top-level import statements
edmundmiller e3b1b47
refactor: remove never-merged Pixi implementation
edmundmiller c230003
docs: add comprehensive unified package management documentation
edmundmiller c6aa424
docs: update conda documentation with package directive migration info
edmundmiller 83f4e97
feat: add R package provider for Wave integration
edmundmiller 89f69bc
fix: add session config to test mocks to prevent NPE
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.
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.
Think we should be explicit about which package managers are supported. ideally also pak or install2.r for R
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.
Agreed! Do you just want to support the package managers that wave supports?
I also thought this might be a nice abstraction for the core container directives, but I wanted to keep the scope tight.
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.
Yep. we should keep aligned with Wave