Skip to content

Commit

Permalink
Merge branch 'master' into dataserver-refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
Ben Mather committed Aug 5, 2024
2 parents 943ce49 + 1567e6f commit 6609a4e
Show file tree
Hide file tree
Showing 135 changed files with 21,549 additions and 12,576 deletions.
81 changes: 81 additions & 0 deletions .github/workflows/build-and-push-docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
name: build and push docker

on:
push:
tags:
- 'v*.*.*'
branches:
- build-docker-image

jobs:
docker:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v4
-
name: Decide the docker image version number
run: |
if [[ -f ./docker/build-docker-image-version.txt ]]; then
echo "DOCKER_IMAGE_TAG=$( tail -n 1 ./docker/build-docker-image-version.txt )" >> $GITHUB_ENV
else
echo "DOCKER_IMAGE_TAG=${{ github.ref_name }}" >> $GITHUB_ENV
fi
echo ${{ env.DOCKER_IMAGE_TAG }}
-
name: Set up QEMU
uses: docker/setup-qemu-action@v3
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
-
name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
-
name: Build and push gplately amd64
uses: docker/build-push-action@v5
with:
context: .
file: ./docker/Dockerfile
push: true
platforms: linux/amd64
provenance: false
tags: |
gplates/gplately:amd64-${{ env.DOCKER_IMAGE_TAG }}
ghcr.io/gplates/gplately:amd64-${{ env.DOCKER_IMAGE_TAG }}
-
name: Build and push gplately arm64
uses: docker/build-push-action@v5
with:
context: .
file: ./docker/Dockerfile
push: true
platforms: linux/arm64
provenance: false
tags: |
gplates/gplately:arm64-${{ env.DOCKER_IMAGE_TAG }}
ghcr.io/gplates/gplately:arm64-${{ env.DOCKER_IMAGE_TAG }}
-
name: Create cross-platform images
run: |
docker buildx imagetools create -t gplates/gplately:${{ env.DOCKER_IMAGE_TAG }} gplates/gplately:amd64-${{ env.DOCKER_IMAGE_TAG }} gplates/gplately:arm64-${{ env.DOCKER_IMAGE_TAG }}
docker buildx imagetools create -t ghcr.io/gplates/gplately:${{ env.DOCKER_IMAGE_TAG }} ghcr.io/gplates/gplately:amd64-${{ env.DOCKER_IMAGE_TAG }} ghcr.io/gplates/gplately:arm64-${{ env.DOCKER_IMAGE_TAG }}
-
name: Create the latest tags
if:
run: |
if [[ -f ./docker/build-docker-image-version.txt ]]; then
docker buildx imagetools create -t gplates/gplately:latest gplates/gplately:amd64-${{ env.DOCKER_IMAGE_TAG }} gplates/gplately:arm64-${{ env.DOCKER_IMAGE_TAG }}
docker buildx imagetools create -t ghcr.io/gplates/gplately:latest ghcr.io/gplates/gplately:amd64-${{ env.DOCKER_IMAGE_TAG }} ghcr.io/gplates/gplately:arm64-${{ env.DOCKER_IMAGE_TAG }}
fi
9 changes: 6 additions & 3 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,16 @@ jobs:
defaults:
run:
shell: bash -el {0}


if: github.event.pull_request.draft == false
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- uses: mamba-org/setup-micromamba@v1
with:
micromamba-version: "1.3.1-0"
micromamba-version: "1.5.8-0"
environment-file: tests-dir/test-env.yml
create-args: >-
python=${{ matrix.python-version }}
init-shell: >-
bash
powershell
Expand Down
88 changes: 51 additions & 37 deletions .github/workflows/deploy_documentation.yaml
Original file line number Diff line number Diff line change
@@ -1,45 +1,59 @@

name: Build docs and deploy to GitHub Pages

on:
on:
push:
branches: [master]
branches:
- master
pull_request:
branches: [master]
branches:
- master

jobs:
build-and-deploy:
runs-on: ubuntu-20.04

runs-on: ubuntu-latest
defaults:
run:
shell: bash -l {0}

if: github.event.pull_request.draft == false
steps:
- uses: actions/checkout@v2
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 pytest pdoc3
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
sudo apt-get update
sudo apt-get install -yq wget libboost-python-dev libboost-program-options-dev libgdal-dev libglew-dev libglu1-mesa libproj-dev libqt5core5a libqt5gui5 libqt5network5 libqt5opengl5 libqt5svg5 libqt5widgets5 libqt5xml5 libqt5xmlpatterns5 libqwt-qt5-6
wget https://www.earthbyte.org/webdav/ftp/earthbyte/pygplates/pygplates-py3_rev33_ubuntu-20.04-amd64.deb -O pygplates_package.deb
yes | sudo dpkg -i pygplates_package.deb
- name: Install jupyter with nbconvert
run: |
pip install jupyter
- name: Install gplately
run: |
pip install .
- name : Generate documentation with pdoc3
run : |
export PYTHONPATH=$PYTHONPATH:/usr/lib/
export LD_PRELOAD=/lib/x86_64-linux-gnu/libstdc++.so.6:$LD_PRELOAD
pdoc --config latex_math=True --template-dir .pdoc_template --html -o api --force gplately
- name: Convert jupyter notebooks to html
run : |
export PYTHONPATH=$PYTHONPATH:/usr/lib/
export LD_PRELOAD=/lib/x86_64-linux-gnu/libstdc++.so.6:$LD_PRELOAD
jupyter-nbconvert --to=html --output-dir=api/gplately/ Notebooks/*.ipynb
- name : Deploy to gh-pages
uses: JamesIves/github-pages-deploy-action@v4.2.2
with:
branch: gh-pages
folder: api/gplately/
- uses: actions/checkout@v4
- uses: mamba-org/setup-micromamba@v1
with:
micromamba-version: "1.5.8-0"
environment-file: conda/doc-env.yml
init-shell: >-
bash
cache-environment: true
post-cleanup: "all"

- name: Install current gplately
run: |
pip install . --no-binary :all: --no-cache-dir --no-dependencies
- name: test pygmt
run: python -c "import pygmt"
shell: bash -el {0}

- name: test jupyter-nbconvert
run: jupyter-nbconvert --version
shell: bash -el {0}

- name: test pdoc
run: pdoc --version
shell: bash -el {0}

- name: Generate documentation with pdoc3
run: pdoc --config latex_math=True --template-dir .pdoc_template --html -o api --force gplately
shell: bash -el {0}

- name: Convert jupyter notebooks to html
run: jupyter-nbconvert --to=html --output-dir=api/gplately/ Notebooks/*.ipynb
shell: bash -el {0}

- name: Deploy to gh-pages
uses: JamesIves/github-pages-deploy-action@v4.2.2
with:
branch: gh-pages
folder: api/gplately/
target-folder: dev-doc/
33 changes: 7 additions & 26 deletions .github/workflows/publish_to_pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,31 +17,12 @@ permissions:

jobs:
deploy:

runs-on: ubuntu-20.04
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.8'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 pytest
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
sudo apt-get update
sudo apt-get install -yq wget libboost-python-dev libboost-program-options-dev libgdal-dev libglew-dev libglu1-mesa libproj-dev libqt5core5a libqt5gui5 libqt5network5 libqt5opengl5 libqt5svg5 libqt5widgets5 libqt5xml5 libqt5xmlpatterns5 libqwt-qt5-6
wget https://www.earthbyte.org/webdav/ftp/earthbyte/pygplates/pygplates-py3_rev33_ubuntu-20.04-amd64.deb -O pygplates_package.deb
yes | sudo dpkg -i pygplates_package.deb
- name: Build package
run: |
export PYTHONPATH=$PYTHONPATH:/usr/lib/
export LD_PRELOAD=/lib/x86_64-linux-gnu/libstdc++.so.6:$LD_PRELOAD
python setup.py sdist
- name: Publish package
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
- name: Checkout
uses: actions/checkout@v4
- name: Publish package
run: |
chmod +x ./scripts/pypi-publish.sh
./scripts/pypi-publish.sh '${{secrets.PYPI_API_TOKEN}}'
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@ __pycache__
.ipynb_checkpoints

output

*.log
8 changes: 8 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"editor.formatOnSave": true,
"editor.defaultFormatter": "ms-python.black-formatter",
"[python]": {
"editor.defaultFormatter": "ms-python.black-formatter"
},
"git.ignoreLimitWarning": true
}
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include gplately/logging_config.yaml
63 changes: 27 additions & 36 deletions Notebooks/03-WorkingWithPoints.ipynb

Large diffs are not rendered by default.

143 changes: 52 additions & 91 deletions Notebooks/04-VelocityBasics.ipynb

Large diffs are not rendered by default.

134 changes: 45 additions & 89 deletions Notebooks/05-WorkingWithFeatureGeometries.ipynb

Large diffs are not rendered by default.

321 changes: 217 additions & 104 deletions Notebooks/06-Rasters.ipynb

Large diffs are not rendered by default.

51 changes: 22 additions & 29 deletions Notebooks/07-WorkingWithPlateTectonicStats.ipynb

Large diffs are not rendered by default.

61 changes: 33 additions & 28 deletions Notebooks/08-PredictingSlabFlux.ipynb

Large diffs are not rendered by default.

88 changes: 39 additions & 49 deletions Notebooks/09-CreatingMotionPathsAndFlowlines.ipynb

Large diffs are not rendered by default.

Loading

0 comments on commit 6609a4e

Please sign in to comment.