Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update for 2.14 release #642

Merged
merged 89 commits into from
Nov 23, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
89 commits
Select commit Hold shift + click to select a range
84b527c
Dockerfile updates.
julesghub Oct 20, 2022
ac1034d
Add some documentation
julesghub Oct 20, 2022
94e5748
Activate UWGeo testing
julesghub Oct 20, 2022
916e98d
Updates github actions for Dockerfile change
julesghub Oct 20, 2022
9a694e6
Update CI.yml
julesghub Oct 20, 2022
13a210b
Update CI.yml
julesghub Oct 20, 2022
08f87fe
Update CI.yml
julesghub Oct 20, 2022
eaf56b7
Update CI.yml
julesghub Oct 20, 2022
f6260fc
Update CI.yml
julesghub Oct 20, 2022
eab81ba
Update CI.yml
julesghub Oct 20, 2022
d1c3f75
Update CI.yml
julesghub Oct 20, 2022
1f5911c
Update CI.yml
julesghub Oct 20, 2022
4183bd1
Update CI.yml
julesghub Oct 20, 2022
4d6c2b2
Update CI.yml
julesghub Oct 20, 2022
e40fb3c
Update CI.yml
julesghub Oct 20, 2022
ab023a1
Update CI.yml
julesghub Oct 21, 2022
9b558f1
Update CI.yml
julesghub Oct 21, 2022
f8adc30
Update CI.yml
julesghub Oct 21, 2022
d238619
Update CI.yml
julesghub Oct 21, 2022
8ce1176
Update CI.yml
julesghub Oct 21, 2022
7a5c298
Update CI.yml
julesghub Oct 21, 2022
dc9387a
Updating versions of github actions
julesghub Oct 21, 2022
4561853
Fixing petsc image name
julesghub Oct 21, 2022
7dae654
Rebuild UW is the dockerfile changes
julesghub Oct 21, 2022
37c7c2f
Add checks
julesghub Oct 21, 2022
f11470d
Forgot github action variable
julesghub Oct 21, 2022
99d7de9
checks variable is working or not?
julesghub Oct 21, 2022
f2d16ba
Can't get underworld check in github action to work ???!!!
julesghub Oct 21, 2022
75d38a5
Fix?
julesghub Oct 21, 2022
a49431a
Typo fix
julesghub Oct 21, 2022
1a96d02
Update CI.yml
julesghub Oct 21, 2022
d87ce16
Update CI.yml
julesghub Oct 21, 2022
e3c17e2
Update CI.yml
julesghub Oct 21, 2022
26da13d
Update CI.yml
julesghub Oct 21, 2022
d20387d
Update CI.yml
julesghub Oct 21, 2022
9d42f05
Update CI.yml
julesghub Oct 21, 2022
7ffc284
Including vim in find docker image
julesghub Oct 23, 2022
70dc72f
Better way to look for h5 units.
julesghub Oct 23, 2022
57c6011
Merge branch 'dockerfile-updates' of github.com:julesghub/underworld2…
julesghub Oct 23, 2022
d8e97da
Updates to build docker
julesghub Oct 24, 2022
270f80a
Enable tests round 1
julesghub Oct 24, 2022
bb789c9
Update CI.yml
julesghub Oct 24, 2022
e30a072
Update CI.yml
julesghub Oct 24, 2022
d8a2268
Renmae UWGeo test, they take a while, might reintroduce later
julesghub Oct 24, 2022
f0f5851
Merge branch 'dockerfile-updates' of github.com:julesghub/underworld2…
julesghub Oct 24, 2022
f6d5f4b
Revert "Renmae UWGeo test, they take a while, might reintroduce later"
julesghub Oct 24, 2022
973448a
Smarter way to disable UWgeo tests for CI
julesghub Oct 24, 2022
8a9ab6a
Typo fix
julesghub Oct 24, 2022
8207708
Typo #2
julesghub Oct 24, 2022
f764396
opss, fixes broken units check, thanks tests ;)
julesghub Oct 24, 2022
39fb0ca
Typo #3
julesghub Oct 24, 2022
4f1f33a
type #4
julesghub Oct 24, 2022
d899737
Enable multi arch build !!!
julesghub Oct 25, 2022
14d060d
Update for dockerfiles and macos
julesghub Nov 8, 2022
3101310
Rename docker images
julesghub Nov 8, 2022
5818f9e
Update Dockerfile
julesghub Nov 8, 2022
d17db15
Update Dockerfile
julesghub Nov 8, 2022
6ca71ae
Update Dockerfile
julesghub Nov 8, 2022
3779c6e
CHAGES.md and checkin docker-builder.sh for manual docker image creation
Nov 8, 2022
f74f92c
docs/development/docker/docker-builder.sh
julesghub Nov 8, 2022
5344c6e
Updates for conda - still testing
julesghub Nov 16, 2022
3ff101d
Update CI.yml
julesghub Nov 16, 2022
8bfb51b
Update CI.yml
julesghub Nov 16, 2022
125e575
Update CI.yml
julesghub Nov 16, 2022
b61a20b
Update CI.yml
julesghub Nov 16, 2022
cff85ce
Testing conda-forge connection to github actions
julesghub Nov 17, 2022
294fc4f
Merge branch 'dockerfile-updates' of github.com:julesghub/underworld2…
julesghub Nov 17, 2022
8555344
Making petsc version a build-arg for the dockerfiles.
julesghub Nov 17, 2022
21228ed
Typo and adding UW_VERSION to github actions too.
julesghub Nov 17, 2022
2f8c4e3
Update CI.yml
julesghub Nov 17, 2022
fc184a0
Disable arm build for underworld image - easier for now.
julesghub Nov 17, 2022
aa099a9
Dockerfile go
julesghub Nov 17, 2022
c3a1d71
Work please
julesghub Nov 17, 2022
c3899c0
Dockerfile madness
julesghub Nov 17, 2022
e363cdb
Pin down psutil as a dependency was updating it - breaking jupyter-lab
julesghub Nov 18, 2022
a46590c
Updates
julesghub Nov 18, 2022
9334bd0
psutil set to 5.9.3 for github action builds
julesghub Nov 18, 2022
9fe7fa3
Touch Lavavu
julesghub Nov 18, 2022
c39708a
Dockerfile touch ups
julesghub Nov 21, 2022
347e6bd
fix
julesghub Nov 21, 2022
d6c3a03
Fix typo in docker label
julesghub Nov 21, 2022
50480ea
v2.14 branch upto with dev development (#640)
julesghub Nov 21, 2022
d7eb4eb
Merge branch 'v2.14.x' into dockerfile-updates
julesghub Nov 21, 2022
8c3f434
Add build-args for openmpi Docker creation
julesghub Nov 23, 2022
422f923
Merge branch 'dockerfile-updates' of github.com:julesghub/underworld2…
julesghub Nov 23, 2022
201e0fa
Dockerfile updates (#1)
julesghub Nov 23, 2022
3b753b0
Enable the default args
julesghub Nov 23, 2022
c0c575a
Merge branch 'dockerfile-updates' into development
julesghub Nov 23, 2022
c058575
disable petsc in github workflows
julesghub Nov 23, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
228 changes: 120 additions & 108 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,24 @@ on:
release:
workflow_dispatch:

env:
PETSC_VERSION: 3.18.1
UW_VERSION: 2.14.0
OMPI_VERSION: 4.1.4

jobs:

check:
name: Check if Docker files have changed
runs-on: ubuntu-latest
outputs:
run_ompi: ${{ steps.check_files.outputs.run_ompi }}
run_petsc: ${{ steps.check_files.outputs.run_petsc }}
run_lavavu: ${{ steps.check_files.outputs.run_lavavu }}
run_base: ${{ steps.check_files.outputs.run_base }}
runs-on: ubuntu-latest
run_uw: ${{ steps.check_files.outputs.run_uw }}
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 2

Expand All @@ -29,47 +35,93 @@ jobs:
echo "========== check paths of changed files =========="
git diff --name-only HEAD^ HEAD > files.txt

echo "::set-output name=run_base::false"
echo "::set-output name=run_petsc::false"
echo "::set-output name=run_lavavu::false"
echo "run_ompi=false" >> $GITHUB_OUTPUT
echo "run_petsc=false" >> $GITHUB_OUTPUT
echo "run_lavavu=false" >> $GITHUB_OUTPUT
echo "run_uw=false" >> $GITHUB_OUTPUT

while IFS= read -r file
do
echo $file
if [[ $file == "docs/development/docker/petsc/Dockerfile" ]]; then
echo "Change to the Petsc Docker file have been detected."
echo "::set-output name=run_petsc::true"
echo "::set-output name=run_base::true"
echo "run_petsc=true" >> $GITHUB_OUTPUT
continue
fi
if [[ $file == "docs/development/docker/lavavu/Dockerfile" ]]; then
echo "Change to the Lavavu Docker file have been detected."
echo "::set-output name=run_lavavu::true"
echo "::set-output name=run_base::true"
echo "run_lavavu=true" >> $GITHUB_OUTPUT
continue
fi
if [[ $file == "docs/development/docker/base/Dockerfile" ]]; then
if [[ $file == "docs/development/docker/mpi/Dockerfile.openmpi" ]]; then
echo "Change to the Base Docker file have been detected."
echo "::set-output name=run_base::true"
echo "run_ompi=true" >> $GITHUB_OUTPUT
continue
fi
if [[ $file == "docs/development/docker/underworld2/Dockerfile" ]]; then
echo "Change to the Underworld Docker file have been detected."
echo "run_uw=true" >> $GITHUB_OUTPUT
continue
fi
done < files.txt

debug_check:
runs-on: ubuntu-latest
needs: check
steps:
- run: echo ${{ needs.check.outputs.run_ompi }} ${{needs.check.outputs.run_petsc}} ${{needs.check.outputs.run_lavavu}} ${{needs.check.outputs.run_uw}}

build_ompi_image:
name: Build OpenMPI Docker image
needs: check
if: needs.check.outputs.run_ompi == 'true' || github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
steps:

- name: Checkout
uses: actions/checkout@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Set up QEMU
uses: docker/setup-qemu-action@v2

- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build Base Docker Image
uses: docker/build-push-action@v3
with:
context: .
push: true
build-args: OMPI_VERSION = ${{ env.OMPI_VERSION }}
file: ./docs/development/docker/mpi/Dockerfile.openmpi
platforms: linux/amd64, linux/arm64
tags: julesg/openmpi:${{ env.OMPI_VERSION }}

build_petsc_image:
name: Build PETSc Docker image
needs: check
if: needs.check.outputs.run_petsc == 'true' || github.event_name == 'workflow_dispatch'
needs: [check, build_ompi_image]
#if: always() && (needs.check.outputs.run_petsc == 'true' || github.event_name == 'workflow_dispatch')
if: false # disable petsc github action
runs-on: ubuntu-latest
steps:

- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v2

- name: Set up QEMU
uses: docker/setup-qemu-action@v2

- name: Login to DockerHub
uses: docker/login-action@v1
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
Expand All @@ -79,14 +131,19 @@ jobs:
with:
context: .
push: true
build-args: PETSC_VERSION=${{ env.PETSC_VERSION }}
file: ./docs/development/docker/petsc/Dockerfile
platforms: linux/amd64
tags: underworldcode/petsc:amd64
tags: julesg/petsc:${{ env.PETSC_VERSION }}-amd64

- name: Update manifest
run: |
docker manifest create underworldcode/petsc --amend underworldcode/petsc:amd64 --amend underworldcode/petsc:arm64
docker manifest push underworldcode/petsc
## Github action's times out building petsc multi arch, so manifest commands
## must be manually applied, below is an example of the commands
# - name: Update manifest
# run: |
# docker build -f ./docs/development/petsc/Dockerfile -t julesg/petsc:3.18.0-arm64
# docker push julesg/petsc-3.18.0:arm64
# docker manifest create julesg/petsc:3.18.0 --amend julesg/petsc:3.18.0-amd64 --amend julesg/petsc:3.18.0-arm64
# docker manifest push julesg/petsc:3.18.0

build_lavavu_image:
name: Build Lavavu Docker image
Expand All @@ -96,128 +153,82 @@ jobs:
steps:

- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Set up QEMU
uses: docker/setup-qemu-action@v1
uses: docker/setup-qemu-action@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v2

- name: Login to DockerHub
uses: docker/login-action@v1
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build Lavavu Docker Image
uses: docker/build-push-action@v2
uses: docker/build-push-action@v3
with:
context: .
push: true
file: ./docs/development/docker/lavavu/Dockerfile
platforms: linux/amd64
tags: underworldcode/lavavu:amd64

- name: Update manifest
run: |
docker manifest create underworldcode/lavavu --amend underworldcode/lavavu:amd64 --amend underworldcode/lavavu:arm64
docker manifest push underworldcode/lavavu


build_base_image:
name: Build Base Docker image
needs: [check, build_lavavu_image, build_petsc_image]
if: ${{ always() && contains(needs.*.result, 'success') && !(contains(needs.*.result, 'failure')) && (needs.check.outputs.run_base == 'true')}}
runs-on: ubuntu-latest
steps:

- name: Checkout
uses: actions/checkout@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build Base Docker Image
uses: docker/build-push-action@v2
with:
context: .
push: true
file: ./docs/development/docker/base/Dockerfile
platforms: linux/amd64
tags: underworldcode/base:amd64

- name: Update manifest
run: |
docker manifest create underworldcode/base --amend underworldcode/base:amd64 --amend underworldcode/base:arm64
docker manifest push underworldcode/base

platforms: linux/amd64, linux/arm64
tags: julesg/lavavu

build_underworld_image:
name: Build Underworld Image
needs: [check, build_petsc_image, build_lavavu_image]
# if: always()
if: always() && ( needs.check.outputs.run_uw == 'true' || github.event_name == 'workflow_dispatch' || github.event_name == 'release' )
runs-on: ubuntu-latest
needs: [build_base_image]
if: github.event_name == 'release' || github.event_name == 'workflow_dispatch'
steps:

- name: Checkout
uses: actions/checkout@v2

uses: actions/checkout@v3

- name: Set up QEMU
uses: docker/setup-qemu-action@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
uses: docker/setup-buildx-action@v2

- name: Update sha256
run: |
docker pull underworldcode/base
SHA256=$(docker inspect --format='{{index .RepoDigests 0}}' underworldcode/base)
sed -i "/sha256/c\FROM ${SHA256} as base_runtime" ./docs/development/docker/underworld2/Dockerfile

- name: Login to DockerHub
uses: docker/login-action@v1
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build Underworld Docker Image
uses: docker/build-push-action@v2
uses: docker/build-push-action@v3
with:
context: .
push: true
build-args: PETSC_VERSION=${{ env.PETSC_VERSION }}
file: ./docs/development/docker/underworld2/Dockerfile
platforms: linux/amd64
tags: underworldcode/underworld2:amd64

- name: Update manifest
run: |
docker manifest create underworldcode/underworld2 --amend underworldcode/underworld2:amd64 --amend underworldcode/underworld2:arm64
docker manifest push underworldcode/underworld2

platforms: linux/amd64, linux/arm64
tags: julesg/underworld2:${{ env.UW_VERSION }}b

test_in_UW_Container:
name: Test in Docker Container
needs: [build_base_image]
needs: build_underworld_image
if: always()
#if: false() # DEBUG: disabling tests
runs-on: ubuntu-latest
container:
image: underworldcode/base
image: julesg/underworld2:2.14.0b
options: --user root
steps:

- name: Build dependencies
run: |
apt-get update -qq
DEBIAN_FRONTEND=noninteractive apt-get install -yq --no-install-recommends build-essential pkg-config python3-dev swig libxml2-dev cmake ninja-build
DEBIAN_FRONTEND=noninteractive xargs -a /opt/installed.txt apt-get install -yq --no-install-recommends
# Note all python dependencies should be in the runtime container

- name: Runtime dependencies
- name: Remove existing Underworld from container
run: |
apt-get update -qq
DEBIAN_FRONTEND=noninteractive apt-get install -yq --no-install-recommends libxml2 libpython3.10
pip uninstall -y underworld

- name: Checkout
uses: actions/checkout@v2
Expand All @@ -228,14 +239,13 @@ jobs:

- name: Run Tests
run: |
pip install pytest nbmake
cd docs
pytest -vvv pytests/*
cd test
cp -rf ../UWGeodynamics/examples UWGeodynamics/.
cp -rf ../UWGeodynamics/tutorials UWGeodynamics/.
cp -rf ../UWGeodynamics/benchmarks UWGeodynamics/.
pytest -vvv UWGeodynamics
pytest -vvv pytests/test.py pytests/test_examples.py pytests/test_user_guide.py
#cd test
#cp -rf ../UWGeodynamics/examples UWGeodynamics/.
#cp -rf ../UWGeodynamics/tutorials UWGeodynamics/.
#cp -rf ../UWGeodynamics/benchmarks UWGeodynamics/.
#pytest -vvv UWGeodynamics


conda_build:
Expand All @@ -247,29 +257,31 @@ jobs:
os: ["ubuntu-latest", "macos-latest"]
python-version: ["3.8", "3.9", "3.10"]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true
python-version: ${{ matrix.python-version }}

- name: Config Conda
shell: bash -l {0}
run: |
conda install --channel conda-forge conda-build anaconda-client conda-verify
conda config --add channels conda-forge
conda config --add channels underworldcode
conda config --set anaconda_upload no

anaconda logout

- name: Config Conda For Upload
if: github.event_name == 'release'
shell: bash -l {0}
run: conda config --set anaconda_upload yes

- name: Upload new Packages
if: github.event_name == 'release'
shell: bash -l {0}
run: |
conda info
anaconda login --hostname github-actions-${{ matrix.os }}-$RANDOM --username ${{ secrets.ANACONDA_USERNAME }} --password ${{ secrets.ANACONDA_PASSWORD }}
conda-build --channel conda-forge --user geo-down-under conda
anaconda logout
Expand All @@ -284,7 +296,7 @@ jobs:
os: ["ubuntu-latest", "macos-latest"]
python-version: ["3.8", "3.9", "3.10"]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v2
with:
Expand Down
Loading