Dick Postma and Xavier EscribΓ Montagut
Goal: Add multiple DataSHIELD profiles to your local Opal deployment
What are profiles?
Named R server configurations in Opal, each running as separate Rock containers with:
Before (Section 1):
Browser β Opal β Single Rock Container
After (Profiles):
Browser β Opal β Multiple Rock Containers
βββ rock-default (dsBase)
βββ rock-genomics (dsOmics)
βββ rock-survival (dsSurvival)
π¬ Research-specific environments - Different studies need different packages
π§ͺ Development vs stable
- Test new packages safely
π Learning & experimentation - Try packages without breaking production
opal-local/
βββ .env # Same password
βββ docker-compose.yml # Extended with profiles
βββ data/ # Persistent data storage
β βββ opal/ # Opal server data
β βββ mongo/ # MongoDB data
βββ logs/ # Opal logs
Same foundation - just add more Rock services
Your .env
file stays the same:
No new secrets needed - this password is used for the administrator
account on Opal, not for the Rock containers.
Key changes from Section 1:
services:
opal:
depends_on:
- rock-default # Renamed from 'rock'
- rock-survival # NEW profile
environment:
# Multiple Rock hosts - comma separated
- ROCK_HOSTS=rock-default:8085,rock-survival:8085
rock-default: # Renamed for consistency
environment:
- ROCK_ID=default
rock-survival: # NEW profile service
environment:
- ROCK_ID=survival
1. Service Dependencies
Why: Ensures Opal waits for all Rock containers before starting
2. Multiple Rock Hosts
Why: Tells Opal where to find all available computation environments
3. Unique Rock IDs
rock-default:
environment:
- ROCK_ID=default # Profile identifier
rock-survival:
environment:
- ROCK_ID=survival # Must be unique
Why: Each profile needs a unique ID for Opal to route requests correctly
4. Same Foundation - MongoDB, local folders, network unchanged - Data preserved during transition
β οΈ Maintenance Window Required
# Clean restart - ensures proper profile registration
docker-compose down
# Update your docker-compose.yml file
# Start with new configuration
docker-compose up -d
# Verify all services
docker-compose ps
Key: Use down
for clean container recreation - data preserved in local folders
# Check all containers running
docker-compose ps
# Check individual profile logs
docker-compose logs rock-default
docker-compose logs rock-survival
Success: All Rock containers show as healthy
library(DSI)
library(DSOpal)
# SSL config for local testing
set_config(config(ssl_verifyhost = 0L, ssl_verifypeer = 0L))
builder <- DSI::newDSLoginBuilder()
builder$append(
server = "survival",
url = "http://localhost:8080",
user = "administrator",
password = "ChangeMe123!",
profile = "survival" # Specify profile
)
logins <- builder$build()
conns <- DSI::datashield.login(logins)
DSI::datashield.pkg_status(conns) # Check packages
1. Add Rock service:
2. Update ROCK_HOSTS:
3. Apply with maintenance window
1. Delete service block from docker-compose.yml
2. Remove from ROCK_HOSTS environment variable
3. Apply changes:
Profile not appearing:
docker-compose ps
docker-compose logs rock-profilename
Connection timeouts:
docker-compose down && docker-compose up -d
Memory issues:
docker stats
docker-compose stop rock-genomics
β Achieved: Managing multiple profiles in a single Opal deployment
π Benefits:
Next: Building our own Rock profiles!