From 7c85e2a0ceee762d135980f78b259cc740a5c489 Mon Sep 17 00:00:00 2001 From: jorgensd Date: Fri, 9 Sep 2022 13:26:54 +0200 Subject: [PATCH] Fix versions --- .github/workflows/build-publish.yml | 47 +++++++++++++++++++++-------- .github/workflows/nightly.yml | 10 +++--- Dockerfile | 2 +- README.md | 2 +- docker/Dockerfile | 2 +- fem.md | 6 ++-- 6 files changed, 46 insertions(+), 23 deletions(-) diff --git a/.github/workflows/build-publish.yml b/.github/workflows/build-publish.yml index acfb2a37..d7f1d7d9 100644 --- a/.github/workflows/build-publish.yml +++ b/.github/workflows/build-publish.yml @@ -1,11 +1,10 @@ # This is a basic workflow to help you get started with Actions -name: Build and publish +name: Test, build and publish # Controls when the action will run. on: - # Triggers the workflow on push or pull request events but only for the master branch push: - branches: [dokken/jupyterbook] + branches: ["*"] # Allows you to run this workflow manually from the Actions tab workflow_dispatch: @@ -17,10 +16,10 @@ on: # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: # This workflow contains a single job called "build" - build-publish: + test: # The type of runner that the job will run on runs-on: ubuntu-latest - container: dokken92/dolfinx_custom:v0.5.0 + container: ghcr.io/jorgensd/dolfinx-tutorial:v0.5.1 env: HDF5_MPI: "ON" @@ -74,13 +73,37 @@ jobs: mpirun -n 3 python3 convergence.py mpirun -n 3 python3 compiler_parameters.py + build-book: + # The type of runner that the job will run on + runs-on: ubuntu-latest + container: ghcr.io/jorgensd/dolfinx-tutorial:v0.5.1 + + env: + HDF5_MPI: "ON" + CC: mpicc + HDF5_DIR: "/usr/local/" + DISPLAY: ":99.0" + PYVISTA_OFF_SCREEN: false + PYVISTA_JUPYTER_BACKEND: "static" + + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v2 # Runs a single command using the runners shell - name: Build the book - run: | - PYVISTA_JUPYTER_BACKEND=static PYVISTA_OFF_SCREEN=false jupyter-book build -W . + run: + jupyter-book build -W . + + publish: + runs-on: ubuntu-latest + + if: github.ref == 'refs/heads/dokken/jupyter-book' + needs: [build-book] + steps: # Push book to HTML to github pages - - name: GitHub Pages action - uses: peaceiris/actions-gh-pages@v3.5.9 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: ./_build/html + - name: GitHub Pages action + uses: peaceiris/actions-gh-pages@v3.5.9 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./_build/html diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index ce187035..c1fe1e19 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -1,14 +1,14 @@ # This is a basic workflow to help you get started with Actions -name: Test against DOLFINx nightly build +name: Test release branch against DOLFINx nightly build # Controls when the action will run. on: # Triggers the workflow on push or pull request events but only for the master branch push: - branches: [dokken/jupyterbook] - pull_request: - branches: - - dokken/jupyterbook + branches: [dokken/release] + # pull_request: + # branches: + # - dokken/jupyterbook # Allows you to run this workflow manually from the Actions tab workflow_dispatch: diff --git a/Dockerfile b/Dockerfile index 81c6072d..043e9352 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM dokken92/dolfinx_custom:v0.5.0 +FROM ghcr.io/jorgensd/dolfinx-tutorial:v0.5.1 # create user with a home directory ARG NB_USER diff --git a/README.md b/README.md index 8812b342..256488f3 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ Any code added to the tutorial should work in parallel. Alternatively, if you want to add a separate chapter, a Jupyter notebook can be added to a pull request, without integrating it into the tutorial. If so, the notebook will be reviewed and modified to be included in the tutorial. # Docker images -Docker images for this tutorial can be found at [Docker hub](https://hub.docker.com/repository/docker/dokken92/dolfinx_custom) +Docker images for this tutorial can be found in the [packages tab](https://github.com/jorgensd/dolfinx-tutorial/pkgs/container/dolfinx-tutorial) Additional requirements on top of the `dolfinx/lab:nightly` images can be found at [Dockerfile](docker/Dockerfile) and [requirements.txt](docker/requirements.txt) diff --git a/docker/Dockerfile b/docker/Dockerfile index 3d04cc85..00274bd5 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,4 +1,4 @@ -FROM dolfinx/lab:v0.5.0 +FROM dolfinx/lab:v0.5.1 WORKDIR /tmp/ diff --git a/fem.md b/fem.md index 75fcc8fc..ae20a7cc 100644 --- a/fem.md +++ b/fem.md @@ -33,15 +33,15 @@ Docker is a software that uses *containers* to supply software across different All notebooks can be converted to python files using [nbconvert](https://nbconvert.readthedocs.io/en/latest/). ### Tutorial compatible docker images -The tutorial uses several dependencies for meshing, plotting and timings. A compatible `JupyterLab` image is available at [DockerHub/dokken92/dolfinx_custom:v0.5.0](https://hub.docker.com/r/dokken92/dolfinx_custom/tags) +The tutorial uses several dependencies for meshing, plotting and timings. A compatible `JupyterLab` image is available in the [Github Packages](https://github.com/jorgensd/dolfinx-tutorial/pkgs/container/dolfinx-tutorial)) To use the notebooks in this tutorial with DOLFINx on your own computer, you should use the docker image using the following command ```bash - docker run --init -p 8888:8888 -v "$(pwd)":/root/shared dokken92/dolfinx_custom:v0.5.0 + docker run --init -p 8888:8888 -v "$(pwd)":/root/shared ghcr.io/jorgensd/dolfinx-tutorial:v0.5.1 ``` This image can also be used as a normal docker container by adding: ```bash - docker run --ti -v "$(pwd)":/root/shared --entrypoint="/bin/bash" dokken92/dolfinx_custom:v0.5.0 + docker run --ti -v "$(pwd)":/root/shared --entrypoint="/bin/bash" ghcr.io/jorgensd/dolfinx-tutorial:v0.5.1 ``` The tutorials can also be exported as a notebook or PDF by clicking the ![Download](save.png)-symbol in the top right corner of the relevant tutorialThe notebook can in turn be used with a Python kernel which has DOLFINx.