Skip to content

Commit

Permalink
Merge pull request #2362 from devitocodes/osx-arm
Browse files Browse the repository at this point in the history
CI: fix macos runner python
  • Loading branch information
mloubout authored Apr 25, 2024
2 parents 1646687 + a918ec3 commit 70fe897
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 27 deletions.
19 changes: 10 additions & 9 deletions .github/workflows/docker-bases.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
run: docker system prune -a -f

- name: GCC image
uses: docker/build-push-action@v3
uses: docker/build-push-action@v5
with:
context: .
file: './docker/Dockerfile.cpu'
Expand All @@ -61,6 +61,7 @@ jobs:
build-args: 'arch=gcc'
tags: 'devitocodes/bases:cpu-gcc'


#######################################################
############## Intel OneApi CPU #######################
#######################################################
Expand Down Expand Up @@ -93,7 +94,7 @@ jobs:
run: docker system prune -a -f

- name: ICX image
uses: docker/build-push-action@v3
uses: docker/build-push-action@v5
with:
context: .
file: './docker/Dockerfile.intel'
Expand All @@ -103,7 +104,7 @@ jobs:
tags: 'devitocodes/bases:cpu-icx'

- name: SYCL CPU image
uses: docker/build-push-action@v3
uses: docker/build-push-action@v5
with:
context: .
file: './docker/Dockerfile.intel'
Expand All @@ -113,7 +114,7 @@ jobs:
tags: 'devitocodes/bases:cpu-sycl'

- name: SYCL GPU image
uses: docker/build-push-action@v3
uses: docker/build-push-action@v5
with:
context: .
file: './docker/Dockerfile.intel'
Expand Down Expand Up @@ -154,7 +155,7 @@ jobs:
run: docker system prune -a -f

- name: NVC image
uses: docker/build-push-action@v3
uses: docker/build-push-action@v5
with:
context: .
file: './docker/Dockerfile.nvidia'
Expand All @@ -164,7 +165,7 @@ jobs:
tags: 'devitocodes/bases:nvidia-nvc'

- name: NVCC image
uses: docker/build-push-action@v3
uses: docker/build-push-action@v5
with:
context: .
file: './docker/Dockerfile.nvidia'
Expand All @@ -174,7 +175,7 @@ jobs:
tags: 'devitocodes/bases:nvidia-nvcc'

- name: NVC host image
uses: docker/build-push-action@v3
uses: docker/build-push-action@v5
with:
context: .
file: './docker/Dockerfile.nvidia'
Expand Down Expand Up @@ -215,7 +216,7 @@ jobs:
run: docker system prune -a -f

- name: AMD image
uses: docker/build-push-action@v3
uses: docker/build-push-action@v5
with:
context: .
file: './docker/Dockerfile.amd'
Expand All @@ -224,7 +225,7 @@ jobs:
tags: devitocodes/bases:amd

- name: AMD HIP image
uses: docker/build-push-action@v3
uses: docker/build-push-action@v5
with:
context: .
file: './docker/Dockerfile.amd'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docker-devito.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,4 +106,4 @@ jobs:

- name: Run tests
run: |
docker run ${{ matrix.flag }} --rm --name testrun 'devitocodes/devito:${{ matrix.tag }}-dev' pytest ${{ matrix.test }}
docker run ${{ matrix.flag }} --rm -t --name testrun 'devitocodes/devito:${{ matrix.tag }}-dev' pytest ${{ matrix.test }}
6 changes: 3 additions & 3 deletions .github/workflows/pytest-core-mpi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,9 @@ jobs:
- name: Test with pytest
run: |
docker run --rm -e CODECOV_TOKEN=${{ secrets.CODECOV_TOKEN }} -e OMP_NUM_THREADS=1 --name testrun devito_img pytest tests/test_mpi.py
docker run --rm -t -e CODECOV_TOKEN=${{ secrets.CODECOV_TOKEN }} -e OMP_NUM_THREADS=1 --name testrun devito_img pytest tests/test_mpi.py
- name: Test examples with MPI
run: |
docker run --rm ${{ matrix.mpiflag }} -e DEVITO_MPI=1 -e OMP_NUM_THREADS=1 --name examplerun devito_img mpiexec -n 2 pytest examples/seismic/acoustic
docker run --rm -e DEVITO_MPI=1 -e OMP_NUM_THREADS=1 --name examplerun devito_img mpiexec -n 2 pytest examples/seismic/tti
docker run --rm -t ${{ matrix.mpiflag }} -e DEVITO_MPI=1 -e OMP_NUM_THREADS=1 --name examplerun devito_img mpiexec -n 2 pytest examples/seismic/acoustic
docker run --rm -t -e DEVITO_MPI=1 -e OMP_NUM_THREADS=1 --name examplerun devito_img mpiexec -n 2 pytest examples/seismic/tti
10 changes: 5 additions & 5 deletions .github/workflows/pytest-core-nompi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
pytest-ubuntu-py310-gcc10-noomp,
pytest-ubuntu-py312-gcc13-omp,
pytest-ubuntu-py39-gcc9-omp,
pytest-osx-py37-clang-omp,
pytest-osx-py312-clang-omp,
pytest-docker-py39-gcc-omp,
pytest-docker-py39-icx-omp
]
Expand Down Expand Up @@ -84,8 +84,8 @@ jobs:
language: "openmp"
sympy: "1.9"

- name: pytest-osx-py37-clang-omp
python-version: '3.7'
- name: pytest-osx-py312-clang-omp
python-version: '3.12'
os: macos-latest
arch: "clang"
language: "C"
Expand All @@ -112,7 +112,7 @@ jobs:
test-set: 'adjoint'

exclude:
- name: pytest-osx-py37-clang-omp
- name: pytest-osx-py312-clang-omp
set: adjoint

steps:
Expand All @@ -133,7 +133,7 @@ jobs:
- name: Set run prefix
run: |
if [[ "${{ matrix.name }}" =~ "docker" ]]; then
echo "RUN_CMD=docker run --rm -e CODECOV_TOKEN=${{ secrets.CODECOV_TOKEN }} --name testrun devito_img" >> $GITHUB_ENV
echo "RUN_CMD=docker run --rm -t -e CODECOV_TOKEN=${{ secrets.CODECOV_TOKEN }} --name testrun devito_img" >> $GITHUB_ENV
else
echo "RUN_CMD=" >> $GITHUB_ENV
fi
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pytest-gpu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ jobs:
base: "devitocodes/bases:nvidia-nvc"
tags: ["self-hosted", "nvidiagpu"]
test_drive_cmd: "nvidia-smi"
flags: '--gpus all --rm --name testrun-nvc'
flags: '--gpus all --rm -t --name testrun-nvc'

- name: pytest-gpu-omp-amd
test_files: "tests/test_adjoint.py tests/test_gpu_common.py tests/test_gpu_openmp.py"
Expand All @@ -66,7 +66,7 @@ jobs:
test_drive_cmd: "rocm-smi"
# Attach the AMD GPU devices `/dev` and add user to video and render (109 on wampa) group
# Options from https://rocmdocs.amd.com/en/latest/ROCm_Virtualization_Containers/ROCm-Virtualization-&-Containers.html
flags: "--network=host --device=/dev/kfd --device=/dev/dri --ipc=host --group-add video --group-add $(getent group render | cut -d: -f3) --cap-add=SYS_PTRACE --security-opt seccomp=unconfined --rm --name testrun-amd"
flags: "--network=host --device=/dev/kfd --device=/dev/dri --ipc=host --group-add video --group-add $(getent group render | cut -d: -f3) --cap-add=SYS_PTRACE --security-opt seccomp=unconfined --rm -t --name testrun-amd"

steps:
- name: Checkout devito
Expand Down
14 changes: 8 additions & 6 deletions .github/workflows/tutorials.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,14 @@ jobs:
env:
DEVITO_ARCH: "${{ matrix.compiler }}"
DEVITO_LANGUAGE: ${{ matrix.language }}
PYTHON_VERSION: "3.9"

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

Expand All @@ -39,26 +38,29 @@ jobs:
os: ubuntu-latest
compiler: gcc
language: "openmp"
pyver: "3.9"

- name: tutos-osx-clang-py39
- name: tutos-osx-clang-py311
os: macos-latest
compiler: clang
language: "C"
pyver: "3.11"

- name: tutos-docker-gcc-py39
os: ubuntu-latest
compiler: gcc
language: "openmp"
pyver: "3.9"

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

- name: Set up Python 3.9
- name: Set up Python ${{ matrix.pyver }}
if: "!contains(matrix.name, 'docker')"
uses: actions/setup-python@v5
with:
python-version: 3.9
python-version: ${{ matrix.pyver }}

- uses: maxim-lobanov/setup-xcode@v1
if: runner.os == 'macOS'
Expand All @@ -73,7 +75,7 @@ jobs:
- name: Set run prefix
run: |
if [ "${{ matrix.name }}" == 'tutos-docker-gcc-py39' ]; then
echo "RUN_CMD=docker run --rm --name testrun devito_img" >> $GITHUB_ENV
echo "RUN_CMD=docker run --rm -t --name testrun devito_img" >> $GITHUB_ENV
else
echo "RUN_CMD=" >> $GITHUB_ENV
fi
Expand Down
2 changes: 1 addition & 1 deletion docker/Dockerfile.nvidia
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ RUN python3 -m venv /venv && \
/venv/bin/pip install --no-cache-dir -r https://raw.githubusercontent.com/devitocodes/devito/master/requirements-nvidia.txt && \
# Install jupyter and setup nvidia configs.
/venv/bin/pip install --no-cache-dir jupyter && \
/venv/bin/jupyter serverextension enable dask_labextension && \
/venv/bin/jupyter server extension enable dask_labextension && \
rm -rf ~/.cache/pip

RUN apt-get clean && apt-get autoclean && apt-get autoremove -y && \
Expand Down

0 comments on commit 70fe897

Please sign in to comment.