Skip to content

build, run: Run Snakemake with --benchmark-extended#513

Merged
victorlin merged 6 commits intomasterfrom
victorlin/snakemake-benchmark-extended
Mar 20, 2026
Merged

build, run: Run Snakemake with --benchmark-extended#513
victorlin merged 6 commits intomasterfrom
victorlin/snakemake-benchmark-extended

Conversation

@victorlin
Copy link
Member

@victorlin victorlin commented Mar 18, 2026

This PR contains 4 prep commits, 1 main commit that closes #467, and 1 follow-up commit.

Checklist

  • Checks pass

  • Locally tested both build and run with measles

  • Locally tested compatibility with Snakemake v7

    cd measles
    git switch -d 9f8f3879~  # version of workflow compatible with Snakemake v7; see https://github.com/nextstrain/measles/commit/9f8f3879
    nextstrain build --image nextstrain/base:build-20250715T220354Z . --configfile build-configs/ci/config.yaml  # image with Snakemake with v7
    # runs fine
  • Update changelog

This only applies to --cores and --resources, not
--local-storage-prefix.
This is more consistent with the run and view commands.
@victorlin victorlin self-assigned this Mar 18, 2026
@victorlin victorlin force-pushed the victorlin/snakemake-benchmark-extended branch from 63b0216 to 928646e Compare March 18, 2026 23:59
@victorlin victorlin marked this pull request as draft March 18, 2026 23:59
@victorlin victorlin force-pushed the victorlin/snakemake-benchmark-extended branch from 928646e to 0fec61f Compare March 19, 2026 17:48
@victorlin victorlin changed the title build, run: Always run Snakemake with --benchmark-extended build, run: Run Snakemake with --benchmark-extended Mar 19, 2026
@victorlin victorlin force-pushed the victorlin/snakemake-benchmark-extended branch from 0fec61f to c996c7f Compare March 19, 2026 20:18
@victorlin victorlin marked this pull request as ready for review March 19, 2026 21:02
Comment on lines +455 to +469
def supports_benchmark_extended(opts) -> bool:
"""
Check if the runner's image or environment supports Snakemake's
``--benchmark-extended`` option (requires Snakemake ≥8.11.0).
"""
if opts.__runner__ in (docker, aws_batch, singularity):
image = runner.configured_image(opts)
if opts.__runner__ is singularity:
image = remove_prefix("docker://", image)
return docker.image_supports(docker.IMAGE_FEATURE.benchmark_extended, image)

if opts.__runner__ is conda:
return conda.env_supports(conda.ENV_FEATURE.benchmark_extended)

return False
Copy link
Member

Choose a reason for hiding this comment

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

What happens on ambient? Is directly interrogating the snakemake version acceptable?

Copy link
Member Author

Choose a reason for hiding this comment

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

It returns False and doesn't automatically add --benchmark-extended.

Copy link
Member Author

Choose a reason for hiding this comment

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

We could run snakemake --version and parse that, but I don't think it's worth the added complexity because this is currently all happening before actual invocation of Snakemake.

Copy link
Contributor

@joverlee521 joverlee521 left a comment

Choose a reason for hiding this comment

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

Thanks for working on this! I only left a small comment.

@victorlin victorlin force-pushed the victorlin/snakemake-benchmark-extended branch from c996c7f to d445976 Compare March 20, 2026 18:02
Commands used to find compatible versions for Docker¹ and Conda²:

    curl -s "https://registry.hub.docker.com/v2/repositories/nextstrain/base/tags?page_size=1000" \
      | jq -r '.results[].name | select(startswith("build-20250717"))'
    micromamba search -c nextstrain "nextstrain-base >20250716,<20250718"

¹ nextstrain/docker-base@0d9577d
² nextstrain/conda-base@0d7a87f
@victorlin victorlin force-pushed the victorlin/snakemake-benchmark-extended branch from d445976 to 6724e91 Compare March 20, 2026 18:14
@victorlin victorlin merged commit 1867fd6 into master Mar 20, 2026
115 of 116 checks passed
@victorlin victorlin deleted the victorlin/snakemake-benchmark-extended branch March 20, 2026 20:41
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.

build/run: Add Snakemake's --benchmark-extended as a default flag

3 participants