Skip to content

Commit 4b10273

Browse files
AoU Compliant RStudio App (#299)
rstudio app with bandwidth limiting and upload/download policy reminders <img width="533" height="390" alt="image" src="https://github.com/user-attachments/assets/5e6489d5-98ad-4f34-925a-6f4e00155dd4" /> <img width="533" height="279" alt="image" src="https://github.com/user-attachments/assets/7ac4c297-64e0-46d4-8c18-a99d97523e4e" /> PHP-103498
1 parent 56b57bd commit 4b10273

9 files changed

Lines changed: 558 additions & 3 deletions

File tree

.github/workflows/test-pr.yaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,12 @@ jobs:
3333
user: rstudio
3434
workbench_tools: true
3535
postgres_client: true
36+
r-analysis-aou:
37+
user: rstudio
38+
workbench_tools: true
39+
postgres_client: true
40+
filters:
41+
- 'src/aou-common/**'
3642
vscode:
3743
user: abc
3844
workbench_tools: true
@@ -143,7 +149,7 @@ jobs:
143149
needs: [detect-changes]
144150
runs-on: ubuntu-latest
145151
continue-on-error: true
146-
if : ${{ needs.detect-changes.outputs.templates != '[]' }}
152+
if : ${{ needs.detect-changes.outputs.apps != '[]' }}
147153
strategy:
148154
matrix:
149155
app: ${{ fromJSON(needs.detect-changes.outputs.apps) }}
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
{
2+
"name": "R Analysis Environment for AoU",
3+
"dockerComposeFile": ["docker-compose.yaml", "../aou-common/aou-common-compose.yaml"],
4+
"service": "app",
5+
"runServices": ["app", "wondershaper"],
6+
"shutdownAction": "none",
7+
"workspaceFolder": "/workspace",
8+
"postCreateCommand": [
9+
"./startupscript/post-startup.sh",
10+
"rstudio",
11+
"/home/rstudio",
12+
"${templateOption:cloud}",
13+
"${templateOption:login}"
14+
],
15+
// re-mount bucket files on container start up
16+
"postStartCommand": [
17+
"./startupscript/remount-on-restart.sh",
18+
"rstudio",
19+
"/home/rstudio",
20+
"${templateOption:cloud}",
21+
"${templateOption:login}"
22+
],
23+
"features": {
24+
"ghcr.io/devcontainers/features/java@sha256:df67d6ff6e9cdd858207ae9e92a99ddb88384b789f79eecd6f873216e951d286": {
25+
"version": "17"
26+
},
27+
"ghcr.io/rocker-org/devcontainer-features/r-packages@sha256:1a4ec64c4d2060e78e9c812bd3b3622c7e008465d566a2781c0e2b17a82592e5": {
28+
"packages": "shiny,shinydashboard",
29+
"installSystemRequirements": true
30+
},
31+
"ghcr.io/devcontainers/features/aws-cli@sha256:bbc9fd513c22e331953126c75ad7b2ed1f9044f1cd5890b7073b634810459b18": {},
32+
"ghcr.io/dhoeric/features/google-cloud-cli@sha256:fa5d894718825c5ad8009ac8f2c9f0cea3d1661eb108a9d465cba9f3fc48965f": {},
33+
"./.devcontainer/features/workbench-tools": {
34+
"cloud": "${templateOption:cloud}",
35+
"username": "rstudio",
36+
"userHomeDir": "/home/rstudio"
37+
},
38+
"./.devcontainer/features/postgres-client": {
39+
"version": "16"
40+
}
41+
},
42+
"remoteUser": "root"
43+
}

src/r-analysis-aou/Dockerfile

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
FROM ghcr.io/rocker-org/devcontainer/tidyverse:4.5
2+
3+
ARG USER=rstudio
4+
ARG HOME=/home/$USER
5+
6+
COPY static /usr/lib/rstudio-server/www/aou-static
7+
RUN sed -i 's|</head>|<script src="/aou-static/aou-policy-interceptor.js"></script><link rel="stylesheet" href="/aou-static/aou-policy-styles.css"></head>|' /usr/lib/rstudio-server/www/index.htm
8+
9+
# Remove sudo access
10+
RUN rm /etc/sudoers.d/${USER}
11+
12+
COPY --from=load-envs --chown=$USER \
13+
/dist/load-env /dist/load-env.sh $HOME
14+
15+
RUN echo "source $HOME/load-env.sh" >> $HOME/.bashrc
16+
17+
# TODO(PHP-87353): Add remotefuse back. See https://github.com/verily-src/workbench-app-devcontainers/pull/227

src/r-analysis-aou/README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
2+
# R Analysis Environment for AoU (r-analysis-aou)
3+
4+
A Template to run R Analysis Environment on Workbench for AoU
5+
6+
## Options
7+
8+
| Options Id | Description | Type | Default Value |
9+
|-----|-----|-----|-----|
10+
| cloud | VM cloud environment | string | gcp |
11+
| login | Whether to log in to workbench CLI | string | false |
12+
13+
14+
15+
---
16+
17+
_Note: This file was auto-generated from the [devcontainer-template.json](https://github.com/verily-src/workbench-app-devcontainers/blob/main/src/r-analysis/devcontainer-template.json). Add additional notes to a `NOTES.md`._
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"id": "r-analysis-aou",
3+
"version": "0.0.2",
4+
"name": "R Analysis Environment for AoU",
5+
"description": "A Template to run the R Analysis Environment on workbench for AoU",
6+
"documentationURL": "https://github.com/verily-src/workbench-app-devcontainers/tree/master/src/r-analysis-aou",
7+
"licenseURL": "https://github.com/verily-src/workbench-app-devcontainers/blob/master/LICENSE",
8+
"options": {
9+
"cloud": {
10+
"type": "string",
11+
"description": "VM cloud environment",
12+
"proposals": ["gcp", "aws"],
13+
"default": "gcp"
14+
},
15+
"login": {
16+
"type": "string",
17+
"description": "Whether to log in to workbench CLI",
18+
"proposals": ["true", "false"],
19+
"default": "false"
20+
}
21+
},
22+
"platforms": ["Any"]
23+
}
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
include:
2+
- ../aou-common/aou-common-compose.yaml
3+
services:
4+
app:
5+
container_name: "application-server"
6+
build:
7+
context: .
8+
additional_contexts:
9+
load-envs: service:aou-common-load-envs
10+
restart: always
11+
ports:
12+
- "8787:8787"
13+
volumes:
14+
- .:/workspace:cached
15+
- work:/home/rstudio:cached
16+
tmpfs:
17+
- /home/rstudio/workspace:uid=1000,gid=1000
18+
environment:
19+
"DISABLE_AUTH": "true"
20+
networks:
21+
- app-network
22+
cap_add:
23+
- SYS_ADMIN
24+
devices:
25+
- /dev/fuse
26+
security_opt:
27+
- apparmor:unconfined
28+
wondershaper:
29+
container_name: "wondershaper"
30+
image: "us-west2-docker.pkg.dev/shared-pub-buckets-94mvrf/workbench-artifacts/app-wondershaper@sha256:1aee5cd4032d4888f382e3b11c0b775479ccaf55d97943f64049f90cfba05fac"
31+
restart: always
32+
network_mode: "host"
33+
cap_add:
34+
- NET_ADMIN
35+
networks:
36+
app-network:
37+
external: true
38+
volumes:
39+
work:

0 commit comments

Comments
 (0)