Skip to content

Add resourceAllocation field to trace record#6973

Open
pditommaso wants to merge 3 commits intomasterfrom
add-resource-allocation-trace-field
Open

Add resourceAllocation field to trace record#6973
pditommaso wants to merge 3 commits intomasterfrom
add-resource-allocation-trace-field

Conversation

@pditommaso
Copy link
Copy Markdown
Member

Summary

  • Add resourceAllocation transient field to TraceRecord exposing scheduler-allocated resources (cpuShares, memoryMiB, accelerators, time)
  • Source the value from the last TaskAttempt.resources, falling back to TaskState.resourceAllocation when no attempts exist
  • Forward the field through TowerClient to the platform
  • Bump sched-client to 0.46.0-SNAPSHOT (renames TaskState.resourceRequirementresourceAllocation)

Test plan

  • Unit tests for getResourceAllocation() in SeqeraTaskHandlerTest (null state, single attempt, multiple attempts, fallback scenarios)
  • Unit test for resourceAllocation propagation in TowerClientTest.makeTasksReq()
  • Existing trace metadata test updated to verify resourceAllocation included in trace record

🤖 Generated with Claude Code

Expose scheduler-allocated resources (cpuShares, memoryMiB, accelerators,
time) in the trace record. The value is taken from the last TaskAttempt's
resources, falling back to the TaskState's resourceAllocation if no
attempts exist.

Also bump sched-client to 0.46.0-SNAPSHOT which renames
TaskState.resourceRequirement to resourceAllocation.

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

netlify bot commented Mar 25, 2026

Deploy Preview for nextflow-docs-staging canceled.

Name Link
🔨 Latest commit 63a908b
🔍 Latest deploy log https://app.netlify.com/projects/nextflow-docs-staging/deploys/69ca8f084ec7190008bbcd34

This reverts commit 00f35b3.

The accelerator and accelerator_type fields in the trace record are
superseded by the resourceAllocation field which carries the actual
scheduler-allocated resources including accelerator info.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Paolo Di Tommaso <paolo.ditommaso@gmail.com>
@pditommaso
Copy link
Copy Markdown
Member Author

@bentsherman have a look at this. I think we can remove accelerator for "classic" trace and only keep as platform trace via resourceAllocation

@pditommaso pditommaso requested a review from bentsherman March 30, 2026 14:55
@pditommaso pditommaso marked this pull request as ready for review March 30, 2026 14:55
Signed-off-by: Paolo Di Tommaso <paolo.ditommaso@gmail.com>
transient private ContainerMeta containerMeta
transient private Integer numSpotInterruptions
transient private String logStreamId
transient private Map<String,Object> resourceAllocation
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

not blocking, but the naming is a bit awkward. how about resourcesAllocated ?

Comment on lines -107 to -108
accelerator: 'num',
accelerator_type: 'str'
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

These fields denoted the requested accelerators. Now that you are moving them into the allocated resources, will they denote the accelerators allocated by sched?

def handler = createHandler()
handler.cachedTaskState = new SchedTaskState()
.resourceRequirement(new ResourceRequirement().time('2h'))
.resourceAllocation(new ResourceRequirement().time('2h'))
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Should ResourceRequirement be renamed to something like ResourceRequest ? Seems like here it is being used to model things other than hard requirements

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