Skip to content

Commit 945c219

Browse files
committed
Setting up Docker image and Jupyter book build and deploy on GitHub
1 parent 80d8553 commit 945c219

11 files changed

Lines changed: 167 additions & 37 deletions

.binder/Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
### ###
77
################################################################################
88

9-
FROM registry.gitlab.inria.fr/mgenet/dolfin_warp-tutorials:latest
9+
# FROM registry.gitlab.inria.fr/mgenet/dolfin_warp-tutorials:latest
10+
FROM ghcr.io/mgenet/dolfin_warp-tutorials:latest
1011

1112
# Copy repo into the image, cf. https://mybinder.readthedocs.io/en/latest/tutorials/dockerfile.html. MG20230531: OMG this copies from the "build context", cf. https://stackoverflow.com/questions/73156067/where-does-the-copy-command-in-docker-copy-from; here it seems to be the repo itself.
1213
ARG NB_USER=jovyan
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
on:
2+
- push
3+
4+
jobs:
5+
build_and_deploy_jupyter_book:
6+
runs-on: ubuntu-latest
7+
8+
permissions:
9+
pages: write
10+
id-token: write
11+
12+
steps:
13+
- name: Checkout repository
14+
uses: actions/checkout@main
15+
16+
- name: Build Jupyter Book
17+
run: |
18+
pip install -U jupyter-book
19+
jupyter-book clean .
20+
jupyter-book build .
21+
22+
- name: Upload artifact
23+
uses: actions/upload-pages-artifact@main
24+
with:
25+
path: "_build/html"
26+
27+
- name: Deploy Jupyter Book to GitHub Pages
28+
id: deployment
29+
uses: actions/deploy-pages@main
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
on:
2+
- push
3+
4+
jobs:
5+
build_and_push_docker_image:
6+
runs-on: ubuntu-latest
7+
8+
steps:
9+
- name: Checkout code
10+
uses: actions/checkout@main
11+
12+
- name: Prepare build
13+
run: |
14+
rm -rf ${{github.workspace}}/.binder
15+
cp ${{github.workspace}}/.repo2docker/* ${{github.workspace}}/.
16+
17+
- name: Build and push docker image
18+
uses: jupyterhub/repo2docker-action@master
19+
with:
20+
DOCKER_USERNAME: ${{github.actor}}
21+
DOCKER_PASSWORD: ${{secrets.GITHUB_TOKEN}}
22+
DOCKER_REGISTRY: ghcr.io
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
on:
2+
- push
3+
- delete
4+
5+
jobs:
6+
mirror_to_gitlab:
7+
runs-on: ubuntu-latest
8+
9+
steps:
10+
- name: Checkout code
11+
uses: actions/checkout@main
12+
with:
13+
fetch-depth: 0
14+
15+
- name: Sync repo
16+
uses: wangchucheng/git-repo-sync@master
17+
with:
18+
target-url: https://gitlab.inria.fr/mgenet/dolfin_warp-tutorials
19+
target-username: mgenet
20+
target-token: ${{secrets.GITLAB_TOKEN}}

.gitlab-ci.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ build_docker:
1515
tags:
1616
- ci.inria.fr
1717
- large
18-
# image: registry.gitlab.inria.fr/inria-ci/docker/ubuntu:20.04
1918
image: ubuntu:20.04
2019
script:
2120
- apt update; DEBIAN_FRONTEND=noninteractive apt install -y ca-certificates curl git gnupg lsb-release mercurial python3 python3-pip tzdata

.repo2docker/environment-old.yml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
################################################################################
2+
### ###
3+
### Created by Martin Genet ###
4+
### ###
5+
### École Polytechnique, Palaiseau, France ###
6+
### ###
7+
################################################################################
8+
9+
name: notebook
10+
11+
channels:
12+
- conda-forge
13+
- defaults
14+
15+
dependencies:
16+
# python
17+
# - mpi4py=3.1.3 # MG20220906: To avoid mpi warnings in FEniCS, cf. https://fenicsproject.discourse.group/t/runtimewarning-mpi4py-mpi-file-size-changed-may-indicate-binary-incompatibility-expected-32-from-c-header-got-40-from-pyobject-def-compile-class-cpp-data-mpi-comm-mpi-comm-world/6496 # MG20220906: Note that 3.0.3 leads to a `RuntimeError: Error when importing mpi4py`, but 3.1.3 seems to work.
18+
- numpy=1.21.6 # MG20221220: later numpy versions seem incompatible with itkwidgets 0.32
19+
- python=3.8.15
20+
- scipy=1.9.3
21+
- sympy=1.9
22+
- traitlets=5.6.0 # MG20221220: later traitlets versions seem incompatible with itkwidgets 0.32, cf. https://github.com/InsightSoftwareConsortium/itkwidgets/issues/588
23+
24+
# jupyter
25+
- ipydatawidgets=4.3.2
26+
- ipywidgets=7.6.5 # MG20221226: cf. https://github.com/InsightSoftwareConsortium/itkwidgets/pull/590/files # MG20230601: Somehow this is still needed, despite the updated itkwidgets version…
27+
- itkwidgets=0.32.6
28+
# MG20240123: Specified all these versions based on the 2023 build to get ipywidgets and itkwidgets to properly interact
29+
- jupyter=1.0.0
30+
- jupyter_client=7.4.8
31+
- jupyter_console=6.4.4
32+
- jupyter_contrib_core=0.4.0
33+
- jupyter_contrib_nbextensions=0.5.1
34+
- jupyter_core=5.1.3
35+
- jupyter_highlight_selected_word=0.2.0
36+
- jupyter_latex_envs=1.4.6
37+
- jupyter_nbextensions_configurator=0.4.1
38+
- jupyter_server=2.0.6
39+
- jupyter_server_terminals=0.4.3
40+
# MG20240123: Specified all these versions based on the 2023 build to get ipywidgets and itkwidgets to properly interact
41+
- jupyterlab=3.5.2 # MG20230602: This seems to be needed as well, otherwise jupyter does not start on binder
42+
- notebook=6.4.6 # MG20221226: cf. https://github.com/InsightSoftwareConsortium/itkwidgets/pull/590/files # MG20230601: Somehow this is still needed, despite the updated itkwidgets version…
43+
- traitlets=5.6.0 # MG20221226: cf. https://github.com/InsightSoftwareConsortium/itkwidgets/pull/590/files # MG20230601: Somehow this is still needed, despite the updated itkwidgets version…
44+
45+
# coding stuff
46+
- git=2.39.0
47+
48+
# computing stuff
49+
- expat=2.5 # MG20241020: expat > 2.5 seems to break vtkXMLDataParser, cf. https://gitlab.kitware.com/vtk/vtk/-/issues/19258
50+
- fenics=2019.1.0
51+
- meshio=5.3.4
52+
- vtk=9.0.3 # MG20201223: Need to correspond to the environment variable CPATH # MG20220628: Apparently there is some kind of conflict between vtk9.1 & libstdc++.so.6 in Ubuntu 20.04… # MG20221220: Apparently there is some kind of conflict between vtk9.1 & itkwidgets 0.32…
53+
54+
# plotting stuff
55+
- matplotlib=3.6.2
56+
- gnuplot=5.4.3
57+
58+
- pip
59+
- pip:
60+
# python
61+
# - zstd
62+
63+
# computing stuff
64+
- gmsh==4.11.0
65+
66+
# tracking stuff
67+
- dolfin_warp
68+
69+
variables:
70+
CPATH: /srv/conda/envs/notebook/include/vtk-9.0

.repo2docker/environment.yml

Lines changed: 17 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,23 @@ channels:
1313
- defaults
1414

1515
dependencies:
16-
# python
17-
- mpi4py=3.1.3 # MG20220906: To avoid mpi warnings in FEniCS, cf. https://fenicsproject.discourse.group/t/runtimewarning-mpi4py-mpi-file-size-changed-may-indicate-binary-incompatibility-expected-32-from-c-header-got-40-from-pyobject-def-compile-class-cpp-data-mpi-comm-mpi-comm-world/6496 # MG20220906: Note that 3.0.3 leads to a `RuntimeError: Error when importing mpi4py`, but 3.1.3 seems to work.
16+
# dolfin_warp
17+
- expat=2.5
18+
- fenics=2019.1.0
19+
- gnuplot=5.4
20+
- matplotlib=3.5
21+
- meshio=5.3
22+
- mpi4py=3.1.3
1823
- numpy=1.21.6 # MG20221220: later numpy versions seem incompatible with itkwidgets 0.32
19-
- python=3.8
24+
- pandas=1.3
25+
- python=3.10
2026
- scipy=1.9
21-
- sympy=1.9
27+
- vtk=9.2
2228

2329
# jupyter
24-
- ipywidgets=7.6 # MG20221226: cf. https://github.com/InsightSoftwareConsortium/itkwidgets/pull/590/files # MG20230601: Somehow this is still needed, despite the updated itkwidgets version…
25-
- itkwidgets=0.32
30+
- ipydatawidgets=4.3.2
31+
- ipywidgets=7.6.5 # MG20221226: cf. https://github.com/InsightSoftwareConsortium/itkwidgets/pull/590/files # MG20230601: Somehow this is still needed, despite the updated itkwidgets version…
32+
- itkwidgets=0.32.6
2633
# MG20240123: Specified all these versions based on the 2023 build to get ipywidgets and itkwidgets to properly interact
2734
- jupyter=1.0.0
2835
- jupyter_client=7.4.8
@@ -36,33 +43,13 @@ dependencies:
3643
- jupyter_server=2.0.6
3744
- jupyter_server_terminals=0.4.3
3845
# MG20240123: Specified all these versions based on the 2023 build to get ipywidgets and itkwidgets to properly interact
39-
- jupyterlab=3.5 # MG20230602: This seems to be needed as well, otherwise jupyter does not start on binder
40-
- notebook=6.4 # MG20221226: cf. https://github.com/InsightSoftwareConsortium/itkwidgets/pull/590/files # MG20230601: Somehow this is still needed, despite the updated itkwidgets version…
41-
42-
# coding stuff
43-
- git=2.39
44-
45-
# computing stuff
46-
- expat=2.5
47-
- fenics=2019.1.0
48-
- vtk=9.0 # MG20201223: Need to correspond to the environment variable CPATH # MG20220628: Apparently there is some kind of conflict between vtk9.1 & libstdc++.so.6 in Ubuntu 20.04… # MG20221220: Apparently there is some kind of conflict between vtk9.1 & itkwidgets 0.32…
49-
50-
# plotting stuff
51-
- matplotlib=3.5
52-
- gnuplot=5.4
46+
- jupyterlab=3.5.2 # MG20230602: This seems to be needed as well, otherwise jupyter does not start on binder
47+
- notebook=6.4.6 # MG20221226: cf. https://github.com/InsightSoftwareConsortium/itkwidgets/pull/590/files # MG20230601: Somehow this is still needed, despite the updated itkwidgets version…
48+
- traitlets=5.6.0 # MG20221226: cf. https://github.com/InsightSoftwareConsortium/itkwidgets/pull/590/files # MG20230601: Somehow this is still needed, despite the updated itkwidgets version…
5349

5450
- pip
5551
- pip:
56-
# python
57-
- numpy==1.21.6 # MG20240605: meshio seems to be installing a newer numpy…
58-
- zstd
59-
60-
# computing stuff
61-
- gmsh==4.9.0
62-
- meshio==5.3.4
63-
64-
# tracking stuff
6552
- dolfin_warp
6653

6754
variables:
68-
CPATH: /srv/conda/envs/notebook/include/vtk-9.0
55+
CPATH: /srv/conda/envs/notebook/include/vtk-9.2

.repo2docker/postBuild

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ cd
2020
echo "alias ll=\"ls -l\"" >> ~/.bash_aliases
2121
echo "alias la=\"ls -la\"" >> ~/.bash_aliases
2222

23+
export CPATH=$CPATH:"/srv/conda/envs/notebook/include/vtk-9.2"
24+
2325
rm ~/apt.txt
2426
rm ~/environment.yml
2527
rm ~/postBuild

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Welcome to the dolfin_warp tutorials!
22

3-
Main library can be found at https://gitlab.inria.fr/mgenet/dolfin_warp
3+
Main library can be found at https://github.com/mgenet/dolfin_warp
44

5-
Interactive tutorials can be found at https://mgenet.gitlabpages.inria.fr/dolfin_warp-tutorials/index.html.
5+
Interactive tutorials can be found at https://mgenet.github.io/dolfin_warp-tutorials.

index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Welcome to the dolfin_warp tutorials!
22

3-
Main library can be found at [https://gitlab.inria.fr/mgenet/dolfin_warp](https://gitlab.inria.fr/mgenet/dolfin_warp).
3+
Main library can be found at [https://github.com/mgenet/dolfin_warp](https://github.com/mgenet/dolfin_warp).
44

55
Tutorials can be browsed statically but also interactively—to start a session and run the code just click on the rocket icon at the top of a tutorial page and then click on Binder.

0 commit comments

Comments
 (0)