Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable cleanup on remote work dir #5742

Merged
merged 3 commits into from
Feb 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion docs/reference/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ This page lists all of the available settings in the {ref}`Nextflow configuratio
: If `true`, on a successful completion of a run all files in *work* directory are automatically deleted.

:::{warning}
The use of the `cleanup` option will prevent the use of the *resume* feature on subsequent executions of that pipeline run. Also, be aware that deleting all scratch files can take a lot of time, especially when using a shared file system or remote cloud storage.
The use of the `cleanup` option will prevent the use of the *resume* feature on subsequent executions of that pipeline run.
:::
:::{warning}
The `cleanup` option is not supported for remote work directories, such as Amazon S3, Google Cloud Storage, and Azure Blob Storage.
:::

`dumpHashes`
Expand Down
5 changes: 5 additions & 0 deletions modules/nextflow/src/main/groovy/nextflow/Session.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -1209,6 +1209,11 @@ class Session implements ISession {
if( aborted || cancelled || error )
return

if( workDir.scheme != 'file' ) {
log.warn "The `cleanup` option is not supported for remote work directory: ${workDir.toUriString()}"
return
}

log.trace "Cleaning-up workdir"
try (CacheDB db = CacheFactory.create(uniqueId, runName).openForRead()) {
db.eachRecord { HashCode hash, TraceRecord record ->
Expand Down