Create a Custom RStudio Lab¶
Overview¶
In this tutorial, you'll create a custom RStudio Lab on the RosettaHub Supercloud platform. RStudio Labs are Docker-based formations (Docker Labs) that provide a browser-accessible RStudio environment. You'll learn how to create an object storage for your data, configure working and reference volumes, launch and customize the lab, snapshot it, and share it with others.
RStudio Labs use two types of volumes: a Working Volume (the default scratch directory) and a Reference Volume (for read-access to uploaded datasets and files). Understanding this distinction is important for organizing your data effectively.
Prerequisites¶
- [ ] RosettaHub account with active subscription
- [ ] At least one cloud account connected (see Cloud Keys)
- [ ] Access to the RStudio public Docker Lab formation
- [ ] R scripts or datasets to upload (optional)
Steps¶
Step 1: Open the Container Apps Perspective¶
From the RosettaHub dashboard, select the Container Apps perspective. This displays the Docker Labs view where container-based formations are listed.
Step 2: Create an Object Storage¶
In the Object Storages view, create a new storage to hold your reference data.
- Right-click in the Object Storages panel
- Select Create
- Name the storage My-New-Storage
- Click OK
See Object Storages Guide for more details on storage management.
Step 3: Upload Files to Your Storage¶
Click on the newly created My-New-Storage entry. The Amazon console opens, showing your S3 bucket.
- Click Upload in the S3 console
- Drag and drop your R scripts, datasets (CSV, RDS, etc.), or other files
- Click Upload to confirm
Note
The console-based upload is available for S3 (AWS) storage. For Azure Blob or GCP Storage, use the respective cloud provider consoles or CLI tools.
Step 4: Clone the RStudio Formation¶
In the Docker Labs view, locate the RStudio formation.
- Right-click RStudio
- Select Clone
- Name the new formation My-RStudio
Step 5: Configure Volumes¶
Attach your object storage to the formation. RStudio uses two volume types:
- Right-click the My-RStudio formation
- Select Configure
- Navigate to the Volumes tab
- Set Working Volume to Default (RStudio's scratch/output directory)
- Set Reference Volume to My-New-Storage (your uploaded data files)
- Click Save
| Volume Type | Purpose | Contents |
|---|---|---|
| Working Volume | Default working directory for RStudio | Output files, generated plots, intermediate results |
| Reference Volume | Read-access data directory | Uploaded datasets, scripts, shared reference files |
Tip
The Reference Volume is where your uploaded files appear. The Working Volume is the default directory where RStudio saves new files. Both persist independently of the machine image.
Step 6: Launch Your RStudio Lab¶
Click on My-RStudio to launch it. Click Yes in the confirmation dialog.
Your session appears under the Sessions panel. Wait 2-3 minutes for the session to show a green tick, indicating it is ready.
Click the session to connect. RStudio opens in a new browser tab.
To navigate to your uploaded files in RStudio:
- In the Files pane (bottom-right), click More
- Select Go to Working Directory
- Your uploaded files from the Reference Volume are accessible from here
Step 6.1: Install R Packages¶
Install any additional R packages you need. For example, install the data.table package:
In the RStudio console, run:
You can also install packages from the Packages pane or use devtools::install_github() for packages from GitHub.
Note
Packages installed in RStudio are stored in the container filesystem. To preserve them across sessions, you must create a machine image (Step 7).
Step 7: Create a Machine Image¶
After installing packages or making other environment customizations, snapshot your session to preserve them.
- Return to the RosettaHub dashboard
- Right-click your running session in the Sessions panel
- Select Create Machine Image
- Keep Update Originator Formation On Success checked
RosettaHub will:
- Snapshot the session with all newly installed R packages into a new machine image
- The image appears under the Images panel (see Images Guide)
- Automatically update the My-RStudio formation to use the new image
Tip
Data files in the working and reference volumes are automatically persisted to their respective object storages. You only need to snapshot when you install new packages or change system-level configuration.
Step 8: Share Your Lab¶
Share your customized RStudio Lab with others:
- Right-click the My-RStudio formation
- Select Share
- Choose to share with a specific user, your organization, or a group
When recipients launch the shared formation, they get an identical RStudio environment with all your installed R packages.
Key Concepts¶
| Concept | Description |
|---|---|
| Docker Lab | A container-based formation running a web application (Jupyter, RStudio, etc.) |
| Working Volume | Object storage mounted as the default working directory |
| Reference Volume | Object storage mounted as a read-access data directory |
| Machine Image | A snapshot of the container with installed packages and system changes |
- Volume files persist in object storage -- they survive machine deletion and image updates
- Machine image changes (installed packages, system configuration) require a snapshot to persist
- RStudio Labs use two volumes (Working + Reference), unlike Jupyter Labs which use a single Working Volume
Next Steps¶
- Create a Custom Jupyter Lab - Similar workflow for Python development
- Create a Custom Big Data Lab - Hadoop/Spark cluster environments
- Object Storages Guide - Managing object storages
- Formations User Guide - Complete formations documentation
- Images Guide - Managing machine images
- Cloud Operations - Governance, budgets, and policy enforcement
Troubleshooting¶
Cannot find uploaded files in RStudio
Ensure that:
- You configured My-New-Storage as the Reference Volume (not the Working Volume) in Step 5
- You uploaded files to the correct S3 bucket in Step 3
- The session was launched after configuring the volumes
- In RStudio, click More > Go to Working Directory to navigate to the correct location
If you changed volume configuration after launching, shut down and relaunch the session.
Installed R packages are missing after relaunch
R packages installed in the console are stored in the container filesystem, not the volumes. To preserve them:
- Install all needed packages
- Use Create Machine Image (Step 7) to snapshot the session
- Ensure Update Originator Formation On Success is checked
Future launches will include the installed packages.
Session takes too long to start
Docker Lab sessions typically start within 2-3 minutes. If it takes longer:
- Check your cloud account status and quotas
- Verify your budget allocation has not been exceeded
- Try a different cloud region
RStudio shows an error on startup
If RStudio fails to load properly:
- Wait a moment and refresh the browser tab
- Check that the session status is green (fully ready)
- Clear your browser cache if the interface appears broken
- If the issue persists, shut down the session and relaunch