1010
1111## Introduction
1212
13- This repository provides Rmd notebooks that enable you to use R and Python
14- together to interact with the NLP Sandbox ecosystem. For example, use example
15- notebooks included with this repository to perform analysis using data stored in
16- a local or remote instance of the NLP Sandbox Data Node. See the Section
17- [ Notebooks] ( #Notebooks ) below for the list of notebooks included with this
18- repository.
13+ This repository provides a portable development environment that includes
14+ RStudio and Jupyter. This environment aims to support NLP Sandbox users who
15+ develop or apply tools that intereact with the NLP Sandbox ecosystem.
1916
20- The Docker image [ nlpsandbox/notebooks] offered by this project is based on the
21- image [ sagebionetworks/rstudio] .
17+ For example, try the example notebooks included with this repository to perform
18+ analysis using data stored in a local or remote instance of the NLP Sandbox Data
19+ Node. See the Section [ Notebooks] ( #Notebooks ) for the list of example notebooks
20+ included with this repository.
21+
22+ The Docker image [ nlpsandbox/notebooks] that comes with this project is based on
23+ the image [ sagebionetworks/rstudio] .
2224
2325## Requirements
2426
25- - [ Docker Engine] >=19.03.0
27+ - [ Docker Engine] >= 19.03.0
2628- [ Synapse.org] user account
2729
2830## Specification
2931
30- - Notebooks version: 0.1 .0
32+ - Notebooks version: 0.2 .0
3133- NLP Sandbox schemas version: 1.2.0
34+ - RStudio version: 4.1.0
35+ - JupyterLab version: 3.2.1
3236
3337## Notebooks
3438
35- Rmd Notebook | Description
39+ Example notebooks for RStudio:
40+
41+ Notebook | Description
42+ -------- | -----------
43+ [ notebook.Rmd] ( notebooks/rstudio/notebook.Rmd ) | Default RStudio notebook.
44+ [ r-and-python.Rmd] ( notebooks/rstudio/r-and-python.Rmd ) | Shows how to use R and Python together.
45+ [ data-node.Rmd] ( notebooks/rstudio/data-node.Rmd ) | Interact with an NLP Sandbox Data Node instance.
46+
47+ Example notebooks for Jupiter:
48+
49+ Notebook | Description
3650-------- | -----------
37- [ notebook.Rmd] ( notebooks/notebook.Rmd ) | Default RStudio notebook.
38- [ r-and-python.Rmd] ( notebooks/r-and-python.Rmd ) | Shows how to use R and Python together.
39- [ data-node.Rmd] ( notebooks/data-node.Rmd ) | Interact with an NLP Sandbox Data Node instance.
51+ [ hello-world.ipynb] ( notebooks/jupyter/hello-world.ipynb ) | Hello World notebook.
4052
4153> Important: Please make sure when you write your own notebooks that no
4254> sensitive information ends up being publicly available. Please check with the
@@ -45,51 +57,61 @@ Rmd Notebook | Description
4557
4658## Usage
4759
48- Create and edit the configuration file.
60+ Create the configuration file.
4961
5062 cp .env.example .env
5163
52- You can either pull the docker image [ nlpsandbox/notebooks] or build it using
64+ Specify in the config file what IDE should be used.
65+
66+ # Notebook IDE ("rstudio" or "jupyter")
67+ IDE=rstudio
68+
69+ You can either pull the Docker image [ nlpsandbox/notebooks] or build it using
5370the information included in ` docker-compose.yml ` . To pull the image and start
54- RStudio :
71+ the IDE :
5572
5673 docker compose pull
5774 docker compose up
5875
59- If you want to build the image and start RStudio , for instance after customizing
60- ` Dockerfile ` :
76+ If you want to build the image before starting the IDE , for instance after
77+ customizing ` Dockerfile ` :
6178
6279 docker compose up --build
6380
64- RStudio is now available at http://localhost . On the login page, enter the
65- default username (` rstudio ` ) and the password specified in ` .env ` .
81+ To access the IDE, open your browser and follow the instructions below.
6682
67- In RStudio, open the RStudio project provided by this repository by clicking on
68- the button ` Project: (None) ` > ` Open Project... ` on the top-right corner, then
69- select the file ` nlpsandbox/nlpsandbox.Rproj ` . You should now be able to open
70- and run the notebook ` r-and-python.Rmd ` . This will confirm that you can
71- successfully use R and Python togehter.
83+ - RStudio: Navigate to http://localhost:8787
84+ - Jupyter: Navigate to the link displayed in the terminal when Jupyter started.
85+ You will need to replace the hostname by "localhost". E.g.
86+ http://localhost:8888/lab?token=4b08e8fc4469db3b4de1bb4d0ca20ef3684e5705bd193855
87+
88+ ### Stop the IDE
7289
73- To stop RStudio , enter ` Ctrl+C ` followed by ` docker compose down ` . If running
90+ To stop the IDE , enter ` Ctrl+C ` followed by ` docker compose down ` . If running
7491in detached mode, you will only need to enter ` docker compose down ` .
7592
7693Tips:
7794
7895- Add ` -d ` or ` --detach ` as in ` docker compose up -d ` to run in the background.
7996- If the command ` docker compose ` is missing, try ` docker-compose ` .
8097
81- ## Configuring the CI/CD workflow
98+ ## Open the RStudio project
99+
100+ In RStudio, open the RStudio project provided by this repository by clicking on
101+ the button ` Project: (None) ` > ` Open Project... ` on the top-right corner, then
102+ select the file ` nlpsandbox/nlpsandbox.Rproj ` . You should now be able to open
103+ and run the notebook ` r-and-python.Rmd ` . This will confirm that you can
104+ successfully use R and Python togehter.
82105
83- The [ CI/CD workflow] of this repository performs the following actions:
106+ ## Configuring the CI/CD workflow
84107
85- - Generate HTML notebooks from R notebook and publishes them to GitHub Pages.
86- - Build the Docker image [ nlpsandbox/notebooks] and push it to Docker Hub.
108+ The [ CI/CD workflow ] of this repository builds the Docker image
109+ [ nlpsandbox/notebooks] and pushes it to Docker Hub.
87110
88- If you decided to fork this repository or use it as a template, you will need to
111+ If you decide to use this repository as a GitHub template, you will need to
89112update the environment variables defined at the top of the [ CI/CD workflow] . You
90- also need to create the following [ GitHub Secrets] :
113+ also need to create the following [ GitHub Secrets] .
91114
92- - ` RSTUDIO_PASSWORD ` : "changeme"
93115- ` DOCKERHUB_USERNAME ` : Your Docker Hub username.
94116- ` DOCKERHUB_TOKEN ` : A personal access token (PAT) that has the permissions to
95117 push the image.
0 commit comments