From c70ca1f4a127febc7b0fdd09fdd1228ec7dfe408 Mon Sep 17 00:00:00 2001 From: John Bates Date: Thu, 27 Feb 2025 15:50:15 -0800 Subject: [PATCH 1/3] [DO NOT MERGE] devcontainer for JupyterLab + GATK on prod --- src/jupyter-gatk/.devcontainer.json | 54 +++++++++++++++++++++ src/jupyter-gatk/README.md | 19 ++++++++ src/jupyter-gatk/devcontainer-template.json | 33 +++++++++++++ src/jupyter-gatk/docker-compose.yaml | 22 +++++++++ 4 files changed, 128 insertions(+) create mode 100644 src/jupyter-gatk/.devcontainer.json create mode 100644 src/jupyter-gatk/README.md create mode 100644 src/jupyter-gatk/devcontainer-template.json create mode 100644 src/jupyter-gatk/docker-compose.yaml diff --git a/src/jupyter-gatk/.devcontainer.json b/src/jupyter-gatk/.devcontainer.json new file mode 100644 index 00000000..5daabefc --- /dev/null +++ b/src/jupyter-gatk/.devcontainer.json @@ -0,0 +1,54 @@ +{ + "name": "JupyterLab with GATK 4.3.0.0", + "dockerComposeFile": "docker-compose.yaml", + "service": "app", + "shutdownAction": "none", + "workspaceFolder": "/workspace", + "postCreateCommand": [ + "./startupscript/post-startup.sh", + "jupyter", + "/home/jupyter", + "${templateOption:cloud}", + "${templateOption:login}" + ], + // re-mount bucket files on container start up + "postStartCommand": [ + "./startupscript/remount-on-restart.sh", + "jupyter", + "/home/jupyter", + "${templateOption:cloud}", + "${templateOption:login}" + ], + "remoteUser": "root", + "customizations": { + "workbench": { + "opens": { + "extensions": [ + // Source + ".ipynb", + ".R", + ".py", + // Documents + ".md", + ".html", + ".latex", + ".pdf", + // Images + ".bmp", + ".gif", + ".jpeg", + ".jpg", + ".png", + ".svg", + // Data + ".csv", + ".tsv", + ".json", + ".vl" + ], + "fileUrlSuffix": "/lab/tree/{path}", + "folderUrlSuffix": "/lab/tree/{path}" + } + } + } +} diff --git a/src/jupyter-gatk/README.md b/src/jupyter-gatk/README.md new file mode 100644 index 00000000..ee44650d --- /dev/null +++ b/src/jupyter-gatk/README.md @@ -0,0 +1,19 @@ + +# Custom Workbench JupyterLab App Template (custom-workbench-jupyter-template) + +A template used to serve the Workbench custom JupyterLab app. + +## Options + +| Options Id | Description | Type | Default Value | +|-----|-----|-----|-----| +| cloud | VM cloud environment | string | gcp | +| login | Whether to log in to workbench CLI | string | false | +| containerImage | The container image to use | string | debian:bullseye | +| containerPort | The port to expose the container on | number | 8888 | + + + +--- + +_Note: This file was auto-generated from the [devcontainer-template.json](devcontainer-template.json). Add additional notes to a `NOTES.md`._ diff --git a/src/jupyter-gatk/devcontainer-template.json b/src/jupyter-gatk/devcontainer-template.json new file mode 100644 index 00000000..84b30764 --- /dev/null +++ b/src/jupyter-gatk/devcontainer-template.json @@ -0,0 +1,33 @@ +{ + "id": "jupyter-gatk-template", + "description": "A template used to serve the Workbench JupyterLab container image with GATK installed", + "version": "0.0.1", + "name": "Workbench JupyterLab GATK template", + "documentationURL": "https://github.com/verily-src/workbench-app-devcontainers/tree/master/src/jupyter-gatk", + "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" + }, + "containerImage": { + "type": "string", + "description": "The container image to use", + "default": "us-central1-docker.pkg.dev/wb-bright-turnip-4738/gatk-demo-repo/test1:20250226" + }, + "containerPort": { + "type": "number", + "description": "The port to expose the container on", + "default": 8888 + } + }, + "platforms": ["Any"] +} diff --git a/src/jupyter-gatk/docker-compose.yaml b/src/jupyter-gatk/docker-compose.yaml new file mode 100644 index 00000000..e001b133 --- /dev/null +++ b/src/jupyter-gatk/docker-compose.yaml @@ -0,0 +1,22 @@ +version: "2.4" +services: + app: + container_name: "application-server" + image: "us-central1-docker.pkg.dev/wb-bright-turnip-4738/gatk-demo-repo/test1:20250226" + user: "jupyter" + restart: always + volumes: + - .:/workspace:cached + ports: + - "8888:8888" + networks: + - app-network + cap_add: + - SYS_ADMIN + devices: + - /dev/fuse + security_opt: + - apparmor:unconfined +networks: + app-network: + external: true From 6ea63d8bb002ec2f27703371e6941f6618d34757 Mon Sep 17 00:00:00 2001 From: John Bates Date: Thu, 27 Feb 2025 16:56:59 -0800 Subject: [PATCH 2/3] Attempting to use template values in docker-compose.yaml --- src/jupyter-gatk/docker-compose.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/jupyter-gatk/docker-compose.yaml b/src/jupyter-gatk/docker-compose.yaml index e001b133..685dfb06 100644 --- a/src/jupyter-gatk/docker-compose.yaml +++ b/src/jupyter-gatk/docker-compose.yaml @@ -2,13 +2,13 @@ version: "2.4" services: app: container_name: "application-server" - image: "us-central1-docker.pkg.dev/wb-bright-turnip-4738/gatk-demo-repo/test1:20250226" + image: "${templateOption:containerImage}" user: "jupyter" restart: always volumes: - .:/workspace:cached ports: - - "8888:8888" + - "${templateOption:containerPort}:${templateOption:containerPort}" networks: - app-network cap_add: From 80a0ec6c78fdec1dd3e7a00b69ee1e777a76f8cc Mon Sep 17 00:00:00 2001 From: John Bates Date: Thu, 27 Feb 2025 17:03:33 -0800 Subject: [PATCH 3/3] Templates still don't work - reverting --- src/jupyter-gatk/docker-compose.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/jupyter-gatk/docker-compose.yaml b/src/jupyter-gatk/docker-compose.yaml index 685dfb06..e001b133 100644 --- a/src/jupyter-gatk/docker-compose.yaml +++ b/src/jupyter-gatk/docker-compose.yaml @@ -2,13 +2,13 @@ version: "2.4" services: app: container_name: "application-server" - image: "${templateOption:containerImage}" + image: "us-central1-docker.pkg.dev/wb-bright-turnip-4738/gatk-demo-repo/test1:20250226" user: "jupyter" restart: always volumes: - .:/workspace:cached ports: - - "${templateOption:containerPort}:${templateOption:containerPort}" + - "8888:8888" networks: - app-network cap_add: