-
Notifications
You must be signed in to change notification settings - Fork 9
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
running RStudio Server on farm using R as installed in a conda environment #44
Comments
I'm not sure if high ports on farm head node itself are open, you might be able to do the tunneling on the farm head node and then access farm.cse.ucdavis.edu:port. |
I'm quite sure those are closed :) |
ref also #51 |
Is this virtual RStudio limited to the setting |
nope, those are configurable! |
(but if you go over what you set, e.g. load a 10 GB file into memory in R, then R and RStudio will be killed.) |
One note I think is important (and may be obvious to others), the RStudio is running on a Linux OS. Therefore, it can be difficult to install packages through |
good catch @ccbaumler - can you give me an example of a package that |
I attempted to install the |
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
updated top comment for june 19, 2023 functioning. |
This is the module now: rstudio-server/2022.12.0-353 |
thank you! I think that |
When I tried installing devtools with install.packages just now, in an environment with
...alas. |
Running rstudio server on farm - June 19, 2023
Titus Brown, [email protected]
June 19, 2023
To edit: / latest on github
Log into farm
Via ssh, as usual!
Allocate computational resources with srun
Allocate computational resources interactively via srun, and use a high priority queue.
For example, this:
will allocate 5 GB of RAM for 30 minutes on the
high2
partition/queue.::::warning
Note: the memory, CPUs, and time you allocate here will apply to your RStudio Server session!
::::
Recommended: activate a conda environment
To use your own conda installation of R; if so, you'll need to have a pre-existing conda environment, or else you'll have to create one (see Appendix, below, for instructions). If you create one, you only need to do this once.
Activate the conda environment like so:
where
r_env
is the name of your conda environent withr-base
installed.::::info
Why use conda?
There are several good reasons to use conda to install your own version of R. These reasons include:
conda install r-tidyverse
to install tidyverse.conda install r-devtools
)conda list r-base
See the appendices to this document for instructions on installing conda and creating an R environment.
::::
An easy alternate: activate the R module
If, instead of using conda, you want to use a system-installed R package, run:
You can select specific versions as listed by
module avail R
.::::warning
If you have conda installed, you may need to run the following to use the system provided R module:
::::
Load and run rstudio server
This will print out some specific instructions; you will need the ssh information as well as the RStudio Server password.
Note that this information will change every time you run
rstudio-launch
: it is specific to your account and session!::::warning
Note:
rstudio-launch
is what is running RStudio Server! If it exits (because srun runs out of time, or you hit CTRL-C), your RStudio Server will stop as well!::::
Set up ssh tunnel
Create a new ssh connection into farm; on Mac OS and Linux computers, you can create a new terminal on your desktop/laptop computer and copy/paste from the instructions printed out by
rstudio-launch
above.For example, you will want to run something like:
in a new window on your Mac OS X/Linux laptop/desktop
On Windows it's slightly trickier and depends on what software you are running.
Open the RStudio Server Web page and log in
Now, open the URL printed out by
rstudio-launch
in a Web browser, and enter the provided username and password.You should now be connected to RStudio Server! 🎉
Log out
At the end of your session, you can just close the tab and your ssh window(s).
If you want to be polite, you can more explicitly release the computational resources and shut things down by doing the following:
srun
andrstudio-launch
.srun
session by typingexit
.Appendix: create a conda environment containing R
(You'll need to have conda installed before this; see below. If you have
(base)
in your prompt, you're good to go!)To create a conda environment named
r_env
with R v4.3.0 installed, run:Appendix: installing conda
There are several ways to install conda; we recommend using mambaforge.
Here are some commands you can copy/paste:
The last command will run a program that will ask a number of questions before installing conda; answer "yes" to all of them.
Then, log out and log back in.
Your shell prompt should now have
(base)
at the beginning, indicating that conda was installed and you are in the base conda environment.For documentation on using conda, see this tutorial.
The text was updated successfully, but these errors were encountered: