paciorek / future-kubernetes

Instructions for setting up and using a Kubernetes cluster for running R in parallel using the future package.
39 stars 10 forks source link

Issues with newer versions of R/Rstudio #6

Closed 1beb closed 3 years ago

1beb commented 3 years ago

Problem 1: Non-existent function parallel:::.slaveRSOCK()

Using the latest rocker/tidyverse, I received an error:

Error: object '.slaveRSOCK' not found. 

That's because this internal function parallel:::.slaveRSOCK() is no longer in the parallel package. There is also no way to downgrade the parallel package as it is part of base.

Solution: Downgrade, or copy/paste function into .Rprofile?

Problem 2: Rprofile.site can't bind functions

ERROR:Cannot bind value of "setup_kube" into base environment

This one appears to be related to using Rprofile.site. I used /home/rstudio/.Rprofile instead and it I believe that relegated the issue.

paciorek commented 3 years ago

@1beb Good catch. It looks like .slaveRSOCK has been renamed .workRSOCK.

In the interim before I fix this, one can modify the call to .slaveRSOCK in future-helm-chart/templates/uture-worker-deployment.yaml to call .workRSOCK. Then rebuild the helm chart per the instructions in the README and use that version of the chart.

paciorek commented 3 years ago

I've updated the helm chart to look for either .slaveRSOCK or .workRSOCK. This is tagged as '0.1.2'. @1beb if you have a chance to test this and see if it works for you, let me know so I can close this.

1beb commented 3 years ago

Thanks, I'll give it a shot the next time I spin up a cluster. (Probably next week sometime)

1beb commented 3 years ago

Can confirm that part 2 of this issue is still a problem. Downgrading to 4.0.3 appears to be the only solution.

paciorek commented 3 years ago

Currently the Docker image I provide uses 4.0.3, so I am not running into this problem. I won't have a chance for a few weeks, but I will try to replicate with an altered Docker image that builds off of rocker/rstudio:4.1.0 and see if I can diagnose.

paciorek commented 3 years ago

Ok, I've reproduced part 2 and am thinking through how best to make setup_kube available for when the worker and scheduler R processes start.

paciorek commented 3 years ago

Ok, I needed to create the functions in setup_kube.R via local(), assigning into the global environment as by default putting the code into Rprofile.site tries to put them into the base environment, which is not allowed (but once was, presumably). This should resolve part 2 and is now in the latest commits to the future-kubernetes-docker and future-helm-chart repositories.