Skip to content

build_task_spec omits container and lifecycle.cost_limit, so a job cannot be pinned or cost-capped #12

Open

Description

@scttfrdmn

What I was doing

Writing a Shape-F cookbook recipe for Snakemake, as the counterpart to the shipped nf-spawn one (wildcard scatter-gather rather than a fixed fan-out+join). It stalled on two TaskSpec fields this adapter never emits, and they share one root: build_task_spec builds a minimal spec.

# snakemake_executor_plugin_spawn/taskspec.py:141
return {
    "task_id": task_id,
    "command": command,
    "resources": resources,
    "lifecycle": {"ttl": ttl, "on_complete": on_complete},
}

1. No container, so there is no way to pin the software a rule runs

container appears nowhere in the package — zero matches for container|apptainer|singularity|docker across snakemake_executor_plugin_spawn/, and examples/Snakefile has no container: either. The job therefore runs on the host, and the scientific tool has to already be there or be installed by the rule.

That is the one structural difference from nf-spawn, where each process names its own image and spawn installs Docker on demand and runs it. Here the instance is a bare AL2023 box.

In principle Snakemake's own container: directive plus --software-deployment-method apptainer should ride along, since remote_command = self.format_job_exec(job) (executor.py:89) re-invokes Snakemake with the workflow's settings. But build_install_preamble (bootstrap.py:34) installs only python3.11 + snakemake + the S3 storage plugin, and AL2023 ships no apptainer (it is an EPEL package, and AL2023 does not enable EPEL). So the deployment flag would reach the remote invocation and then fail for want of a runtime — which means a rule would have to install its own container runtime, i.e. rebuild the thing spawn already does when container is set in the spec.

The ask: pass a rule's container: through to spec.container so spawn's existing container path handles it (Docker install, digest pull, private-ECR auth, GPU flags). That is one field in build_task_spec and one lookup of the job's container image, and it would make the adapter's provenance story match nf-spawn's. Alternatively, install apptainer in the preamble when a deployment method is in use — but routing through spec.container seems strictly better, since it inherits the correctness that path already has.

2. No lifecycle.cost_limit, and no flag for one

spawn has supported lifecycle.cost_limit since 0.103.0, and this adapter sets only ttl + on_complete. The flag list is --spawn-workdir-s3, --spawn-region, --spawn-ttl, --spawn-instance-type, --spawn-spot — no cost option.

So the only ceiling on a job is TTL, and the default is 4h (executor.py:63). A fan-out of N jobs therefore has a worst case of N × 4h × the instance rate with no second belt, and a workflow that hangs rather than fails burns all of it. For a cookbook whose standing rule is a TTL and a cost cap on every launch, that is the blocker rather than an inconvenience — I can set --spawn-ttl tightly, but I cannot express "stop at $0.05".

The ask: a --spawn-cost-limit setting threaded into build_task_spec's lifecycle. Mirrors --spawn-ttl exactly; happy to send the PR for both this and the container field if the shape above is what you want.

Why the pair matters together

They are the two fields that make a spawn task reproducible and bounded. nf-spawn has the first and the cookbook supplies the second per spec; this adapter has neither, which is what keeps an otherwise-working executor out of a catalog that pins every image by digest and caps every launch. Everything else about it worked on inspection — sizing from threads/resources.mem_mb, the s3_read_write scoping so the instance profile grants exactly the storage buckets the remote command names (taskspec.py docstring), and reading the durable completion record rather than an exit code.

Activity

  1. scttfrdmn commented on Oct 4, 2026

    @scttfrdmn
    ContributorAuthor

    Correcting myself on part 1 — routing container: to spec.container is the wrong fix

    I suggested "pass a rule's container: through to spec.container so spawn's existing container path handles it." Don't do that — it cannot work with this adapter's architecture, and I'd rather say so before someone implements it.

    The reason is that spec.command here is not the rule's shell command. It's a Snakemake re-invocation:

    # executor.py:89
    remote_command = self.format_job_exec(job)
    # → python -m snakemake --snakefile … --mode remote --target-jobs …

    So putting the science image in spec.container would make spawn run python -m snakemake --mode remote inside e.g. quay.io/aarchbio/fastqc@sha256:… — which has no Snakemake, no storage plugin, and no Python environment for either. It would fail immediately, and for a confusing reason.

    What is actually true, checked rather than reasoned

    Snakemake already forwards the deployment setting to the node. RealExecutor.format_job_exec composes general_args from SpawnedJobArgsFactory.general_args, which includes:

    w2a("deployment_settings.deployment_method"),
    w2a("deployment_settings.apptainer_prefix"),
    w2a("deployment_settings.apptainer_args", base64_encode=True),
    

    and DeploymentMethod is [CONDA, APPTAINER, ENV_MODULES]. So submitting with --software-deployment-method apptainer means the node's remote Snakemake already receives the instruction and will try to run the rule's shell inside the rule's container itself. Snakemake owns the containerisation; the executor never needs to know about images at all.

    What's missing is only the runtime: build_install_preamble (bootstrap.py:34) installs python3.11 + snakemake + the S3 plugin, and nothing else. AL2023 has no apptainer — it's an EPEL package and AL2023 doesn't enable EPEL — so the flag arrives on a box that can't act on it.

    So the ask on part 1 changes shape: make the node able to honour the deployment method the submitter already passes. Apptainer publishes el9 RPMs (apptainer-X.Y.Z-1.el9.aarch64.rpm) that install cleanly on AL2023, so it is pinnable — which matters, because an unpinned container runtime would reintroduce the problem in #13 one layer down.

    That is a bigger and more opinionated change than one field, and it needs your call on two things I shouldn't pick unilaterally:

    1. Always install apptainer, or only when a deployment method is set? Conditional keeps the common path fast (the preamble is already guarded so a prebuilt AMI is a near no-op), but means the preamble has to see the workflow's deployment settings.
    2. Pin where? A hardcoded default version plus a --spawn-apptainer-version override would match how --spawn-ttl works, and keeps The documented install fails (not on PyPI), and the on-instance bootstrap resolves unpinned specs per job #13's "record what actually ran" property.

    I'm happy to implement whichever shape you prefer, but I'm not going to guess at installing a container runtime inside someone else's adapter.

    Part 2 (cost_limit) is unaffected and genuinely one field

    That half stands exactly as filed, and it's small and certain, so I've sent it on its own: it adds --spawn-cost-limit threaded into build_task_spec's lifecycle, mirroring --spawn-ttl. Splitting it out means the easy guardrail lands without waiting on the apptainer design discussion. I'd suggest keeping this issue open for part 1 and tracking part 2 by the PR.

  2. scttfrdmn commented on Oct 4, 2026

    @scttfrdmn
    ContributorAuthor

    Withdrawing PR #14 — I shouldn't have pushed code to this repo

    I opened #14 by committing a branch directly here. That was out of bounds: I should file issues and leave implementation to you, and I've been told so. PR #14 is closed and the feat/cost-limit branch is deleted — this repo is back to exactly main as it was, and I have changed nothing else in it.

    Dropping the work entirely would waste the diagnosis, so it's below as a patch you can apply or ignore. It is not a request for review; it's the issue's content in a more precise form.

    What it does

    Adds --spawn-cost-limit, threaded into build_task_spec's lifecycle, mirroring --spawn-ttl. Three choices in it, each of which could have gone the other way:

    • Omitted when unset, not defaulted. spawn reads an absent cost_limit as "no ceiling", so a default would impose a guardrail the caller never asked for and change behaviour for every existing workflow.
    • Per-rule resources: spawn_cost_limit= beats the workflow-wide flag — the precedence spawn_instance_type already has over --spawn-instance-type. One cap has to be sized for the most expensive rule, which leaves every cheaper rule effectively uncapped.
    • A set value passes through unvalidated. Silently dropping a nonsensical 0 would leave the job uncapped — the exact failure the field prevents — so spawn should reject it loudly at launch.

    What I verified before withdrawing it

    • 36 tests pass (6 new), ruff check . clean, mypy clean.
    • The flag is surfaced by snakemake --help built as a wheel, not editable — CLAUDE.md notes editable installs aren't discovered, so the editable check would have proved nothing.
    • Both CI checks (Test, composition) passed on the PR before I closed it.
    • One harness note if you do pick this up: run_job unlinks the temp spec file once dispatch returns, so a test must read the TaskSpec inside the fake _run_argv. Reading it afterwards fails with FileNotFoundError.
    The patch (git apply-able against main)
    diff --git a/CHANGELOG.md b/CHANGELOG.md
    index a9cded6..fc27249 100644
    --- a/CHANGELOG.md
    +++ b/CHANGELOG.md
    @@ -8,6 +8,21 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
     ## [Unreleased]
     
     ### Added
    +- **`--spawn-cost-limit`: a spend ceiling per job, beside the TTL.** A job's only
    +  bound was `--spawn-ttl`, defaulting to **4h**, so a fan-out of N jobs had a worst
    +  case of N x 4h x the instance rate with no second belt — and a workflow that hangs
    +  rather than fails burns all of it. `spawn` has supported `lifecycle.cost_limit`
    +  since 0.103.0 and this adapter never emitted it; now it does, with the same
    +  precedence `spawn_instance_type` already has: a per-rule
    +  `resources: spawn_cost_limit=0.50` overrides the workflow-wide flag, because a
    +  single cap has to be sized for the most expensive rule and so leaves every cheaper
    +  rule effectively uncapped. Unset is unchanged — the field is **omitted** rather
    +  than defaulted, since spawn reads an absent `cost_limit` as "no ceiling" and
    +  inventing a number would impose a guardrail the caller never asked for. A value
    +  that is set is passed through verbatim rather than validated here: dropping a
    +  nonsensical one would leave the job silently *uncapped*, which is the failure the
    +  field exists to prevent, so spawn rejects it loudly at launch instead.
    +  (spore-host/snakemake-executor-plugin-spawn#12)
     - CI workflow to publish `snakemake-executor-plugin-spawn` to PyPI on a
       `python-vX.Y.Z` tag, via PyPI Trusted Publishing (OIDC, no stored API token)
       in a dedicated `pypi` GitHub environment — the same mechanism `python-sdk`
    diff --git a/README.md b/README.md
    index d8244a6..ff27f73 100644
    --- a/README.md
    +++ b/README.md
    @@ -31,6 +31,7 @@ snakemake \
       --default-storage-prefix s3://my-bucket/snakemake-runs \
       --spawn-region us-east-1 \
       --spawn-ttl 4h \
    +  --spawn-cost-limit 0.50 \
       --jobs 8 \
       <target>

    diff --git a/snakemake_executor_plugin_spawn/init.py b/snakemake_executor_plugin_spawn/init.py
    index 8fa0d3f..fb3e861 100644
    --- a/snakemake_executor_plugin_spawn/init.py
    +++ b/snakemake_executor_plugin_spawn/init.py
    @@ -42,6 +42,18 @@ class ExecutorSettings(ExecutorSettingsBase):
    default=None,
    metadata={"help": "TTL backstop per job instance (e.g. 4h). Default 4h.", "env_var": True},
    )

    • cost_limit: Optional[float] = field(

    •    default=None,
      
    •    metadata={
      
    •        "help": (
      
    •            "Spend ceiling in USD per job instance, enforced by spawn "
      
    •            "(lifecycle.cost_limit). A second belt beside the TTL: TTL bounds "
      
    •            "how long a job may run, this bounds what it may cost. Per-rule "
      
    •            "override: resources: spawn_cost_limit=0.50."
      
    •        ),
      
    •        "env_var": True,
      
    •    },
      
    • )
      instance_type: Optional[str] = field(
      default=None,
      metadata={"help": "Override the auto-sized EC2 instance type for every job."},
      diff --git a/snakemake_executor_plugin_spawn/executor.py b/snakemake_executor_plugin_spawn/executor.py
      index 0a7cc86..6ead165 100644
      --- a/snakemake_executor_plugin_spawn/executor.py
      +++ b/snakemake_executor_plugin_spawn/executor.py
      @@ -62,6 +62,23 @@ class SpawnExecutor(RemoteExecutor):
      def _ttl(self) -> str:
      return getattr(self.settings, "ttl", None) or os.environ.get("SPAWN_TTL", "4h")

    • def _cost_limit(self, job: "JobExecutorInterface") -> "float | None":

    •    """USD ceiling for this job, or None for no ceiling.
      
    •    Per-rule ``resources: spawn_cost_limit=`` wins over the workflow-wide
      
    •    setting, mirroring how ``spawn_instance_type`` overrides ``--spawn-instance-type``:
      
    •    a cap that has to be one number for every rule is a cap sized for the most
      
    •    expensive rule, which is no cap at all for the rest.
      
    •    """
      
    •    raw = job.resources.get("spawn_cost_limit")
      
    •    if raw is None:
      
    •        raw = getattr(self.settings, "cost_limit", None)
      
    •    if raw is None:
      
    •        raw = os.environ.get("SPAWN_COST_LIMIT")
      
    •    if raw is None or raw == "":
      
    •        return None
      
    •    return float(raw)
      
    • def _task_id(self, job: "JobExecutorInterface") -> str:
      # Fold the attempt into the id: it names the instance AND keys the
      # completion record (tasks//completion.json), so a retry must not read
      @@ -98,6 +115,7 @@ class SpawnExecutor(RemoteExecutor):
      instance_hint=self._instance_hint(job),
      spot=bool(getattr(self.settings, "spot", False)),
      ttl=self._ttl(),

    •        cost_limit=self._cost_limit(job),
             on_complete="terminate",
         )
         with tempfile.NamedTemporaryFile(
      

    diff --git a/snakemake_executor_plugin_spawn/taskspec.py b/snakemake_executor_plugin_spawn/taskspec.py
    index 8b6ead0..18c0d6f 100644
    --- a/snakemake_executor_plugin_spawn/taskspec.py
    +++ b/snakemake_executor_plugin_spawn/taskspec.py
    @@ -108,6 +108,7 @@ def build_task_spec(
    instance_hint: Optional[str] = None,
    spot: bool = False,
    ttl: str = "4h",

    • cost_limit: Optional[float] = None,
      on_complete: str = "terminate",
      ) -> dict:
      """Build the TaskSpec dict for one Snakemake job. Pure.
      @@ -139,11 +140,20 @@ def build_task_spec(
      if rw:
      resources["s3_read_write"] = rw

    • lifecycle: dict = {"ttl": ttl, "on_complete": on_complete}

    • Omitted rather than defaulted when unset: spawn treats an absent

    • lifecycle.cost_limit as "no ceiling", and emitting a number we invented would

    • be a guardrail the caller never asked for. Passed through verbatim otherwise —

    • spawn validates the value, so a nonsensical one fails loudly at launch instead

    • of being silently dropped here (which would leave the job uncapped).

    • if cost_limit is not None:

    •    lifecycle["cost_limit"] = cost_limit
      
    • return {
      "task_id": task_id,
      "command": command,
      "resources": resources,

    •    "lifecycle": {"ttl": ttl, "on_complete": on_complete},
      
    •    "lifecycle": lifecycle,
      
      }

    diff --git a/tests/test_executor.py b/tests/test_executor.py
    index 6977b0b..31180fb 100644
    --- a/tests/test_executor.py
    +++ b/tests/test_executor.py
    @@ -4,7 +4,9 @@ RemoteExecutor.init and inject the collaborators the methods touch.
    """

    import asyncio
    +import json
    import types
    +from pathlib import Path

    from snakemake_executor_plugin_spawn.executor import SpawnExecutor
    from snakemake_interface_executor_plugins.executors.base import SubmittedJobInfo
    @@ -30,7 +32,12 @@ def _make_executor(run_calls, settings=None):
    """A SpawnExecutor with init bypassed and collaborators faked."""
    ex = object.new(SpawnExecutor)
    ex.settings = settings or types.SimpleNamespace(

    •    region="us-east-1", ttl="1h", workdir_s3="s3://b/runs", instance_type=None, spot=False
      
    •    region="us-east-1",
      
    •    ttl="1h",
      
    •    workdir_s3="s3://b/runs",
      
    •    instance_type=None,
      
    •    spot=False,
      
    •    cost_limit=None,
      
      )
      ex.logger = types.SimpleNamespace(info=lambda *a, **k: None, warning=lambda *a, **k: None)
      ex.submitted = []
      @@ -44,6 +51,60 @@ def _make_executor(run_calls, settings=None):
      return ex

    +def _spec_capturing_executor(settings=None):

    • """An executor whose fake spawn CLI reads the TaskSpec while it still exists.
    • run_job unlinks the temp spec file once dispatch returns, so the assertion has
    • to happen inside the call, not after it.
    • """
    • seen: dict = {}
    • calls: list = []
    • def runner(argv, check):
    •    calls.append(list(argv))
      
    •    if argv[:3] == ["spawn", "task", "run"] and "--spec" in argv:
      
    •        seen["spec"] = json.loads(
      
    •            Path(argv[argv.index("--spec") + 1]).read_text()
      
    •        )
      
    •    return FakeCompleted(0, "")
      
    • ex = _make_executor(calls, settings=settings)
    • ex._run_argv = runner
    • return ex, seen

    +def _settings(**over):

    • base = dict(
    •    region="us-east-1", ttl="1h", workdir_s3="s3://b/runs",
      
    •    instance_type=None, spot=False, cost_limit=None,
      
    • )
    • base.update(over)
    • return types.SimpleNamespace(**base)

    +def test_cost_limit_absent_from_spec_by_default():

    • ex, seen = _spec_capturing_executor()
    • ex.run_job(FakeJob())
    • assert "cost_limit" not in seen["spec"]["lifecycle"]

    +def test_cost_limit_from_settings_reaches_the_spec():

    • ex, seen = _spec_capturing_executor(_settings(cost_limit=0.25))
    • ex.run_job(FakeJob())
    • assert seen["spec"]["lifecycle"]["cost_limit"] == 0.25

    +def test_per_rule_resource_overrides_the_workflow_setting():

    • A single workflow-wide cap has to be sized for the most expensive rule, which

    • leaves every cheaper rule effectively uncapped — so the per-rule resource wins,

    • the same precedence spawn_instance_type already has over --spawn-instance-type.

    • ex, seen = _spec_capturing_executor(_settings(cost_limit=0.25))
    • job = FakeJob()
    • job.resources["spawn_cost_limit"] = 2.0
    • ex.run_job(job)
    • assert seen["spec"]["lifecycle"]["cost_limit"] == 2.0

    def test_run_job_dispatches_detached_and_reports_submission():
    calls = []
    ex = _make_executor(calls)
    diff --git a/tests/test_taskspec.py b/tests/test_taskspec.py
    index 31b9bd0..7af567a 100644
    --- a/tests/test_taskspec.py
    +++ b/tests/test_taskspec.py
    @@ -79,6 +79,29 @@ def test_lifecycle_defaults_terminate():
    assert _spec(ttl="2h")["lifecycle"] == {"ttl": "2h", "on_complete": "terminate"}

    +def test_cost_limit_omitted_when_unset():

    • The default spec must be byte-identical to before cost_limit existed: spawn

    • reads an absent lifecycle.cost_limit as "no ceiling", and inventing a number

    • would impose a guardrail the caller never asked for.

    • assert "cost_limit" not in _spec()["lifecycle"]

    +def test_cost_limit_emitted_when_set():

    • assert _spec(ttl="2h", cost_limit=0.5)["lifecycle"] == {
    •    "ttl": "2h",
      
    •    "on_complete": "terminate",
      
    •    "cost_limit": 0.5,
      
    • }

    [email protected]("bad", [0, -1.0])
    +def test_cost_limit_passed_through_verbatim(bad):

    • Not validated here on purpose. Dropping a nonsensical value would leave the

    • job silently UNCAPPED, which is the failure this field exists to prevent;

    • spawn validates it and fails the launch loudly instead.

    • assert _spec(cost_limit=bad)["lifecycle"]["cost_limit"] == bad

    def test_empty_preamble_still_runs_remote():
    inner = _spec(install_preamble="")["command"][2]
    assert REMOTE in inner

    
    </details>
    
    The two asks in this issue stand as filed: `cost_limit` (above) and `container`, where my original suggestion was wrong and the corrected shape — apptainer on the node — is in my earlier comment and needs your design call.
    
  3. scttfrdmn commented on Oct 4, 2026

    @scttfrdmn
    ContributorAuthor

    Reopening, belatedly — you asked for this to stay open for part 1 and I closed it anyway.

    Part 2 (--spawn-cost-limit) shipped in v0.3.0 and is correct; it stays.

    Part 1 is withdrawn from the code as of #17: the container: → spec.container route is removed, for exactly the reason you gave at 01:13Z and which I failed to read before implementing it 42 minutes later. Your run then proved it from the outside, which is a better argument than either of us reading source.

    The apptainer shape you described is the one I'd build, and the two questions you flagged are genuinely mine to answer rather than yours to guess:

    1. Always install apptainer, or only when a deployment method is set? Conditional. The preamble is already guarded so a prebuilt AMI is a near no-op, and installing a container runtime on every job to serve the subset that asks for one is the wrong default — especially since the install is the slowest thing in the preamble. That does mean the preamble has to see the workflow's deployment settings, which is a real cost: build_install_preamble is currently pure and takes no workflow state. I'd pass the resolved deployment method in as an argument rather than reaching for self.workflow inside it, so it stays testable.

    2. Pin where? A hardcoded default version plus --spawn-apptainer-version, matching how --spawn-ttl works — and defaulted the same way The documented install fails (not on PyPI), and the on-instance bootstrap resolves unpinned specs per job #13's specs now are, i.e. pinned rather than floating, so it can't reintroduce The documented install fails (not on PyPI), and the on-instance bootstrap resolves unpinned specs per job #13 one layer down. Echoing the resolved version into the job log too, for the same reason.

    Tracking the implementation on #16 since that issue carries the evidence; this one can close when that lands. Happy to have your PR for it if you'd rather — your #14 was correctly scoped and I should have just merged it.

  4. scttfrdmn commented on Oct 4, 2026

    @scttfrdmn
    ContributorAuthor

    Verified v0.4.0 from the consumer side

    Installed from the tag and checked the surface rather than the release note:

    $ snakemake --help | grep -oE '\-\-spawn-[a-z-]+' | sort -u
    --spawn-cost-limit
    --spawn-instance-type
    --spawn-region
    --spawn-snakemake-spec
    --spawn-spot
    --spawn-storage-spec
    --spawn-ttl
    --spawn-workdir-s3
    

    --spawn-container is gone and the cost cap plus the pinned-spec flags are intact. Removing it outright rather than caveating it is the right call — and the regression test naming the reason is the part that will matter in six months, because "surely it's just one field" is exactly how it arrived.

    On the crossed timeline: no hard feelings and nothing owed. I'd buried the retraction in a comment on an issue whose body still said the opposite, and a body-plus-code read is a reasonable way to work. The run settled it in an afternoon, which is the system working.

    The two decisions, answered as the consumer

    You said you'd rather answer these on the issue than guess, so here is what I'd want and why — though the second one is genuinely yours, since it's a maintenance cost you carry and I don't.

    1. Conditional, not always-install. Install apptainer only when the workflow's deployment method actually calls for it.

    The reason isn't speed, it's blast radius. Right now a Snakemake job on this executor needs python3.11 + two pip packages, and that is the entire node-side dependency surface. Adding an unconditional RPM install puts a second external dependency in the path of every job, including the majority that never containerise — so a workflow with no container: anywhere would start failing on an apptainer mirror hiccup it has no stake in. The preamble is already guarded on the venv, so the conditional costs one more if.

    The information is available: --software-deployment-method is in the workflow's settings and already forwarded to the node via general_args, so the executor can read whether APPTAINER is among them when it builds the preamble. If reaching that from build_install_preamble turns out awkward, a --spawn-apptainer opt-in would be a fine second-best — explicit beats clever, and a caller who wrote container: can be expected to say so once.

    2. Pin where: a module-level default plus a --spawn-apptainer-version override, matching how --spawn-ttl and --spawn-snakemake-spec already work.

    What I'd ask for beyond that is the thing #13 taught: echo the resolved apptainer version into the job's log. You already do this for the snakemake and storage specs, and it's what makes a run recoverable later even when someone loosens a pin on purpose. A container runtime that silently floats would reintroduce #13 one layer down, and the log line is what makes that detectable instead of theoretical.

    I'd lean against defaulting to "whatever the mirror serves" even transiently, because apptainer sits under the thing being pinned — if it moves, every image hash in the workflow is being resolved by a different runtime, and nothing in the output says so.

    Where this leaves the recipe

    Still blocked, and correctly so — a cookbook recipe here must pin the software a rule runs by digest, and with the passthrough withdrawn there's no route to that yet. No complaint: v0.4.0 is a more honest state than v0.3.0 was, and --spawn-cost-limit on its own already removed one of the two blockers. I'll pick the recipe up when shape (1) lands, and I'm happy to test a branch against real pinned arm64 images before you release it — that's the cheap way to avoid another round-trip, and it's about twenty minutes and three cents of Graviton time.

  5. scttfrdmn commented on Oct 4, 2026

    @scttfrdmn
    ContributorAuthor

    Both decisions taken as you've argued them, and the reasoning changed my default on the first one.

    1. Conditional. I had been leaning toward unconditional on "it's one RPM, keep the preamble simple" — which is the wrong frame, because the cost isn't complexity, it's blast radius. A workflow with no container: anywhere acquiring a dependency on an apptainer mirror is a failure mode with no upside for the majority of jobs, and if is cheap. --software-deployment-method already arriving in general_args makes it readable at preamble-build time, so I'll go that route and keep --spawn-apptainer in reserve only if that turns out awkward to reach.

    2. Module-level default plus --spawn-apptainer-version, matching --spawn-ttl / --spawn-snakemake-spec.

    And echoing the resolved version into the job log — agreed, and I'd go further: that is the actual lesson of #13, stated more generally than I'd stated it. The pin is what makes a run reproducible; the log line is what makes it diagnosable when someone loosens the pin deliberately. Those are different properties and only the first was handled. Your point that apptainer sits under the thing being pinned is the part that settles it — a floating runtime resolves every image digest in the workflow differently with nothing in the output saying so, which is #13 one layer down and harder to see. It'll be logged alongside the snakemake and storage specs.

    Taking you up on the branch test. Twenty minutes against real pinned arm64 images before a release is a much better deal than a round-trip after one, and it catches exactly the class my unit tests can't — I've just spent a session where the only three bugs that mattered in spawn's MPI path were invisible to code-reading and unit tests and obvious within two minutes on real hardware. I'll ping you here with a branch rather than tagging first.

    No timeline promise: shape (1) is a real piece of work, not a patch, and it's queued behind some launch-path fixes. I'd rather it arrive late than arrive like 0.3.0 did.

    Bookkeeping

    I'd like to close this issue and let #16 carry the container story. Both halves of what you filed here are resolved, in opposite directions:

    Keeping both open means two issues tracking one piece of work, and #16 is the one with the evidence in it. Say if you'd rather it stayed open as the consumer-facing thread and I'll leave it.

    On the crossed timeline: appreciated, but I'll keep the lesson rather than the absolution. The retraction being in a comment is exactly why "read the comments and the open PRs before implementing" is now something I do rather than something I intended to do — a body-plus-code read is reasonable right up until someone has already told you the answer.

  6. added this to the Hardening milestone on Nov 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions