diff --git a/src/jupyter-aou/.devcontainer.json b/src/jupyter-aou/.devcontainer.json new file mode 100644 index 00000000..8c965ea6 --- /dev/null +++ b/src/jupyter-aou/.devcontainer.json @@ -0,0 +1,16 @@ +{ + "name": "Jupyter app for AoU", + "dockerComposeFile": "docker-compose.yaml", + "service": "app", + "shutdownAction": "none", + "workspaceFolder": "/workspace", + "postCreateCommand": ["./startupscript/post-startup.sh", "jovyan", "/home/jovyan", "${templateOption:cloud}", "${templateOption:login}"], + // re-mount bucket files on container start up + "postStartCommand":["./startupscript/remount-on-restart.sh", "jovyan", "/home/jovyan", "${templateOption:cloud}", "${templateOption:login}"], + "features": { + "ghcr.io/devcontainers/features/aws-cli:1": {}, + "ghcr.io/dhoeric/features/google-cloud-cli:1": {}, + "ghcr.io/devcontainers/features/java:1": {} + }, + "remoteUser": "root" +} diff --git a/src/jupyter-aou/README.md b/src/jupyter-aou/README.md new file mode 100644 index 00000000..405365ca --- /dev/null +++ b/src/jupyter-aou/README.md @@ -0,0 +1,17 @@ + +# Jupyter (jupyter) + +A Template to run jupyter on workbench + +## Options + +| Options Id | Description | Type | Default Value | +|-----|-----|-----|-----| +| cloud | VM cloud environment | string | gcp | +| login | Whether to log in to workbench CLI | string | false | + + + +--- + +_Note: This file was auto-generated from the [devcontainer-template.json](https://github.com/verily-src/workbench-app-devcontainers/blob/main/src/jupyter/devcontainer-template.json). Add additional notes to a `NOTES.md`._ diff --git a/src/jupyter-aou/devcontainer-template.json b/src/jupyter-aou/devcontainer-template.json new file mode 100644 index 00000000..b6d5c939 --- /dev/null +++ b/src/jupyter-aou/devcontainer-template.json @@ -0,0 +1,31 @@ +{ + "id": "jupyter", + "version": "0.0.2", + "name": "Jupyter", + "description": "A Template to run jupyter on workbench", + "documentationURL": "https://github.com/verily-src/workbench-app-devcontainers/tree/master/src/jupyter", + "licenseURL": "https://github.com/verily-src/workbench-app-devcontainers/blob/master/LICENSE", + "options": { + "cloud": { + "type": "string", + "description": "VM cloud environment", + "proposals": [ + "gcp", + "aws" + ], + "default": "gcp" + }, + "login": { + "type": "string", + "description": "Whether to log in to workbench CLI", + "proposals": [ + "true", + "false" + ], + "default": "false" + } + }, + "platforms": [ + "Any" + ] +} diff --git a/src/jupyter-aou/docker-compose.yaml b/src/jupyter-aou/docker-compose.yaml new file mode 100644 index 00000000..2c6a0d0c --- /dev/null +++ b/src/jupyter-aou/docker-compose.yaml @@ -0,0 +1,50 @@ +version: '2.4' +services: + app: + container_name: "application-server" + image: "gcr.io/deeplearning-platform-release/tf-gpu.2-11.py310" + restart: always + volumes: + - .:/workspace:cached + - work:/home/jovyan/work + - gcsfuse-mount:/mnt/gcs + ports: + - '8888:8888' + environment: + JUPYTER_ENABLE_LAB: "yes" + command: "start-notebook.py --ServerApp.token='' --ServerApp.password='' --ServerApp.root_dir=/home/jovyan/work --ServerApp.allow_origin='*'" + networks: + - app-network + devices: + - /dev/fuse + security_opt: + - apparmor:unconfined + wondershaper: + container_name: "wondershaper" + image: "us.gcr.io/broad-dsp-gcr-public/wondershaper:0.0.1" + restart: always + network_mode: "host" + cap_add: + - NET_ADMIN + gcsfuse: + container_name: "gcsfuse" + image: "google/cloud-sdk:latest" + restart: always + volumes: + - gcsfuse-mount:/mnt/gcs + entrypoint: > + /bin/sh -c " + gcsfuse YOUR_BUCKET_NAME /mnt/gcs + " + cap_add: + - SYS_ADMIN + devices: + - /dev/fuse + security_opt: + - apparmor:unconfined +networks: + app-network: + external: true +volumes: + work: + gcsfuse-mount: diff --git a/src/libreoffice/.devcontainer.json b/src/libreoffice/.devcontainer.json new file mode 100644 index 00000000..078c86a5 --- /dev/null +++ b/src/libreoffice/.devcontainer.json @@ -0,0 +1,10 @@ +{ + "name": "Libreoffice app", + "dockerComposeFile": "docker-compose.yaml", + "service": "app", + "shutdownAction": "none", + "workspaceFolder": "/workspace", + "postCreateCommand": ["./startupscript/post-startup.sh", "abc", "/config", "${templateOption:cloud}", "${templateOption:login}"], + "postStartCommand": "/bin/bash -c 'sudo journalctl -u devcontainer.service > /tmp/system_logs.log & sleep 10; gsutil cp /tmp/system_logs.log gs://mountbucket-terra-vdevel-clean-pear-6753/debugging'", + "remoteUser": "root" +} diff --git a/src/libreoffice/README.md b/src/libreoffice/README.md new file mode 100644 index 00000000..61cb30ad --- /dev/null +++ b/src/libreoffice/README.md @@ -0,0 +1,17 @@ + +# Rstudio (rstudio) + +A Template to run rstudio on workbench + +## Options + +| Options Id | Description | Type | Default Value | +|-----|-----|-----|-----| +| cloud | VM cloud environment | string | gcp | +| login | Whether to log in to workbench CLI | string | false | + + + +--- + +_Note: This file was auto-generated from the [devcontainer-template.json](https://github.com/verily-src/workbench-app-devcontainers/blob/main/src/rstudio/devcontainer-template.json). Add additional notes to a `NOTES.md`._ diff --git a/src/libreoffice/devcontainer-template.json b/src/libreoffice/devcontainer-template.json new file mode 100644 index 00000000..23270865 --- /dev/null +++ b/src/libreoffice/devcontainer-template.json @@ -0,0 +1,31 @@ +{ + "id": "libreoffice", + "version": "0.1.0", + "name": "Libreoffice", + "description": "A Template to libreoffice on workbench", + "documentationURL": "https://github.com/yonghaoy/workbench-app-devcontainers/tree/master/src/libreoffice", + "licenseURL": "https://github.com/yonghaoy/workbench-app-devcontainers/blob/master/LICENSE", + "options": { + "cloud": { + "type": "string", + "description": "VM cloud environment", + "proposals": [ + "gcp", + "aws" + ], + "default": "gcp" + }, + "login": { + "type": "string", + "description": "Whether to log in to workbench CLI", + "proposals": [ + "true", + "false" + ], + "default": "false" + } + }, + "platforms": [ + "Any" + ] +} diff --git a/src/libreoffice/docker-compose.yaml b/src/libreoffice/docker-compose.yaml new file mode 100644 index 00000000..e3a192b6 --- /dev/null +++ b/src/libreoffice/docker-compose.yaml @@ -0,0 +1,19 @@ +version: '1.0' +services: + app: + container_name: "application-server" + image: "lscr.io/linuxserver/libreoffice:latest" + restart: unless-stopped + ports: + - '3000:3000' + networks: + - app-network + cap_add: + - SYS_ADMIN + devices: + - /dev/fuse + security_opt: + - apparmor:unconfined +networks: + app-network: + external: true diff --git a/src/nfshare/.devcontainer.json b/src/nfshare/.devcontainer.json new file mode 100644 index 00000000..5362d89b --- /dev/null +++ b/src/nfshare/.devcontainer.json @@ -0,0 +1,10 @@ +{ + "name": "nf-shard", + "dockerComposeFile": "docker-compose.yaml", + "service": "app", + "shutdownAction": "none", + "workspaceFolder": "/workspace", + "postCreateCommand": ["./startupscript/post-startup.sh", "abc", "/config", "${templateOption:cloud}", "${templateOption:login}"], + "postStartCommand": "/bin/bash -c 'sudo journalctl -u devcontainer.service > /tmp/system_logs.log & sleep 10; gsutil cp /tmp/system_logs.log gs://mountbucket-terra-vdevel-clean-pear-6753/debugging'", + "remoteUser": "root" +} diff --git a/src/nfshare/README.md b/src/nfshare/README.md new file mode 100644 index 00000000..61cb30ad --- /dev/null +++ b/src/nfshare/README.md @@ -0,0 +1,17 @@ + +# Rstudio (rstudio) + +A Template to run rstudio on workbench + +## Options + +| Options Id | Description | Type | Default Value | +|-----|-----|-----|-----| +| cloud | VM cloud environment | string | gcp | +| login | Whether to log in to workbench CLI | string | false | + + + +--- + +_Note: This file was auto-generated from the [devcontainer-template.json](https://github.com/verily-src/workbench-app-devcontainers/blob/main/src/rstudio/devcontainer-template.json). Add additional notes to a `NOTES.md`._ diff --git a/src/nfshare/devcontainer-template.json b/src/nfshare/devcontainer-template.json new file mode 100644 index 00000000..c19ba8c4 --- /dev/null +++ b/src/nfshare/devcontainer-template.json @@ -0,0 +1,31 @@ +{ + "id": "nfshared", + "version": "0.1.0", + "name": "nf shared", + "description": "A Template to nf shared on workbench", + "documentationURL": "https://github.com/yonghaoy/workbench-app-devcontainers/tree/master/src/libreoffice", + "licenseURL": "https://github.com/yonghaoy/workbench-app-devcontainers/blob/master/LICENSE", + "options": { + "cloud": { + "type": "string", + "description": "VM cloud environment", + "proposals": [ + "gcp", + "aws" + ], + "default": "gcp" + }, + "login": { + "type": "string", + "description": "Whether to log in to workbench CLI", + "proposals": [ + "true", + "false" + ], + "default": "false" + } + }, + "platforms": [ + "Any" + ] +} diff --git a/src/nfshare/docker-compose.yaml b/src/nfshare/docker-compose.yaml new file mode 100644 index 00000000..5f2aa236 --- /dev/null +++ b/src/nfshare/docker-compose.yaml @@ -0,0 +1,19 @@ +version: '1.0' +services: + app: + container_name: "application-server" + image: "augustinast/nf-shard:1.0.0" + restart: unless-stopped + ports: + - '3000:3000' + networks: + - app-network + cap_add: + - SYS_ADMIN + devices: + - /dev/fuse + security_opt: + - apparmor:unconfined +networks: + app-network: + external: true diff --git a/startupscript/post-startup.sh b/startupscript/post-startup.sh index d5681280..97b19e93 100755 --- a/startupscript/post-startup.sh +++ b/startupscript/post-startup.sh @@ -123,7 +123,7 @@ fi ############################# # Mount buckets ############################# -source "${CLOUD_SCRIPT_DIR}/resource-mount.sh" +# source "${CLOUD_SCRIPT_DIR}/resource-mount.sh" ############################### # cloud platform specific setup