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

'resourceLimits' must be of class 'rs_launcher_resourcelimit' #282

Open
kobusbosman opened this issue Jul 20, 2023 · 1 comment
Open

'resourceLimits' must be of class 'rs_launcher_resourcelimit' #282

kobusbosman opened this issue Jul 20, 2023 · 1 comment

Comments

@kobusbosman
Copy link

Hi,

I have an issue when trying to use launcherSubmitJob with the resourceLimits argument:

rstudioapi::launcherSubmitJob(
name = "testcoresetting",
cluster = "Local",
command = "R",
args = "-e print('hi')",
resourceLimits = rstudioapi::launcherResourceLimit(type = "cpuCount", value = 4)
)

leads to:

Error in (function (name, args = NULL, cluster = "Local", command = NULL, :
'resourceLimits' must be of class 'rs_launcher_resourcelimit'

This error is also thrown with cluster = "slurm_cluster" and args = "-e future::availableCores()", which is my actual use case. The error is not thrown when resourceLimits is not used.

Is this a bug or should I be using this argument differently? Thank you!

@kobusbosman
Copy link
Author

kobusbosman commented Jul 21, 2023

I found that self-composing the resourceLimits like so lets it pass through without a problem:

resourceLimits <- list(list(type = "cpuCount", value = "4"))
class(resourceLimits[[1]]$type) <- c("rs.scalar", "rs_launcher_resourcelimit")
class(resourceLimits[[1]]$value) <- c("rs.scalar", "rs_launcher_resourcelimit")
class(resourceLimits[[1]]) <- "rs_launcher_resourcelimit"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant