diff --git a/plugins/nf-float/src/main/com/memverge/nextflow/FloatBin.groovy b/plugins/nf-float/src/main/com/memverge/nextflow/FloatBin.groovy index 54e16c9..5c71551 100644 --- a/plugins/nf-float/src/main/com/memverge/nextflow/FloatBin.groovy +++ b/plugins/nf-float/src/main/com/memverge/nextflow/FloatBin.groovy @@ -13,11 +13,12 @@ class FloatBin { private static final binName = 'float' static Path get(String opCenterAddr) { - if (!opCenterAddr) { - return Paths.get(binName) - } def ret = getFloatBinPath() if (ret == null) { + if (!opCenterAddr) { + // no where to retrieve the binary + return Paths.get(binName) + } final URL src = getDownloadUrl(opCenterAddr) final Path pluginsDir = Global.getPluginsDir() ret = pluginsDir.resolve(binName) @@ -45,9 +46,8 @@ class FloatBin { private static Path getFloatBinPath() { final sep = Pattern.quote(File.pathSeparator) - def paths = Arrays.asList(System.getenv("PATH").split(sep)) - paths = new ArrayList(paths) - paths.add(Global.getPluginsDir().toString()) + def paths = [Global.getPluginsDir().toString()] + paths.addAll(Arrays.asList(System.getenv("PATH").split(sep))) for (String path : paths) { def floatPath = Paths.get(path).resolve(binName) if (Files.exists(floatPath)) { diff --git a/plugins/nf-float/src/main/com/memverge/nextflow/FloatGridExecutor.groovy b/plugins/nf-float/src/main/com/memverge/nextflow/FloatGridExecutor.groovy index 99e55d9..cbece07 100644 --- a/plugins/nf-float/src/main/com/memverge/nextflow/FloatGridExecutor.groovy +++ b/plugins/nf-float/src/main/com/memverge/nextflow/FloatGridExecutor.groovy @@ -60,6 +60,7 @@ class FloatGridExecutor extends AbstractGridExecutor { protected void register() { super.register() uploadBinDir() + syncFloatBin() } @Override @@ -113,6 +114,14 @@ class FloatGridExecutor extends AbstractGridExecutor { } } + private void syncFloatBin() { + final oc = floatJobs.getOc("") + def cmd = floatConf.getCliPrefix(oc) + cmd << "release" << "sync" + def res = Global.execute(cmd) + log.info "[float] sync the float binary, $res" + } + private static String getMemory(TaskRun task) { final mem = task.config.getMemory() final giga = mem?.toGiga() diff --git a/plugins/nf-float/src/main/com/memverge/nextflow/Global.groovy b/plugins/nf-float/src/main/com/memverge/nextflow/Global.groovy index e8f48b8..5e28e49 100644 --- a/plugins/nf-float/src/main/com/memverge/nextflow/Global.groovy +++ b/plugins/nf-float/src/main/com/memverge/nextflow/Global.groovy @@ -36,6 +36,10 @@ class CmdRes { return exit == 0 } + String toString() { + return "exit code: ${exit}, out: ${out}" + } + int exit String out }