Use Fusion trace metrics to replace bash command-trace wrapper#7041
Merged
pditommaso merged 4 commits intomasterfrom Apr 20, 2026
Merged
Use Fusion trace metrics to replace bash command-trace wrapper#7041pditommaso merged 4 commits intomasterfrom
pditommaso merged 4 commits intomasterfrom
Conversation
When Fusion filesystem is enabled, task metrics (CPU, memory, I/O) are collected by the Fusion client and written to .fusion/trace.json. This change extends Nextflow to use those metrics directly, replacing the bash command-trace.txt wrapper script. Key changes: - TraceRecord.parseFusionTraceFile now returns the full parsed JSON - TaskHandler.applyFusionMetrics maps proc/cgroup/gpu sections to TraceRecord fields, preferring cgroup memory metrics over proc - BashWrapperBuilder skips the trace wrapper when Fusion trace is active - TaskHandler.getTraceRecord skips .command.trace parsing accordingly - Global.isFusionTraceEnabled() controls the feature via NXF_FUSION_TRACE env variable (defaults to true) - TaskProcessor.isFusionEnabled() exposes executor fusion state Signed-off-by: Paolo Di Tommaso <paolo@seqera.io> Signed-off-by: Paolo Di Tommaso <paolo.ditommaso@gmail.com>
✅ Deploy Preview for nextflow-docs-staging ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
jordeu
approved these changes
Apr 20, 2026
Peak RSS is more representative than the last-sampled memory_rss, which Fusion overwrites post-exit. Aligns %mem with peak_rss reported in the trace. Signed-off-by: Paolo Di Tommaso <paolo.ditommaso@gmail.com> Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Signed-off-by: Paolo Di Tommaso <paolo.ditommaso@gmail.com>
Signed-off-by: Paolo Di Tommaso <paolo.ditommaso@gmail.com> Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Signed-off-by: Paolo Di Tommaso <paolo.ditommaso@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
.fusion/trace.json(proc, cgroup, gpu sections) to populate TraceRecord fields, replacing the bashcommand-trace.txtwrapper scriptNXF_FUSION_TRACEenv variable (defaults totrue); set tofalseto revert to legacy behaviorChanges
Global.groovyisFusionTraceEnabled()readingNXF_FUSION_TRACEenv varTraceRecord.groovyparseFusionTraceFilereturns full JSON; addtoLong/toFloathelpersTaskHandler.groovyapplyFusionMetricsmaps Fusion JSON to TraceRecord; skip.command.tracewhen activeBashWrapperBuilder.groovyTaskBean.groovyfusionEnabledfieldTaskProcessor.groovyisFusionEnabled()Trace field mapping
realtimeproc.realtime%cpuproc.pct_cpucpu_modelproc.cpu_namerchar,wcharproc.rchar,proc.wcharsyscr,syscwproc.syscr,proc.syscwread_bytes,write_bytesproc.read_bytes,proc.write_bytesvol_ctxt,inv_ctxtproc.vol_ctxt,proc.inv_ctxtvmemcgroup.memory_currentrsscgroup.memory_rsspeak_vmemcgroup.memory_peakpeak_rsscgroup.memory_peak_rss%memmemory_rss / memory_limit * 100Test plan
.command.tracewhen activefusionEnabledon TaskBean🤖 Generated with Claude Code