diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 00000000..0964bf48 --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1 @@ +FROM pangeo/base-image:2023.06.20 diff --git a/.devcontainer/scipy2023/devcontainer.json b/.devcontainer/scipy2023/devcontainer.json new file mode 100644 index 00000000..353cfda4 --- /dev/null +++ b/.devcontainer/scipy2023/devcontainer.json @@ -0,0 +1,21 @@ +{ + "build": { + "dockerfile": "../Dockerfile", + "context": "../../conda" + }, + "postCreateCommand": { + "jupyterlab": "mkdir /home/jovyan/.jupyter && cp ${containerWorkspaceFolder}/.devcontainer/scipy2023/jupyter_lab_config.py /home/jovyan/.jupyter/jupyter_lab_config.py", + "vscode": "mkdir ${containerWorkspaceFolder}/.vscode && cp ${containerWorkspaceFolder}/.devcontainer/scipy2023/tasks.json ${containerWorkspaceFolder}/.vscode/tasks.json" + }, + "hostRequirements": { + "cpus": 2 + }, + "customizations": { + "codespaces": { + "openFiles": ["workshops/scipy2023/README.md"] + }, + "vscode": { + "extensions": ["ms-toolsai.jupyter", "ms-python.python"] + } + } +} diff --git a/.devcontainer/scipy2023/jupyter_lab_config.py b/.devcontainer/scipy2023/jupyter_lab_config.py new file mode 100644 index 00000000..0bdc1e31 --- /dev/null +++ b/.devcontainer/scipy2023/jupyter_lab_config.py @@ -0,0 +1,15 @@ +# Configuration file for lab. + +c = get_config() # noqa + +## The default URL to redirect to from `/` +# Default: '/lab' +c.LabApp.default_url = '/lab/tree/workshops/scipy2023/index.ipynb' + +## Set the Access-Control-Allow-Origin header +# +# Use '*' to allow any origin to access your server. +# +# Takes precedence over allow_origin_pat. +# Default: '' +c.ServerApp.allow_origin = '*' diff --git a/.devcontainer/scipy2023/tasks.json b/.devcontainer/scipy2023/tasks.json new file mode 100644 index 00000000..5660e45b --- /dev/null +++ b/.devcontainer/scipy2023/tasks.json @@ -0,0 +1,16 @@ +{ + "version": "2.0.0", + "tasks": [ + { + "label": "jupyterlab", + "type": "shell", + "command": "/srv/conda/envs/notebook/bin/jupyter lab --no-browser", + "presentation": { + "reveal": "always" + }, + "runOptions": { + "runOn": "folderOpen" + } + } + ] +} diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 00000000..a049e851 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,6 @@ +version: 2 +updates: + - package-ecosystem: 'docker' + directory: '/.devcontainer' + schedule: + interval: 'daily' diff --git a/conda/apt.txt b/conda/apt.txt new file mode 100644 index 00000000..82d0355f --- /dev/null +++ b/conda/apt.txt @@ -0,0 +1,2 @@ +git +vim diff --git a/workshops/scipy2023/README.md b/workshops/scipy2023/README.md index 47bd449f..91816a2f 100644 --- a/workshops/scipy2023/README.md +++ b/workshops/scipy2023/README.md @@ -19,6 +19,26 @@ See instructions to set up the environment for running the tutorial material [he For the live tutorial, we will be using the SciPy 2023 Nebari JupyterHub. Instructions for the live tutorial will be added soon. +## Github Codespaces + +This tutorial is available to run within [Github Codespaces](https://github.com/features/codespaces) - "a development environment that's hosted in the cloud" - with the conda environment specification in the [`conda-lock.yml`](../../conda/conda-lock.yml) file. + +[![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://github.com/codespaces/new/xarray-contrib/xarray-tutorial/tree/main?devcontainer_path=.devcontainer%2Fscipy2023%2Fdevcontainer.json) + +☝️ Click the button above to go to options window to launch a Github codespace. + +A codespace is a development environment that's hosted in the cloud. +You can choose from a selection of virtual machine types: 2 cores - 4 GB RAM - 32 GB storage, and 4 cores - 8 GB RAM - 32GB storage. +Additionally, you are able to chose from various Dev container configuration, for this specific workshop, please ensure that `Scipy2023` is selected. +GitHub currently gives every user [120 vCPU hours per month for free](https://docs.github.com/en/billing/managing-billing-for-github-codespaces/about-billing-for-github-codespaces#monthly-included-storage-and-core-hours-for-personal-accounts), beyond that you must pay. **So be sure to explicitly stop or shut down your codespace when you are done by going to this page (https://github.com/codespaces).** + +Once your codespace is launched, the following happens: + +- [Visual Studio Code](https://code.visualstudio.com/) Interface will open up within your browser. +- A built in terminal will open and it will execute `jupyter lab` automatically. +- Once you see a url to click within the terminal, simply `cmd + click` the given url. +- This will open up another tab in your browser, leading to a [Jupyter Lab](https://jupyterlab.readthedocs.io/en/latest/) Interface. + ## Outline **🏗️ Outline coming soon! Please check back later**