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

sync the float binary. #62

Merged
merged 1 commit into from
Aug 29, 2023
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
12 changes: 6 additions & 6 deletions plugins/nf-float/src/main/com/memverge/nextflow/FloatBin.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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<String>(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)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ class FloatGridExecutor extends AbstractGridExecutor {
protected void register() {
super.register()
uploadBinDir()
syncFloatBin()
}

@Override
Expand Down Expand Up @@ -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()
Expand Down
4 changes: 4 additions & 0 deletions plugins/nf-float/src/main/com/memverge/nextflow/Global.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ class CmdRes {
return exit == 0
}

String toString() {
return "exit code: ${exit}, out: ${out}"
}

int exit
String out
}
Expand Down
Loading