Skip to content

Add ResourcesResolver for pre-flight resource optimization#6873

Draft
pditommaso wants to merge 1 commit intomasterfrom
resources-resolver
Draft

Add ResourcesResolver for pre-flight resource optimization#6873
pditommaso wants to merge 1 commit intomasterfrom
resources-resolver

Conversation

@pditommaso
Copy link
Member

Summary

  • Adds ADR for a plugin-based ResourcesResolver extension point that allows a scheduler optimization engine to dynamically adjust task resource allocation (cpus, memory, time, disk) before execution
  • Follows the ContainerResolver plugin pattern: interface in core, no-op default, overridden by nf-seqera plugin
  • Called from TaskProcessor.submitTask() after hash computation, before executor.submit()
  • Optimized values stored as overrides on TaskConfig, preserving original declared values

Test plan

  • Implement TaskConfig overrides map with tests
  • Create core extension point (interface, DTOs, default, provider)
  • Wire into TaskProcessor.submitTask()
  • Implement SeqeraResourcesResolver in nf-seqera plugin
  • Verify TraceRecord and TaskBean reflect overridden values
  • Integration test with mock resolver

🤖 Generated with Claude Code

Base automatically changed from sched to master February 27, 2026 17:52
…i skip]

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Paolo Di Tommaso <paolo.ditommaso@gmail.com>
@netlify
Copy link

netlify bot commented Feb 27, 2026

Deploy Preview for nextflow-docs-staging canceled.

Name Link
🔨 Latest commit 2205c1a
🔍 Latest deploy log https://app.netlify.com/projects/nextflow-docs-staging/deploys/69a21bcd87daa600082280cd

@pditommaso pditommaso force-pushed the master branch 2 times, most recently from d9fa5cd to d752bc2 Compare February 28, 2026 13:10

`TaskProcessor.submitTask()` — after hash computation, before `executor.submit()`. This means:

- The cache hash reflects **declared** (original) resources, not optimized ones — caching stays deterministic based on user intent.
Copy link
Member

Choose a reason for hiding this comment

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

This point is moot because resource requests aren't included in the task hash anyway

Copy link
Member Author

Choose a reason for hiding this comment

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

Good point

- container image
- process name
- attempt number
- task index
Copy link
Member

Choose a reason for hiding this comment

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

Is this the within-process index or within-run index? Not sure that it's relevant either way

Copy link
Member Author

Choose a reason for hiding this comment

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

Within run, but not really needed

- machineType
- resourceLimits (upper bounds)
- container image
- process name
Copy link
Member

@bentsherman bentsherman Mar 2, 2026

Choose a reason for hiding this comment

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

Base name or fully-qualified name? I assume it should be the base name

Copy link
Member Author

Choose a reason for hiding this comment

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

Actually right now it's using FQ name, however I agree it should not

- process name
- attempt number
- task index
- input files total size in bytes
Copy link
Member

Choose a reason for hiding this comment

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

Since this request is in-memory, I would just pass the raw data e.g. list of file names with sizes, or a map based on the process input names

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