Skip to content

test: cover case equivalent to test_singularity_conda in snakemake - #30

Open
Hocnonsense wants to merge 5 commits into
mainfrom
fix/test_singularity_conda
Open

test: cover case equivalent to test_singularity_conda in snakemake#30
Hocnonsense wants to merge 5 commits into
mainfrom
fix/test_singularity_conda

Conversation

@Hocnonsense

@Hocnonsense Hocnonsense commented Aug 8, 2026

Copy link
Copy Markdown

Added a test to reproduce what happened in snakemake/snakemake#3339

Summary by CodeRabbit

  • Bug Fixes

    • Improved execution of workloads configured to run inside Apptainer containers.
  • Tests

    • Added coverage for Apptainer-based container execution.
    • Tests use an updated Miniforge environment and Apptainer runtime settings.
    • Tests automatically skip when Apptainer is unavailable.
    • Documented an intermittent startup hang related to SquashFS/FUSE behavior.
    • Continuous integration now provisions Apptainer on supported Linux environments.

@coderabbitai

coderabbitai Bot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 73431389-2fb1-46bb-81a5-b9974d001006

📥 Commits

Reviewing files that changed from the base of the PR and between f69da67 and 6aeb920.

📒 Files selected for processing (2)
  • src/snakemake_software_deployment_plugin_conda/__init__.py
  • tests/test_plugin.py

📝 Walkthrough

Walkthrough

The plugin clears nested container settings before pickling an execution environment. The test suite adds conditional Apptainer coverage. Linux CI installs Apptainer 1.5.3 for testing.

Changes

Apptainer container execution

Layer / File(s) Summary
Execution environment serialization
src/snakemake_software_deployment_plugin_conda/__init__.py
_run_method copies the environment specification and clears spec.within before pickling.
Apptainer execution test and CI setup
tests/test_plugin.py, .github/workflows/ci.yml
The test suite adds TestWithinContainerApptainer, conditional skipping, a Miniforge image, and Runtime.APPTAINER. The Linux testing workflow installs Apptainer version 1.5.3.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested reviewers: johanneskoester

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: adding coverage for behavior equivalent to Snakemake's test_singularity_conda.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/test_singularity_conda

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@Hocnonsense
Hocnonsense force-pushed the fix/test_singularity_conda branch from ed9ed03 to a327370 Compare August 8, 2026 13:27
@Hocnonsense

Copy link
Copy Markdown
Author

Hi @johanneskoester,

I added TestWithinContainerApptainer to reproduce the hang of test_singularity_conda described in snakemake/snakemake#3339 (comment).

In short, the test runs the deployment logic inside the container: snakemake_software_deployment_plugin_conda (which depends on rattler) is re-imported inside the container.
Here, however, the issue does not hang but fails explicitly with a subprocess.CalledProcessError: the command apptainer exec ... docker://condaforge/miniforge3:26.3.2-3 bash -c '(which pip >&2 || ...) && pip install ... && python -c "import ..."' returns a non-zero exit status.

Could you please confirm whether this CI failure is related to snakemake#3339, and how you would like to proceed (e.g., fall back to the conda binary, skip this in the snakemake test, or any other workaround)? I've also opened an upstream issue to track it: apptainer/apptainer#3688.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/ci.yml:
- Around line 54-58: Update the Linux CI configuration around the Setup
Apptainer step so TestWithinContainerApptainer does not run in the required job
while its apptainer exec failure remains unresolved. Move the test to a
non-required job or add a targeted skip for the affected condition, without
using broad continue-on-error.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 821ae96e-a3f2-4404-89c5-276261deaf46

📥 Commits

Reviewing files that changed from the base of the PR and between ed9ed03 and f69da67.

📒 Files selected for processing (2)
  • .github/workflows/ci.yml
  • tests/test_plugin.py
🚧 Files skipped from review as they are similar to previous changes (1)
  • tests/test_plugin.py

Comment thread .github/workflows/ci.yml
@Hocnonsense

Hocnonsense commented Aug 12, 2026

Copy link
Copy Markdown
Author

@johanneskoester Update: both the Apptainer hang and the newly exposed failing test is addressed as well:

  1. Apptainer hang: test: change dependencies snakemake#4274 switches CI to a system-level Apptainer instead of the conda-forge one (until squashfuse_ll from conda-forge hangs on reads, while the same squashfuse 0.6.2 built by Apptainer works conda-forge/squashfuse-feedstock#21 is fixed). The root cause is a bug in the conda-forge squashfuse_ll binary, not in Apptainer itself. A system-level Apptainer is used in the test here, too.
  2. ModuleNotFoundError: No module named 'snakemake_software_deployment_plugin_container' surfaced once the hang was gone (in #4274's CI run): Fixed in test: cover case equivalent to test_singularity_conda in snakemake #30 by stripping Env.spec.within before pickling, the same way Env.within is already handled.

Waiting for your review!

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.

1 participant