Skip to content

Commit 103cb98

Browse files
authored
Update README.md
1 parent 7957912 commit 103cb98

File tree

1 file changed

+42
-17
lines changed

1 file changed

+42
-17
lines changed

README.md

Lines changed: 42 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,33 +3,57 @@
33
I usually rely on the [conda package manager](https://docs.conda.io/en/latest/) to manage my environments during development. Thanks to [conda-forge](https://conda-forge.org/) and [bioconda](https://bioconda.github.io/) most R packages are now also available through conda. For production,
44
I [convert them to containers](https://github.com/grst/containerize-conda) as these are easier to share.
55

6-
Unfortunately, there seems to be [no straightforward way](https://community.rstudio.com/t/start-rstudio-server-session-in-conda-environment/12516/15) to use conda envs in Rstudio server. This repository provides two approaches to make rstudio server work with conda envs.
6+
Unfortunately, there seems to be [no straightforward way](https://community.rstudio.com/t/start-rstudio-server-session-in-conda-environment/12516/15) to use conda envs in Rstudio server. This repository provides three approaches to make rstudio server work with conda envs.
77

8-
* [Running Rstudio Server in a Singularity Container](#running-rstudio-server-in-singularity)
9-
* [Running Rstudio Server in a Docker/Podman Container](#running-rstudio-server-in-a-container)
8+
* [Running Rstudio Server in a Singularity Container](#running-rstudio-server-with-singularity)
9+
* [Running Rstudio Server in a Docker/Podman Container](#running-rstudio-server-with-podmandocker)
1010
* [Running Rstudio Server locally](#running-locally)
1111

12-
## Running Rstudio Server in Singularity
12+
## Running Rstudio Server with Singularity
13+
14+
With this approach Rstudio Server runs in a Singularity container (based on [rocker/rstudio](https://hub.docker.com/r/rocker/rstudio)).
15+
The conda environment gets mounted into the container - like that there's no need to rebuild the container to add a package and
16+
`install.packages` can be used without issues. The container-based approach has the following benefits:
17+
18+
* Authentication works ([#3](https://github.com/grst/rstudio-server-conda/issues/3))
19+
* Several separate instances of Rstudio server can run in parallel, even without the *Pro* version.
1320

1421
### Prerequisites
1522

16-
* [Singularity]
17-
* [conda]
23+
* [Singularity](https://sylabs.io/guides/3.0/user-guide/quick_start.html)
24+
* [conda](https://docs.conda.io/en/latest/miniconda.html) or [mamba](https://github.com/conda-forge/miniforge#mambaforge)
25+
1826

1927
### Usage
2028

21-
1. Activate the target conda env or set the environment variable `CONDA_PREFIX`
29+
1. Clone this repository
30+
31+
```bash
32+
git clone [email protected]:grst/rstudio-server-conda.git
33+
```
34+
35+
2. Activate the target conda env or set the environment variable `CONDA_PREFIX`
2236
to point to the location of the conda env.
23-
2.
37+
38+
3. Execute the `run_singularity.sh` script. It will automatically build the container if it is not available.
39+
40+
```bash
41+
cd rstudio-server-conda/singularity
42+
PORT=8787 PASSWORD=notsafe ./run_singularity.sh
43+
```
44+
45+
4. Log into Rstudio
2446

25-
## Running Rstudio Server in a Container
47+
* open rstudio server at `http://localhost:8787` (or whatever port you specified)
48+
* login with your default username and the password you specified via the `PASSWORD` environment variable.
2649

27-
With this approach Rstudio Server runs in a Docker container (based on [rocker/rstudio](https://hub.docker.com/r/rocker/rstudio)).
28-
The conda environment gets mounted into the container - like that there's no need to rebuild the container to add a package and
29-
`install.packages` can be used without issues. The container-based approach has the following benefits:
50+
## Running Rstudio Server with Podman/Docker
3051

31-
* Authentication works (#3)
32-
* Several separate instances of Rstudio server can run in parallel, even without the *Pro* version.
52+
This approach is similar to [Singularity](#running-rstudio-server-with-singularity), but uses
53+
Docker or Podman and a `docker-compose.yml` file instead.
54+
55+
### Known limitations
56+
* No access to shared group directories ([#14](https://github.com/grst/rstudio-server-conda/issues/14))
3357

3458
### Prerequisites
3559

@@ -83,7 +107,7 @@ The conda environment gets mounted into the container - like that there's no nee
83107

84108
5. Log into Rstudio
85109

86-
* Open your server at `https://localhost:8889` (or whatever port you specified)
110+
* Open your server at `http://localhost:8889` (or whatever port you specified)
87111
* Login with the user `rstudio` (when using Docker) or `root` (when using Podman) and the password you specified
88112
in the `docker-compose.yml`. If you are using Podman and login with `rstudio` you won't have permissions to
89113
access the mounted volumes.
@@ -92,8 +116,9 @@ The conda environment gets mounted into the container - like that there's no nee
92116
## Running Locally
93117
94118
With this approach a locally installed Rstudio server is ran such that it uses the conda env.
95-
A known limitation of this approch is that the Rstudio authentication is bypassed (see #3).
96-
Therefore, only use this approach in a secure network!
119+
120+
### Known limitations
121+
* no authentication ([#3](https://github.com/grst/rstudio-server-conda/issues/3)). Use this approach only in a secure network!
97122
98123
### Prerequisites
99124
* [rstudio server](https://www.rstudio.com/products/rstudio/download-server/) installed locally

0 commit comments

Comments
 (0)