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

Creating jobs without package dependencies installed on head node #298

Open
lpiep opened this issue Dec 18, 2023 · 0 comments
Open

Creating jobs without package dependencies installed on head node #298

lpiep opened this issue Dec 18, 2023 · 0 comments

Comments

@lpiep
Copy link

lpiep commented Dec 18, 2023

I have a use-case where I'd like to be able to create and submit jobs from the head node of a cluster that does not itself have the packages being used by the compute nodes. In this case, it's because the dependencies are a PITA to set up, and so I have built a singularity container for running them. Per HenrikBengtsson/future.batchtools#44, I've put the singularity command in my template file and can submit jobs to be run in the container with batchMap and submitJobs.

However, I run into a problem when defining jobs with batchMap using functions not installed on the head node.

Assume pita_package contains pita_function and can't be installed on the head node. Then a call to batchMap results in

> batchMap(pita_package::pita_function, 1:10)
Error in loadNamespace(x) : there is no package called ‘pita_package’

I've been able to work around this by creating a wrapper function for pita_function. E.g.

> pita_wrapper <- function(...) pita_package::pita_function(...) 
> batchMap(pita_wrapper, 1:10)
Adding 10 jobs ...

I'm adding this issue in part to help anyone runs into this question in the future, and in part to see if it makes sense to implement some sort of lazy evaluation into batchMap and its cousins to avoid the workaround.

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