Skip to content

Commit a390c23

Browse files
authored
Merge branch 'main' into codeautolink
2 parents 3137cea + c72ca10 commit a390c23

File tree

89 files changed

+27580
-19849
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

89 files changed

+27580
-19849
lines changed

.devcontainer/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
FROM pangeo/base-image:2024.06.02

.devcontainer/devcontainer.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"build": {
3+
"dockerfile": "./Dockerfile",
4+
"context": "../conda"
5+
},
6+
"postCreateCommand": {
7+
"vscode": "mkdir ${containerWorkspaceFolder}/.vscode && cp ${containerWorkspaceFolder}/.devcontainer/tasks.json ${containerWorkspaceFolder}/.vscode/tasks.json"
8+
},
9+
"hostRequirements": {
10+
"cpus": 2
11+
},
12+
"customizations": {
13+
"codespaces": {
14+
"openFiles": ["README.md"]
15+
},
16+
"vscode": {
17+
"extensions": ["ms-toolsai.jupyter", "ms-python.python"]
18+
}
19+
}
20+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"build": {
3+
"dockerfile": "../Dockerfile",
4+
"context": "../../conda"
5+
},
6+
"postCreateCommand": {
7+
"jupyterlab": "mkdir /home/jovyan/.jupyter && cp ${containerWorkspaceFolder}/.devcontainer/scipy2023/jupyter_lab_config.py /home/jovyan/.jupyter/jupyter_lab_config.py",
8+
"vscode": "mkdir ${containerWorkspaceFolder}/.vscode && cp ${containerWorkspaceFolder}/.devcontainer/scipy2023/tasks.json ${containerWorkspaceFolder}/.vscode/tasks.json"
9+
},
10+
"hostRequirements": {
11+
"cpus": 2
12+
},
13+
"customizations": {
14+
"codespaces": {
15+
"openFiles": ["workshops/scipy2023/README.md"]
16+
},
17+
"vscode": {
18+
"extensions": ["ms-toolsai.jupyter", "ms-python.python"]
19+
}
20+
}
21+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Configuration file for lab.
2+
3+
c = get_config() # noqa
4+
5+
## The default URL to redirect to from `/`
6+
# Default: '/lab'
7+
c.LabApp.default_url = '/lab/tree/workshops/scipy2023/index.ipynb'
8+
9+
## Set the Access-Control-Allow-Origin header
10+
#
11+
# Use '*' to allow any origin to access your server.
12+
#
13+
# Takes precedence over allow_origin_pat.
14+
# Default: ''
15+
c.ServerApp.allow_origin = '*'

.devcontainer/scipy2023/tasks.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"version": "2.0.0",
3+
"tasks": [
4+
{
5+
"label": "jupyterlab",
6+
"type": "shell",
7+
"command": "/srv/conda/envs/notebook/bin/jupyter lab --no-browser",
8+
"presentation": {
9+
"reveal": "always"
10+
},
11+
"runOptions": {
12+
"runOn": "folderOpen"
13+
}
14+
}
15+
]
16+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"build": {
3+
"dockerfile": "../Dockerfile",
4+
"context": "../../conda"
5+
},
6+
"postCreateCommand": {
7+
"jupyterlab": "mkdir /home/jovyan/.jupyter && cp ${containerWorkspaceFolder}/.devcontainer/scipy2024/jupyter_lab_config.py /home/jovyan/.jupyter/jupyter_lab_config.py",
8+
"vscode": "mkdir ${containerWorkspaceFolder}/.vscode && cp ${containerWorkspaceFolder}/.devcontainer/scipy2024/tasks.json ${containerWorkspaceFolder}/.vscode/tasks.json"
9+
},
10+
"hostRequirements": {
11+
"cpus": 2
12+
},
13+
"customizations": {
14+
"codespaces": {
15+
"openFiles": ["workshops/scipy2024/README.md"]
16+
},
17+
"vscode": {
18+
"extensions": ["ms-toolsai.jupyter", "ms-python.python"]
19+
}
20+
}
21+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Configuration file for lab.
2+
3+
c = get_config() # noqa
4+
5+
## The default URL to redirect to from `/`
6+
# Default: '/lab'
7+
c.LabApp.default_url = '/lab/tree/workshops/scipy2024/index.ipynb'
8+
9+
## Set the Access-Control-Allow-Origin header
10+
#
11+
# Use '*' to allow any origin to access your server.
12+
#
13+
# Takes precedence over allow_origin_pat.
14+
# Default: ''
15+
c.ServerApp.allow_origin = '*'

.devcontainer/scipy2024/tasks.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"version": "2.0.0",
3+
"tasks": [
4+
{
5+
"label": "jupyterlab",
6+
"type": "shell",
7+
"command": "/srv/conda/envs/notebook/bin/jupyter lab --no-browser",
8+
"presentation": {
9+
"reveal": "always"
10+
},
11+
"runOptions": {
12+
"runOn": "folderOpen"
13+
}
14+
}
15+
]
16+
}

.devcontainer/tasks.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"version": "2.0.0",
3+
"tasks": [
4+
{
5+
"label": "jupyterlab",
6+
"type": "shell",
7+
"command": "/srv/conda/envs/notebook/bin/jupyter lab --LabApp.default_url='/lab/tree/overview/xarray-in-45-min.ipynb' --ServerApp.allow_origin='*' --no-browser",
8+
"presentation": {
9+
"reveal": "always"
10+
},
11+
"runOptions": {
12+
"runOn": "folderOpen"
13+
}
14+
}
15+
]
16+
}

.github/actions/setupconda/action.yml

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

.github/dependabot.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "docker"
4+
directory: "/.devcontainer"
5+
schedule:
6+
interval: "daily"
7+
- package-ecosystem: "github-actions"
8+
directory: "/.github"
9+
schedule:
10+
interval: "monthly"

.github/workflows/main.yaml

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,16 @@ on:
66
pull_request:
77
branches: main
88

9-
# Required to publish to gh-pages branch
9+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
1010
permissions:
1111
contents: write
12+
pages: write
13+
id-token: write
14+
15+
# Allow one concurrent deployment
16+
concurrency:
17+
group: ${{ github.workflow }}-${{ github.ref }}
18+
cancel-in-progress: true
1219

1320
jobs:
1421
build-and-deploy:
@@ -23,13 +30,18 @@ jobs:
2330
with:
2431
path: _build
2532
# NOTE: change key to "jupyterbook-DATE" to force rebuilding cache
26-
key: jupyterbook-20230112
33+
key: jupyterbook-20230707
2734

28-
- uses: ./.github/actions/setupconda
35+
- name: Install Conda environment with Micromamba
36+
uses: mamba-org/setup-micromamba@v1
37+
with:
38+
environment-file: conda/conda-lock.yml
39+
environment-name: xarray-tutorial
40+
cache-environment: true
2941

3042
- name: Build JupyterBook
3143
# NOTE: login shell activates conda environment
32-
shell: bash -l {0}
44+
shell: bash -el {0}
3345
run: |
3446
jupyter-book build ./ --warningiserror --keep-going
3547
@@ -38,6 +50,13 @@ jobs:
3850
run: |
3951
if (test -a _build/html/reports/*log); then cat _build/html/reports/*log ; fi
4052
53+
- name: Save Build
54+
if: always()
55+
uses: actions/upload-artifact@v3
56+
with:
57+
name: build
58+
path: _build/
59+
4160
- name: Publish to GitHub Pages
4261
if: github.ref == 'refs/heads/main'
4362
uses: peaceiris/actions-gh-pages@v3
@@ -47,10 +66,3 @@ jobs:
4766
publish_branch: gh-pages
4867
cname: tutorial.xarray.dev
4968
enable_jekyll: false
50-
51-
- name: Save Build
52-
if: always()
53-
uses: actions/upload-artifact@v3
54-
with:
55-
name: build
56-
path: _build/

.github/workflows/preview.yaml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: PR Preview
2+
3+
on: [pull_request]
4+
5+
permissions:
6+
pull-requests: write # allow surge-preview to create/update PR comments
7+
8+
concurrency:
9+
group: ${{ github.workflow }}-${{ github.ref }}
10+
cancel-in-progress: true
11+
12+
jobs:
13+
preview:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout repository
17+
uses: actions/checkout@v3
18+
19+
- name: Setup JupyterBook Cache
20+
uses: actions/cache@v3
21+
with:
22+
path: _build
23+
# NOTE: change key to "jupyterbook-DATE" to force rebuilding cache
24+
key: jupyterbook-20230707
25+
26+
- name: Install Conda environment with Micromamba
27+
uses: mamba-org/setup-micromamba@v1
28+
with:
29+
environment-file: conda/conda-lock.yml
30+
environment-name: xarray-tutorial
31+
cache-environment: true
32+
33+
- name: Build JupyterBook
34+
# NOTE: login shell activates conda environment
35+
shell: bash -l {0}
36+
run: |
37+
jupyter-book build ./ --warningiserror --keep-going
38+
39+
- name: Dump Build Logs
40+
if: always()
41+
run: |
42+
if (test -a _build/html/reports/*log); then cat _build/html/reports/*log ; fi
43+
44+
- name: Publish to Surge
45+
id: preview_step
46+
uses: afc163/surge-preview@v1
47+
with:
48+
surge_token: ${{ secrets.SURGE_TOKEN }}
49+
github_token: ${{ secrets.GITHUB_TOKEN }}
50+
dist: _build/html
51+
build: |
52+
npm install surge
53+
54+
- name: Format preview url
55+
id: format_url
56+
run: |
57+
echo "url_text=:rocket: Preview deployed at https://${{ steps.preview_step.outputs.preview_url }}" >> $GITHUB_OUTPUT
58+
59+
- name: Get the preview_url
60+
run: echo "${{ steps.format_url.outputs.url_text }}"
61+
62+
- name: Generate summary
63+
run: |
64+
echo "#### ${{ steps.format_url.outputs.url_text }}" >> $GITHUB_STEP_SUMMARY

.github/workflows/qaqc.yaml

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,26 +5,35 @@ on:
55
branches:
66
- main
77

8+
concurrency:
9+
group: ${{ github.workflow }}-${{ github.ref }}
10+
cancel-in-progress: true
11+
812
jobs:
913
quality-control:
1014
runs-on: ubuntu-latest
1115
defaults:
1216
run:
13-
shell: bash -l {0}
17+
shell: bash -el {0}
1418

1519
steps:
16-
- uses: actions/checkout@v2
20+
- uses: actions/checkout@v3
1721

18-
- uses: ./.github/actions/setupconda
22+
- name: Install Conda environment with Micromamba
23+
uses: mamba-org/setup-micromamba@v1
24+
with:
25+
environment-file: conda/conda-lock.yml
26+
environment-name: xarray-tutorial
27+
cache-environment: true
1928

2029
# NOTE: this isn't a comprehensive spellcheck, just common typos
2130
- name: Spellcheck
2231
if: always()
23-
uses: codespell-project/actions-codespell@v1
32+
uses: codespell-project/actions-codespell@v2
2433
with:
2534
check_filenames: true
2635
check_hidden: true
27-
skip: '.git,*.js,qaqc.yml'
36+
skip: ".git,*.js,qaqc.yml"
2837
ignore_words_list: hist,nd
2938

3039
# borrowed from https://github.com/ProjectPythia/pythia-foundations/blob/main/.github/workflows/link-checker.yaml
@@ -40,6 +49,7 @@ jobs:
4049
yaml.dump(data, f)
4150
4251
- name: Check External Links
52+
timeout-minutes: 5
4353
if: always()
4454
run: |
4555
jupyter-book build ./ --builder linkcheck

0 commit comments

Comments
 (0)