Skip to content

feat(wave): Support fetching local files in FUSION_CONTAINER_CONFIG_URL#7142

Merged
pditommaso merged 14 commits into
masterfrom
comp-869/local-fusion-manifest
May 27, 2026
Merged

feat(wave): Support fetching local files in FUSION_CONTAINER_CONFIG_URL#7142
pditommaso merged 14 commits into
masterfrom
comp-869/local-fusion-manifest

Conversation

@alberto-miranda

@alberto-miranda alberto-miranda commented May 13, 2026

Copy link
Copy Markdown
Collaborator

Description

This change allows FUSION_CONTAINER_CONFIG_URL (and the corresponding Nextflow config option fusion.containerConfigUrl) to accept a local filesystem path as an alternative to an http(s) URL. The path must be expressed as a file: URI.

Note

This PR resurrects #5738, adapted to the current changes in master.

Rationale

Today, FUSION_CONTAINER_CONFIG_URL only accepts http(s) URLs. The Wave client fetches the JSON manifest from the provider URL and applies the declared layers to the task container. This works fine in production, but makes iterating on manifest changes painful: any change (e.g. bumping a Fusion layer, swapping in a development build, or testing a new Fusion Snapshots variant) means publishing a new JSON to a reachable URL before every run, then chasing down stale artefacts in object storage afterwards.

By accepting a local manifest, it is possible to decouple the development loop from the production pipeline: engineers can edit a JSON on disk and re-run a pipeline immediately, instead of round-tripping every change through object storage and an externally reachable URL.

Changes

  1. Renamed FusionConfig.containerConfigUrl() to FusionConfig.containerConfigURI() (return type URLURI) so file: URIs travel cleanly through the resolution path.
  2. Relaxed FusionConfig.validProtocol() to also accept file: URIs.
  3. Updated the validation error message in FusionConfig.getConfig().
  4. WaveClient.resolveContainerConfig() now collects List<URI> (previously List<URL>).
  5. Ported replaceFusionArch() to accept URI (no-op on local manifests, since the arch-suffix regex doesn't match).
  6. Routing in new fetchContainerConfig(URI):
    • http/https to the existing HTTP path,
    • file: to a new fetchContainerConfig(Path) that reads from disk,
    • Anything else throws.
  7. Extra tests for the new logic in FusionConfigTest and WaveClientTest.

@alberto-miranda alberto-miranda self-assigned this May 13, 2026
@netlify

netlify Bot commented May 13, 2026

Copy link
Copy Markdown

Deploy Preview for nextflow-docs-staging canceled.

Name Link
🔨 Latest commit ebb19cf
🔍 Latest deploy log https://app.netlify.com/projects/nextflow-docs-staging/deploys/6a16bef4d2fd4c00084de942

…URL`

This change allows `FUSION_CONTAINER_CONFIG_URL` to accept a local
filesystem path (an absolute path or a `file://` URI) in addition to an
http(s) URL. This lets engineers iterate on Fusion manifests without
publishing them to a reachable URL on every change.

Signed-off-by: Alberto Miranda <alberto.miranda@seqera.io>
@alberto-miranda alberto-miranda force-pushed the comp-869/local-fusion-manifest branch from 681c19b to 4583a3d Compare May 13, 2026 14:20
@alberto-miranda

This comment was marked as outdated.

@pditommaso

This comment was marked as outdated.

@alberto-miranda

This comment was marked as outdated.

@pditommaso

This comment was marked as outdated.

Signed-off-by: Alberto Miranda <alberto.miranda@seqera.io>
@alberto-miranda

This comment was marked as outdated.

pditommaso

This comment was marked as outdated.

The previous `url.startsWith('file:')` check admitted shapes that later
crash deep in `Paths.get(URI)` (e.g. `file://host/...`,
`file:relative.json`). Parse to URI and require `scheme == 'file'`,
empty/null authority, and an absolute path so misconfigured values fail
fast with a clear error.

Signed-off-by: Alberto Miranda <alberto.miranda@seqera.io>
`fetchContainerConfig(Path)` surfaced raw NIO exceptions
(`NoSuchFileException`, `AccessDeniedException`, etc.) with no
indication that they came from the Fusion container config path. Wrap
in `IllegalStateException` carrying the offending path so failures are
attributable to the originating config value.

Signed-off-by: Alberto Miranda <alberto.miranda@seqera.io>
The `amd64`/`arm64` regex substitution applies to the entire URI
string regardless of scheme, so a local manifest at
`file:///path/fusion-amd64.json` is silently rewritten on `arm64`
tasks. Make the helper a no-op for `file:` URIs — users pointing at a
specific local file expect Wave to read exactly that file.

Signed-off-by: Alberto Miranda <alberto.miranda@seqera.io>
The `fetchContainerConfig(URI)` dispatcher is the only external entry
point, and it is already `@Memoized` — repeat calls for the same URI
never reach the `URL`/`Path` overloads. Their caches therefore hold
entries that can never be hit. Keep memoization on the dispatcher only.

Signed-off-by: Alberto Miranda <alberto.miranda@seqera.io>
Note the supported URL schemes in both the reference docs and the
`@Description` so users know `file:/...` is a valid value, not an
undocumented side-effect of the validator.

Signed-off-by: Alberto Miranda <alberto.miranda@seqera.io>
@alberto-miranda alberto-miranda requested a review from a team as a code owner May 15, 2026 17:24
@alberto-miranda

Copy link
Copy Markdown
Collaborator Author

@pditommaso I addressed your comments but the docs workflow seems to be failing because:

  1. imghdr was removed from the Python standard library in 3.13
  2. the repo pins sphinx==5.3.0 which still imports it
  3. the workflow pins python-version: '3.14'

I'm happy to fix it in this PR or a follow up, but don't want to muck up the existing setup, so I would appreciate some guidance on the preferred approach 🙏

@pditommaso

Copy link
Copy Markdown
Member

Sorry for the long delay. All set here!

…ast]

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Signed-off-by: Paolo Di Tommaso <paolo.ditommaso@gmail.com>
@pditommaso pditommaso merged commit 0d1ece8 into master May 27, 2026
13 checks passed
@pditommaso pditommaso deleted the comp-869/local-fusion-manifest branch May 27, 2026 10:06
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.

2 participants