Skip to content

Commit 8c6852c

Browse files
committed
updated codespace and instructions
1 parent 6b0c288 commit 8c6852c

File tree

3 files changed

+37
-31
lines changed

3 files changed

+37
-31
lines changed

.devcontainer/devcontainer.json

Lines changed: 30 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,37 @@
1+
// https://pixi.sh/latest/integration/editor/vscode/#devcontainer-extension
12
{
2-
"image": "quay.io/pangeo/pangeo-notebook:latest",
3-
"postCreateCommand": {
4-
"vscode": "mkdir ${containerWorkspaceFolder}/.vscode && cp ${containerWorkspaceFolder}/.devcontainer/tasks.json ${containerWorkspaceFolder}/.vscode/tasks.json"
5-
},
6-
"hostRequirements": {
7-
"cpus": 2
3+
"name": "xarray-tutorial",
4+
"build": {
5+
"dockerfile": "Dockerfile",
6+
"context": ".."
87
},
98
"customizations": {
10-
"codespaces": {
11-
"openFiles": ["README.md"]
12-
},
139
"vscode": {
14-
"extensions": ["ms-toolsai.jupyter", "ms-python.python"]
10+
"settings": {},
11+
"extensions": [
12+
"ms-toolsai.jupyter",
13+
"ms-python.python",
14+
"executablebookproject.myst-highlight"
15+
]
16+
}
17+
},
18+
"features": {
19+
// ensure GitHub Codespace 'Open with JupyterLab' works
20+
// TODO: figure out why it doesn't work w/ jupyterlab in the pixi environment
21+
"ghcr.io/devcontainers/features/python:1": {
22+
"version": "3.12",
23+
"installTools": false,
24+
// NOTE: not working, so install with pip in postCreateCommand
25+
// "toolsToInstall":"jupyterlab_myst,pixi-kernel",
26+
"installJupyterlab": true
1527
}
28+
},
29+
"mounts": [
30+
"source=${localWorkspaceFolderBasename}-pixi,target=${containerWorkspaceFolder}/.pixi,type=volume"
31+
],
32+
"postCreateCommand": {
33+
"configure_jupyterlab": "pip install jupyterlab_myst pixi-kernel",
34+
"set_pixi_permissions": "sudo chown vscode .pixi",
35+
"install_pixi_environment": "pixi install"
1636
}
1737
}

.devcontainer/tasks.json

Lines changed: 0 additions & 16 deletions
This file was deleted.

README.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,14 @@ This tutorial is available to run within [Github Codespaces](https://github.com/
2424

2525
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).**
2626

27-
Once your codespace is launched, the following happens:
27+
You can also use the GitHub CLI to launch a codespace
2828

29-
- [Visual Studio Code](https://code.visualstudio.com/) Interface will open up within your browser.
30-
- A built in terminal will open and it will execute `jupyter lab` automatically.
31-
- Once you see a url to click within the terminal, simply `cmd + click` the given url.
32-
- This will open up another tab in your browser, leading to a [Jupyter Lab](https://jupyterlab.readthedocs.io/en/latest/) Interface.
29+
```
30+
# This will output a URL to use VSCode in the browser
31+
gh codespace create --repo xarray-contrib/xarray-tutorial
32+
# Optionally launch JupyterLab instead of vscode (after codespace has been created)
33+
gh codespace jupyter
34+
```
3335

3436
#### Locally
3537

0 commit comments

Comments
 (0)