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
LSF support broken due to inappropriate shQuote #268
Comments
For anyone who just needs this to work now without waiting for a package update, you can add the following code to your batchtools config to fix it in situ: # This should just be whatever arguments you usually use
cluster.functions = makeClusterFunctionsLSF(
template = "/hpc/users/thompr21/.batchtools.lsf.tmpl"
)
# This is the part you need to add
local({
fix_cf <- function(cf) {
orig_submitJob <- cf$submitJob
new_submitJob <- function (reg, jc)
{
assertRegistry(reg, writeable = TRUE)
assertClass(jc, "JobCollection")
outfile = cfBrewTemplate(reg, template, jc)
## No shQuote here
res = runOSCommand("bsub", stdin = outfile)
if (res$exit.code > 0L) {
cfHandleUnknownSubmitError("bsub", res$exit.code, res$output)
}
else {
batch.id = stri_extract_first_regex(stri_flatten(res$output,
" "), "\\d+")
makeSubmitJobResult(status = 0L, batch.id = batch.id)
}
}
environment(new_submitJob) <- environment(orig_submitJob)
cf$submitJob <- new_submitJob
cf
}
cluster.functions <<- fix_cf(cluster.functions)
}) |
Thanks for the detailed report. Getting the quoting right is difficult, both in general and in particular because R-4.0.0 changed a lot internally regarding For the reported issue, I'll have to trust you here, I don't have access to a LSF system anymore. |
Fixed now in master, let me know if you encounter more issues. |
In the LSF
submitJob
function,shQuote
is called on the file name passed as stdin torunOSCommand
, which passes this argument tosystem2
, which callsshQuote
on it again. This means that if the file to be read is/tmp/Rtmp75UeJV/registry333bb5537ef2b/jobs/job2cf9f8b849db39df8ac03cc74a175e95.job
, it ends up running something likesh <"'/tmp/Rtmp75UeJV/registry333bb5537ef2b/jobs/job2cf9f8b849db39df8ac03cc74a175e95.job'"
which results in an error like:The fix is to simply delete the
shQuote
call from this line:batchtools/R/clusterFunctionsLSF.R
Line 41 in 9620f67
The text was updated successfully, but these errors were encountered: