Skip to content

Conversation

@pditommaso
Copy link
Member

@pditommaso pditommaso commented Dec 5, 2025

Summary

Add support for specifying build templates in Wave container builds. This allows users to select optimized multi-stage build templates for smaller container images.

Changes

  • Added template field to BuildOpts in WaveConfig.groovy
  • Added buildTemplate() getter method in WaveConfig
  • Added buildTemplate field to SubmitContainerTokenRequest
  • Updated WaveClient to include buildTemplate in API requests
  • Added wave.build.conda.baseImage config option for multi-stage builds
  • Added tests for the new configuration options
  • Updated documentation in docs/wave.md and docs/reference/config.md

Configuration

wave {
    enabled = true
    build {
        template = 'conda/pixi:v1'
        conda {
            baseImage = 'debian:12'  // Custom base image for final stage
        }
    }
}

Supported Templates

Template Description
(default) Standard Micromamba v1 single-stage build
conda/micromamba:v2 Multi-stage build using Micromamba 2.x
conda/pixi:v1 Multi-stage build using Pixi package manager
cran/installr:v1 R/CRAN packages using installr

New Configuration Options

Option Description Default
wave.build.template Build template to use conda/micromamba:v1
wave.build.conda.baseImage Base image for final stage in multi-stage builds ubuntu:24.04

Note: wave.build.conda.baseImage only applies when using conda/micromamba:v2 or conda/pixi:v1 templates.

Benefits of Multi-stage Templates

  • Smaller images: Build tools excluded from final image (30-50% size reduction)
  • Reproducibility: Lock files generated for exact package versions
  • Security: Fewer binaries reduces attack surface

Test Plan

  • Added unit test for buildTemplate configuration
  • Added unit test for baseImage configuration
  • Updated toString() test to include new fields
  • Verified compilation passes
  • All nf-wave tests pass

🤖 Generated with Claude Code

Add support for specifying build templates in Wave container builds.
This allows users to select optimized multi-stage build templates
like `conda/pixi/v1` or `conda/micromamba/v2` for smaller container
images.

Supported templates:
- conda/pixi/v1: Pixi package manager with multi-stage builds
- conda/micromamba/v2: Micromamba 2.x with multi-stage builds
- cran/installr/v1: R/CRAN packages using installr

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

Co-Authored-By: Claude <noreply@anthropic.com>
@pditommaso pditommaso requested a review from a team as a code owner December 5, 2025 13:41
@netlify
Copy link

netlify bot commented Dec 5, 2025

Deploy Preview for nextflow-docs-staging ready!

Name Link
🔨 Latest commit 75a56da
🔍 Latest deploy log https://app.netlify.com/projects/nextflow-docs-staging/deploys/6939af38249c4e0008aef06b
😎 Deploy Preview https://deploy-preview-6639--nextflow-docs-staging.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@pditommaso pditommaso marked this pull request as draft December 5, 2025 13:42
@christopher-hakkaart
Copy link
Collaborator

Docs are already very good.

Minor point, I think the default behavior could also be described in terms of how it is set.

I.e., Can (or should) a user set wave.build.template = 'default' to get the default behavior? Or just not set anything?

@pditommaso
Copy link
Member Author

Fair! add a look at latest commit

pditommaso and others added 2 commits December 5, 2025 15:12
Co-authored-by: Chris Hakkaart <chris.hakkaart@seqera.io>
Signed-off-by: Paolo Di Tommaso <paolo.ditommaso@gmail.com>
Co-authored-by: Chris Hakkaart <chris.hakkaart@seqera.io>
Signed-off-by: Paolo Di Tommaso <paolo.ditommaso@gmail.com>
@christopher-hakkaart

This comment was marked as outdated.

Update build template syntax from `<scope>/<name>/<version>` to
`<scope>/<name>:<version>` to match the Wave API specification.

Examples:
- conda/pixi:v1
- conda/micromamba:v1
- conda/micromamba:v2
- cran/installr:v1

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Signed-off-by: Paolo Di Tommaso <paolo.ditommaso@gmail.com>
@pditommaso pditommaso marked this pull request as ready for review December 10, 2025 15:52
Signed-off-by: Paolo Di Tommaso <paolo.ditommaso@gmail.com>

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Signed-off-by: Paolo Di Tommaso <paolo.ditommaso@gmail.com>
@pditommaso pditommaso merged commit d08a895 into master Dec 13, 2025
26 checks passed
@pditommaso pditommaso deleted the add-wave-build-template branch December 13, 2025 16:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants