Skip to content

Commit

Permalink
Improve local exec workdir validation
Browse files Browse the repository at this point in the history
Signed-off-by: Paolo Di Tommaso <paolo.ditommaso@gmail.com>
  • Loading branch information
pditommaso committed Dec 26, 2022
1 parent d22337c commit 4a3a272
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,10 @@ import java.nio.file.FileSystems

import groovy.transform.CompileStatic
import groovy.util.logging.Slf4j
import nextflow.exception.ProcessUnrecoverableException
import nextflow.executor.Executor
import nextflow.executor.SupportedScriptTypes
import nextflow.extension.FilesEx
import nextflow.fusion.FusionHelper
import nextflow.processor.LocalPollingMonitor
import nextflow.processor.TaskHandler
Expand Down Expand Up @@ -61,9 +63,11 @@ class LocalExecutor extends Executor {
@Override
protected void register() {
super.register()
if( workDir.fileSystem != FileSystems.default && !isFusionEnabled() ) {
log.warn "Local executor only supports default file system (unless Fusion is enabled) -- Check work directory: ${getWorkDir().toUriString()}"
}
final remoteFs = workDir.fileSystem!=FileSystems.default
if( isFusionEnabled() && !remoteFs )
throw new ProcessUnrecoverableException("Fusion file system requires the use of a S3-compatible object storage — offending work directory path: ${FilesEx.toUriString(workDir)}")
if( remoteFs && !isFusionEnabled())
throw new ProcessUnrecoverableException("Local executor requires the use of POSIX compatible file system — offending work directory path: ${FilesEx.toUriString(workDir)}")
}

@Override
Expand Down

0 comments on commit 4a3a272

Please sign in to comment.