Skip to content

Conversation

edmundmiller
Copy link
Member

PoC of a package directive.

Moved conda into a plugin, and the Pixi code from #6157. Hoping that by making them plugins, we can support things like #1526 in the community, etc.

I also wanted to keep conda for now(it might throw a deprecation, but it shouldn't yet) and tried to gate it behind a feature flag.

@edmundmiller edmundmiller self-assigned this Aug 14, 2025
Copy link

netlify bot commented Aug 14, 2025

Deploy Preview for nextflow-docs-staging canceled.

Name Link
🔨 Latest commit ed16697
🔍 Latest deploy log https://app.netlify.com/projects/nextflow-docs-staging/deploys/68b8cab77711b8000714e6c9

Copy link
Member

@pditommaso pditommaso left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well done, seems going in the right direction. need to look more in deep for some low level details

The conda provider supports:
- Package specifications with version constraints
- Custom channels
- Environment files (`.yml`, `.yaml`)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm tempted to get rid of env files with the new directive. Tool requirements should be strictly the ones required by the task, not bloated env files

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Which part of env files do you not like?

  1. The extra file
  2. The separation of the packages from the process

People having bloated Nextflow processes is just a part of migrating old scripts to Nextflow. Because their scripts, prior the "business" logic, was mixed with the actual implementation logic, it can be a pain to separate out.

Task batching or grouping would help people organize the logic; sometimes, it's a performance concern, like piping BWA into Samtools.

I personally like the environment.yamls, and I find once you get over three packages(which happens in an R script) and add in the channels, you can't read the conda directive. 😅

So, compromise, what if we made the environment.yml magically picked up like Dockerfiles are with wave? I just want to get rid of the conda "${moduleDir/environment.yml}" line.

@pditommaso pditommaso mentioned this pull request Aug 14, 2025
@edmundmiller edmundmiller force-pushed the package-directive branch 3 times, most recently from 31ca478 to 89f69bc Compare August 15, 2025 01:59
@adamrtalbot adamrtalbot linked an issue Sep 3, 2025 that may be closed by this pull request
edmundmiller and others added 10 commits September 3, 2025 16:35
- Introduced PixiConfig and PixiCache classes for managing Pixi environments.
- Updated Session class to include PixiConfig retrieval.
- Enhanced CmdRun with options to enable/disable Pixi environments.
- Modified ConfigBuilder to apply Pixi environment settings based on command-line options.
- Updated BashWrapperBuilder to include Pixi activation in the execution script.
- Added pixiEnv property to TaskBean and methods in TaskRun for Pixi environment handling.
- Updated ProcessConfig to include 'pixi' in process configuration options.

This commit integrates Pixi environment management into the Nextflow framework, allowing users to specify and control Pixi environments during execution.

Signed-off-by: Edmund Miller <[email protected]>
- Introduced PixiCacheTest and PixiConfigTest classes to validate Pixi environment functionality.
- Added tests for TOML and lock file detection, environment prefix path creation, and command execution handling.
- Implemented checks for configuration options and cache directory retrieval in PixiConfig.

This commit enhances the test coverage for Pixi environment management, ensuring robust functionality within the Nextflow framework.

Signed-off-by: Edmund Miller <[email protected]>
- Introduced PixiCacheIntegrationTest class to validate PixiCache behavior with various environment specifications.
- Implemented tests for creating environments from package specifications, TOML files, and lock files.
- Added checks for handling custom cache directories and validating TOML and lock file detection.
- Enhanced coverage for existing prefix directory handling and environment variable cache directory usage.

This commit strengthens the testing framework for PixiCache, ensuring reliable environment management within the Nextflow ecosystem.

Signed-off-by: Edmund Miller <[email protected]>
- Changed the environment specification from 'python=3.8' to 'cowpy'.
- Updated the script to utilize cowpy for output instead of a Python command.

This modification enhances the testing of Pixi environments by leveraging cowpy for greeting functionality.

Signed-off-by: Edmund Miller <[email protected]>
Introduces the `nextflow.preview.package` feature flag to enable
the unified package management system. This allows users to opt-in
to the new `package` directive while maintaining backward compatibility
with existing `conda` and `pixi` directives.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
Signed-off-by: Edmund Miller <[email protected]>
Creates the foundation for unified package management with:

- PackageSpec: Unified specification for packages across providers
- PackageProvider: Interface for package manager implementations
- PackageManager: Central coordinator for package providers
- PackageProviderExtension: Plugin extension point for providers

This abstraction layer enables consistent package management across
different tools (conda, pixi, mamba, etc.) while supporting both
simple and advanced configuration patterns.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
Signed-off-by: Edmund Miller <[email protected]>
Extends process configuration to support the unified package directive:

- ProcessConfig: Adds 'package' to the list of valid directives
- TaskRun: Implements getPackageSpec() method with caching
- TaskBean: Adds packageSpec field for task execution

Also adds deprecation warnings when conda/pixi directives are used
with the preview.package feature enabled, encouraging migration to
the new unified syntax.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
Signed-off-by: Edmund Miller <[email protected]>
Enhances the bash wrapper system to support the new package directive:

- BashWrapperBuilder: Adds getPackageActivateSnippet() method that
  creates package environments using the PackageManager
- command-run.txt: Adds {{package_activate}} template variable
  for package environment activation

The new system works alongside existing conda/pixi activation,
enabling gradual migration while maintaining backward compatibility.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
Signed-off-by: Edmund Miller <[email protected]>
Creates the nf-conda plugin that implements conda support for the
unified package management system:

- CondaPlugin: Main plugin class
- CondaPackageProvider: Implements PackageProvider interface
- CondaProviderExtension: Registers the provider with Nextflow
- Includes existing CondaCache and CondaConfig implementations

This plugin enables conda package management through the new
unified 'package' directive while maintaining all existing
conda functionality and configuration options.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
Signed-off-by: Edmund Miller <[email protected]>
Creates the nf-pixi plugin that implements pixi support for the
unified package management system:

- PixiPlugin: Main plugin class
- PixiPackageProvider: Implements PackageProvider interface
- PixiProviderExtension: Registers the provider with Nextflow
- Includes existing PixiCache and PixiConfig implementations

This plugin enables pixi package management through the new
unified 'package' directive, providing fast conda-compatible
package resolution with lockfile support.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
Signed-off-by: Edmund Miller <[email protected]>
Integrates the unified package management system with Wave for container building:

- Add PackageSpec to Wave PackagesSpec conversion in WaveClient
- Support provider mapping (conda/mamba/pixi -> CONDA type in Wave)
- Enable package directive processing through Wave container builds
- Use HxClient API for HTTP requests (aligned with lib-httpx refactor)
- Add comprehensive package management documentation
- Remove deprecated Pixi implementation in favor of unified system
- Add integration tests for package management workflows

This enables the `package` directive to work seamlessly with Wave
for building containers with the specified package dependencies.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support for Pixi
2 participants