Skip to content

Commit

Permalink
Merge branch 'master' into move-clustering-algos
Browse files Browse the repository at this point in the history
  • Loading branch information
mloubout committed Jan 21, 2020
2 parents 2971618 + 888a606 commit 3256145
Show file tree
Hide file tree
Showing 5 changed files with 194 additions and 88 deletions.
165 changes: 83 additions & 82 deletions .github/workflows/pytest-core-nompi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,127 +11,128 @@ on:
- master

jobs:
ci-linux:
pytest:
name: ${{ matrix.name }}
runs-on: ubuntu-16.04
runs-on: "${{ matrix.os }}"

env:
DEVITO_ARCH: "gcc-${{ matrix.gcc-version }}"
DEVITO_ARCH: "${{ matrix.arch }}"
DEVITO_OPENMP: ${{ matrix.openmp }}
DEVITO_BACKEND: "core"
OMP_NUM_THREADS: 2
CC: "gcc-${{ matrix.gcc-version }}"
CXX: "g++-${{ matrix.gcc-version }}"
PYTHON_VERSION: "${{ matrix.python-version }}"
TESTS: "tests/"

strategy:
# Prevent all build to stop if a single one fails
fail-fast: false

matrix:
name: [
py36-gcc49-openmp,
py37-gcc5-openmp,
py38-gcc6-openmp,
py36-gcc7-openmp,
py37-gcc7-noopenmp,
py37-gcc8-openmp,
py38-gcc9-openmp
pytest-ubuntu-py36-gcc49-omp,
pytest-ubuntu-py37-gcc5-omp,
pytest-ubuntu-py38-gcc6-omp,
pytest-ubuntu-py36-gcc7-omp,
pytest-ubuntu-py37-gcc7-noomp,
pytest-ubuntu-py37-gcc8-omp,
pytest-ubuntu-py38-gcc9-omp,
pytest-osx-py37-clang-omp,
pytest-docker-py36-gcc-omp
]
include:
- name: py36-gcc49-openmp
python-version: 3.6
gcc-version: 4.9
openmp: 1

- name: py37-gcc5-openmp
python-version: 3.7
gcc-version: 5
openmp: 1

- name: py38-gcc6-openmp
python-version: 3.8
gcc-version: 6
openmp: 1

- name: py36-gcc7-openmp
python-version: 3.6
gcc-version: 7
openmp: 1

- name: py37-gcc7-noopenmp
python-version: 3.7
gcc-version: 7
openmp: 0

- name: py37-gcc8-openmp
python-version: 3.7
gcc-version: 8
openmp: 1

- name: py38-gcc9-openmp
python-version: 3.8
gcc-version: 9
openmp: 1
- name: pytest-ubuntu-py36-gcc49-omp
python-version: 3.6
os: ubuntu-16.04
arch: "gcc-4.9"
openmp: 1

- name: pytest-ubuntu-py37-gcc5-omp
python-version: 3.7
os: ubuntu-16.04
arch: "gcc-5"
openmp: 1

- name: pytest-ubuntu-py38-gcc6-omp
python-version: 3.8
os: ubuntu-16.04
arch: "gcc-6"
openmp: 1

- name: pytest-ubuntu-py36-gcc7-omp
python-version: 3.6
os: ubuntu-16.04
arch: "gcc-7"
openmp: 1

- name: pytest-ubuntu-py37-gcc7-noomp
python-version: 3.7
os: ubuntu-16.04
arch: "gcc-7"
openmp: 0

- name: pytest-ubuntu-py37-gcc8-omp
python-version: 3.7
os: ubuntu-16.04
arch: "gcc-8"
openmp: 1

- name: pytest-ubuntu-py38-gcc9-omp
python-version: 3.8
os: ubuntu-16.04
arch: "gcc-9"
openmp: 1

- name: pytest-osx-py37-clang-omp
python-version: 3.7
os: macos-latest
arch: "osx"
openmp: 0

- name: pytest-docker-py36-gcc-omp
python-version: 3.6
os: ubuntu-16.04
arch: "gcc"
openmp: 1

steps:
- name: Checkout devito
uses: actions/checkout@v1

- name: Set up Python ${{ matrix.python-version }}
if: matrix.name != 'pytest-docker-py36-gcc-omp'
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}

- name: Install GCC ${{ matrix.gcc-version }}
run : |
sudo apt-get install -y g++-${{ matrix.gcc-version }}
- name: Install dependencies
- name: Build docker image
if: matrix.name == 'pytest-docker-py36-gcc-omp'
run: |
pip install --upgrade pip
pip install -e .
- name: Test with pytest
run: |
pytest --cov --cov-config=.coveragerc --cov-report=xml tests/
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1.0.5
with:
token: ${{ secrets.CODECOV_TOKEN }}
name: ${{ matrix.name }}

# OSX
ci-osx:
name: py37-clang-osx
runs-on: macos-latest
docker build . --file docker/Dockerfile --tag devito_img
echo "::set-env name=RUN_CMD::docker run --rm --name testrun devito_img"
env:
DEVITO_ARCH: "osx"
DEVITO_OPENMP: 0
DEVITO_BACKEND: "core"

steps:
- name: Checkout devito
uses: actions/checkout@v1
- name: Install GCC ${{ matrix.arch }}
if: runner.os == 'linux'
run : |
sudo apt-get install -y ${{ matrix.arch }}
- name: Set up Python 3.7
uses: actions/setup-python@v1
with:
python-version: 3.7
- name: Reduce number of tests for OSX
if: runner.os == 'macOS'
run : |
echo "::set-env name=TESTS::tests/test_operator.py"
- name: Install dependencies
if: matrix.name != 'pytest-docker-py36-gcc-omp'
run: |
pip install --upgrade pip
pip install -e .
- name: Test with pytest
run: |
pytest --cov --cov-config=.coveragerc --cov-report=xml tests/test_operator.py
$RUN_CMD pytest -m "not parallel" --cov --cov-config=.coveragerc --cov-report=xml $TESTS
- name: Upload coverage to Codecov
if: matrix.name != 'pytest-docker-py36-gcc-omp'
uses: codecov/codecov-action@v1.0.5
with:
token: ${{ secrets.CODECOV_TOKEN }}
name: "py37-clang-osx"
name: ${{ matrix.name }}
1 change: 0 additions & 1 deletion .github/workflows/pytest-yask.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ jobs:

- name: Install yask
run : |
sudo apt-get update
sudo apt-get install -y swig
make compiler-api
pip install -e .
Expand Down
105 changes: 105 additions & 0 deletions .github/workflows/tutorials.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
name: Jupyter Notebooks

on:
# Trigger the workflow on push or pull request,
# but only for the master branch
push:
branches:
- master
pull_request:
branches:
- master

jobs:
tutorials:
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}

env:
DEVITO_ARCH: "${{ matrix.compiler }}"
DEVITO_OPENMP: ${{ matrix.openmp }}
DEVITO_BACKEND: "core"
PYTHON_VERSION: "3.7"
RUN_CMD: ""

strategy:
# Prevent all build to stop if a single one fails
fail-fast: false
matrix:
name: [
tutos-ubuntu-gcc-py37,
tutos-osx-gcc-py37,
tutos-osx-clang-py37,
tutos-docker-gcc-py36
]

include:
- name: tutos-ubuntu-gcc-py37
os: ubuntu-16.04
compiler: gcc-7
openmp: 1

- name: tutos-osx-gcc-py37
os: macos-latest
compiler: gcc-9
openmp: 1

- name: tutos-osx-clang-py37
os: macos-latest
compiler: clang
openmp: 0

- name: tutos-docker-gcc-py36
os: ubuntu-latest
compiler: gcc
openmp: 1

steps:
- name: Checkout devito
uses: actions/checkout@v1

- name: Set up Python 3.7
if: matrix.name != 'tutos-docker-gcc-py36'
uses: actions/setup-python@v1
with:
python-version: 3.7

- name: Install compilers for OSX
if: runner.os == 'macOS'
run: |
if [ "${{ matrix.compiler }}" = "gcc-9" ]; then
brew install gcc
else
sudo xcode-select -s /Applications/Xcode_11.app/Contents/Developer
fi
# dask error on osx, skip dask tuto
echo "::set-env name=SKIP::--deselect=examples/seismic/tutorials/04_dask.ipynb"
- name: Build docker image
if: matrix.name == 'tutos-docker-gcc-py36'
run: |
docker build . --file docker/Dockerfile --tag devito_img
echo "::set-env name=RUN_CMD::docker run --rm --name testrun devito_img"
- name: Install dependencies
if: matrix.name != 'tutos-docker-gcc-py36'
run: |
python -m pip install --upgrade pip
pip install -e .
pip install matplotlib
- name: Seismic notebooks
run: |
$RUN_CMD py.test --nbval $SKIP examples/seismic/tutorials/
- name: CFD notebooks
run: |
$RUN_CMD py.test --nbval examples/cfd
- name: User api notebooks
run: |
$RUN_CMD py.test --nbval examples/userapi
- name: User api notebooks
run: |
$RUN_CMD py.test --nbval examples/compiler
9 changes: 5 additions & 4 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
FROM python:3.6

RUN apt-get update && apt-get install -y -q \
mpich \
libmpich-dev
RUN apt-get update && apt-get install -y -q \
mpich \
libmpich-dev

ADD ./requirements.txt /app/requirements.txt
ADD ./requirements-optional.txt /app/requirements-optional.txt
Expand All @@ -16,6 +16,7 @@ RUN python3 -m venv /venv && \
ADD ./devito /app/devito
ADD ./tests /app/tests
ADD ./examples /app/examples
COPY setup.cfg /app/

ADD docker/run-jupyter.sh /jupyter
ADD docker/run-tests.sh /tests
Expand All @@ -31,7 +32,7 @@ RUN chmod +x \
WORKDIR /app

ENV DEVITO_ARCH="gcc"
ENV DEVITO_OPENMP="0"
ENV DEVITO_OPENMP="1"

EXPOSE 8888
ENTRYPOINT ["/docker-entrypoint.sh"]
Expand Down
2 changes: 1 addition & 1 deletion tests/test_environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ def test_python_version():
# Installed version
i_ver = platform.python_version()

assert i_ver.startswith(e_ver)
assert e_ver is None or i_ver.startswith(e_ver)

0 comments on commit 3256145

Please sign in to comment.