generated from ProjectPythia/cookbook-template
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* FIX: fix bash call, use jammy (22.04), use erad2024 docker endpoint * FIX: try to build image on pullrequest * WIP: refer to own workflows * WIP: add baltrad build deps * WIP: use 2024.03.0 repo2docker * WIP: hardcode python3.11 for baltrad install scripts * WIP: use openradar fork of baltrad hlhdf * WIP: do not build baltrad for now * WIP: do not build baltrad for now * WIP: use correct repo2docker version * WIP: add environment.ipynb, remove nbstripout.sh call * WIP: add environment.ipynb, remove nbstripout.sh call * WIP: fix workflows * WIP: use auto instead of cache/binder
- Loading branch information
1 parent
5136fb7
commit 4ea4347
Showing
11 changed files
with
178 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
name: build-book-pullrequest | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
environment_name: | ||
description: 'Name of conda environment to activate' | ||
required: false | ||
default: 'cookbook-dev' | ||
type: string | ||
environment_file: | ||
description: 'Name of conda environment file' | ||
required: false | ||
default: 'environment.yml' | ||
type: string | ||
path_to_notebooks: | ||
description: 'Location of the JupyterBook source relative to repo root' | ||
required: false | ||
default: './' | ||
type: string | ||
use_cached_environment: | ||
description: 'Flag for whether we should attempt to retrieve a previously cached environment.' | ||
required: false | ||
default: 'true' | ||
type: string # had a lot of trouble with boolean types, see https://github.com/actions/runner/issues/1483 | ||
|
||
jobs: | ||
build-book: | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
shell: bash -l {0} | ||
steps: | ||
- name: checkout files in repo | ||
uses: actions/checkout@v3 | ||
- name: remove Dockerfile | ||
run: | | ||
rm binder/Dockerfile | ||
- name: update jupyter dependencies with repo2docker | ||
uses: jupyterhub/repo2docker-action@master | ||
with: | ||
NO_PUSH: true | ||
DOCKER_USERNAME: "openradar" | ||
DOCKER_PASSWORD: ${{ secrets.GITHUB_TOKEN }} | ||
DOCKER_REGISTRY: "ghcr.io" | ||
PUBLIC_REGISTRY_CHECK: true | ||
APPENDIX_FILE: "binder/appendix.txt" | ||
REPO2DOCKER_EXTRA_ARGS: --Repo2Docker.base_image=docker.io/library/buildpack-deps:jammy | ||
FORCE_REPO2DOCKER_VERSION: jupyter-repo2docker==2024.03.0 | ||
|
||
- name: list docker images | ||
run: | | ||
docker image ls -a | ||
- name: Build the book | ||
uses: addnab/docker-run-action@v3 | ||
with: | ||
image: ghcr.io/openradar/erad2024:latest | ||
options: --user root -v ${{ github.workspace }}:/work | ||
shell: bash -l {0} | ||
run: | | ||
# copy baltrad notebooks to book dir | ||
# re add when baltrad issues are sorted out | ||
# cp -rp /home/jovyan/notebooks/baltrad* /work/notebooks/. | ||
# cp -rp /home/jovyan/notebooks/pyart2baltrad* /work/notebooks/. | ||
# /work/install/nbstripout_notebooks.sh | ||
source /srv/conda/etc/profile.d/conda.sh | ||
conda activate notebook | ||
jupyter-book build /work/${{ inputs.path_to_notebooks }} | ||
- name: Zip the book | ||
run: | | ||
set -x | ||
set -e | ||
if [ -f book.zip ]; then | ||
rm -rf book.zip | ||
fi | ||
zip -r book.zip ${{ inputs.path_to_notebooks }}/_build/html | ||
- name: Upload zipped book artifact | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: book-zip-${{github.event.number}} | ||
path: ./book.zip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
FROM ghcr.io/openradar/erad2022:latest | ||
FROM ghcr.io/openradar/erad2024:latest | ||
|
||
RUN mamba env update -f binder/environment.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"# Environment overview" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"!env" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"!conda list" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"import wradlib as wrl" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"wrl.show_versions()" | ||
] | ||
} | ||
], | ||
"metadata": { | ||
"language_info": { | ||
"codemirror_mode": { | ||
"name": "ipython", | ||
"version": 3 | ||
}, | ||
"file_extension": ".py", | ||
"mimetype": "text/x-python", | ||
"name": "python", | ||
"nbconvert_exporter": "python", | ||
"pygments_lexer": "ipython3", | ||
"version": "3.10.5" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 4 | ||
} |