Add staging events to the TraceObserverV2 #6443
Open
+63
−0
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.
This PR implements file staging event notifications for
TraceObserverV2
, allowing plugins to track when remote files are staged to the local work directory. This resolves #5905 by providing observers access to both the original remote file paths and their staged local paths.Background
Issue #5905 identified a need for provenance tracking plugins (specifically nf-lamin) to access the original remote paths of input files, not just their staged local paths. Two previous attempts were made to solve this:
onFileStage
toTraceObserver
- rejected in favor of Include remote path in FileHolder #5911FileHolder
to include remote paths - merged but then reverted due to concerns about cache invalidation and risk to core functionalityI met up with @bentsherman at the beginning of September. He said he wanted to have another shot at resolving this issue, and that I could reach out in a few weeks time if no progress was made.
Solution
This implementation is a simpler solution in comparison to the two previous PRs. I added this to the TraceObserverV2:
onFileStaged(FileStagingEvent event)
- Called after a file has been successfully staged from a remote locationThe
FileStagingEvent
provides:source
: The original remote path (e.g.,s3://bucket/file.txt
,https://example.com/data.csv
)target
: The staged local path in the work directory (e.g.,work/.../file.txt
)Usage Example
For plugins that need to track file provenance (like nf-lamin):
Related Issues