Skip to content

Conversation

jorgee
Copy link
Contributor

@jorgee jorgee commented Aug 26, 2025

close #6311

unstage_controls was set in .command.run using the same condition as the unstage outputs. It was producing an error message in .command.log when using the storeDir. However, control logs (.command.err, .command.out, etc.) are always copied to the working directory.

This PR changes the condition when the unstage_controls is set. A new method shouldUnstageControls is created to differentiate the condition when checking the outputs or controls. By default, it is set to false, the unstage controls will be applied if scratch is defined. There is a special case for Azure, where boths controls and outputs are forced to be unstaged

Copy link

netlify bot commented Aug 26, 2025

Deploy Preview for nextflow-docs-staging canceled.

Name Link
🔨 Latest commit e63c1e4
🔍 Latest deploy log https://app.netlify.com/projects/nextflow-docs-staging/deploys/68ad953b6d4fff00084107a5

@jorgee jorgee requested a review from bentsherman August 26, 2025 12:25
@@ -160,6 +160,10 @@ class BashWrapperBuilder {
return targetDir && workDir!=targetDir
}

protected boolean shouldUnstageControls() {
return false
Copy link
Member

Choose a reason for hiding this comment

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

I wonder if this should not default to shouldUnstageOutputs()

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, the issue was caused because it was using shouldUnstageOutputs in both outputs and controls. If we default to shouldUnstageOutputs we will not solve the issue.

Copy link
Member

Choose a reason for hiding this comment

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

Not sure Jorge, especially this

However, control logs (.command.err, .command.out, etc.) are always copied to the working directory.

Only the .command.log and .command.begin and .exitcode are created directly in the (target) work dir. The stage controls are these below and follow the usual logic as for output files

def result = copyFileToWorkDir(TaskRun.CMD_OUTFILE) + ' || true' + ENDL
result += copyFileToWorkDir(TaskRun.CMD_ERRFILE) + ' || true' + ENDL
if( statsEnabled )
result += copyFileToWorkDir(TaskRun.CMD_TRACE) + ' || true' + ENDL
if( outputEnvNames || outputEvals )
result += copyFileToWorkDir(TaskRun.CMD_ENV) + ' || true' + ENDL


@Override
protected boolean shouldUnstageControls() {
return true
Copy link
Member

Choose a reason for hiding this comment

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

why is this only azure specific ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The shouldUnstageOutputs is also azure specific. It was always unstaging outputs and controls. In a first implementation, I removed the specific Azure behaviour for controls but tests were failing, so I decided to keep it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

storeDir : .command.out' are the same file
3 participants