From e027843238dcb7f6618dc1be0b3bc137ff0ce69b Mon Sep 17 00:00:00 2001 From: Jeffrey W Hollister Date: Fri, 21 Jul 2023 14:14:00 +0000 Subject: [PATCH 1/2] playing with devcontainers --- .devcontainer/Dockerfile | 8 +++++ .devcontainer/devcontainer.json | 55 +++++++++++++++++++++++++++++++++ .devcontainer/requirements.txt | 14 +++++++++ 3 files changed, 77 insertions(+) create mode 100644 .devcontainer/Dockerfile create mode 100644 .devcontainer/devcontainer.json create mode 100644 .devcontainer/requirements.txt diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 0000000..b3d770f --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1,8 @@ +FROM rocker/verse:4.3.1 + +LABEL org.opencontainers.image.licenses="GPL-2.0-or-later" \ + org.opencontainers.image.source="https://github.com/rocker-org/rocker-versioned2" \ + org.opencontainers.image.vendor="Rocker Project" \ + org.opencontainers.image.authors="Carl Boettiger " + +RUN /rocker_scripts/install_geospatial.sh \ No newline at end of file diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000..f49ddf9 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,55 @@ +{ + "name": "R Data Science Environment", + "build": { + "dockerfile": "Dockerfile", + // Update VARIANT to pick a specific R version: 4, 4.1, 4.0 + // More info: https://github.com/rocker-org/devcontainer-images/pkgs/container/devcontainer%2Ftidyverse + "args": { "VARIANT": "4" } + }, + + // Install Dev Container Features. More info: https://containers.dev/features + "features": { + "ghcr.io/rocker-org/devcontainer-features/quarto-cli:1": {}, + // Install JupyterLab and IRkernel. + // More info: https://github.com/rocker-org/devcontainer-templates/tree/main/src/r-ver + "ghcr.io/rocker-org/devcontainer-features/r-rig:1": { + "version": "none", + "installJupyterlab": true + } + }, + + "customizations": { + "vscode": { + "extensions": [ + // Add Jupyter and Python vscode extensions + "ms-toolsai.jupyter", + "ms-toolsai.jupyter-renderers", + "ms-python.python", + "ms-python.vscode-pylance", + "vsls-contrib.codetour", + "GitHub.copilot" + ] + } + }, + + // Forward Jupyter and RStudio ports + "forwardPorts": [8787, 8888], + "portsAttributes": { + "8787": { + "label": "Rstudio", + "requireLocalPort": true, + "onAutoForward": "ignore" + }, + "8888": { + "label": "Jupyter", + "requireLocalPort": true, + "onAutoForward": "ignore" + } + }, + + // Use 'postAttachCommand' to run commands after the container is started. + "postAttachCommand": "sudo rstudio-server start" + + // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root + // "remoteUser": "root" +} diff --git a/.devcontainer/requirements.txt b/.devcontainer/requirements.txt new file mode 100644 index 0000000..f74186d --- /dev/null +++ b/.devcontainer/requirements.txt @@ -0,0 +1,14 @@ +pybryt +pylint +datascience +otter-grader +numpy +pandas +scipy +folium>=0.9.1 +matplotlib +ipywidgets>=7.0.0 +bqplot +nbinteract>=0.0.12 +okpy +scikit-learn From 4da64afa19c8b4816a5503da79a50cc24166c1a7 Mon Sep 17 00:00:00 2001 From: Jeffrey W Hollister Date: Fri, 21 Jul 2023 18:43:09 +0000 Subject: [PATCH 2/2] update to devcontainer.json --- .devcontainer/devcontainer.json | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index f49ddf9..1cda36f 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -18,32 +18,13 @@ } }, - "customizations": { - "vscode": { - "extensions": [ - // Add Jupyter and Python vscode extensions - "ms-toolsai.jupyter", - "ms-toolsai.jupyter-renderers", - "ms-python.python", - "ms-python.vscode-pylance", - "vsls-contrib.codetour", - "GitHub.copilot" - ] - } - }, - // Forward Jupyter and RStudio ports - "forwardPorts": [8787, 8888], + "forwardPorts": [8787], "portsAttributes": { "8787": { "label": "Rstudio", "requireLocalPort": true, "onAutoForward": "ignore" - }, - "8888": { - "label": "Jupyter", - "requireLocalPort": true, - "onAutoForward": "ignore" } },