Skip to content

Commit

Permalink
[GH-32] Upload bin directory.
Browse files Browse the repository at this point in the history
For each task, we need to upload the bin folder to the work directory so
that the worker node could access them.
  • Loading branch information
jealous committed Jul 11, 2023
1 parent a35634d commit e894824
Showing 1 changed file with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ package com.memverge.nextflow
import groovy.transform.CompileStatic
import groovy.util.logging.Slf4j
import nextflow.executor.AbstractGridExecutor
import nextflow.extension.FilesEx
import nextflow.processor.TaskConfig
import nextflow.processor.TaskRun
import nextflow.util.ServiceName
Expand Down Expand Up @@ -58,11 +59,25 @@ class FloatGridExecutor extends AbstractGridExecutor {
protected List<String> getDirectives(TaskRun task, List<String> initial) {
log.info "[float] switch task ${task.id} to ${task.workDirStr}"
floatJobs.setWorkDir(task.id, task.workDirStr)
uploadBinDir(task)

initial << 'cd'
initial << task.workDirStr
return initial
}

private boolean needBinDir() {
return session.binDir && !session.binDir.empty() && !session.disableRemoteBinDir
}

private void uploadBinDir(TaskRun task) {
// upload local binaries
if (needBinDir()) {
log.info "Uploading local `bin` scripts folder to ${task.workDirStr}"
FilesEx.copyTo(session.binDir, task.workDirStr)
}
}

private void validateTaskConf(TaskConfig config) {
if (!config.nfs && !floatConf.nfs) {
log.error '[float] missing "nfs": need a nfs to run float jobs'
Expand Down

0 comments on commit e894824

Please sign in to comment.