Skip to content

Commit

Permalink
Fix workflow error that's been awhile. (#656)
Browse files Browse the repository at this point in the history
* Tweaks to help debugging locally

* explicit

* Workaround dask/distributed#4565

As we only intend to use distributed with a single MPI rank
configuration, the test coverage is sufficient after this workaround.

* reenable osx as we have a workaround for the dask error.

* renable compilers

* typo.

* more syntax error.

* add erfa, required by astropy.

* pyerfa

* bound pyerfa version to 1.7.1

* use stock pyerfa as the mislinking to numpy 1.21 is fixed.

* do not run every minute.

* pyerfa must be there?

* bump numpy to 1.20

* '1.20'
  • Loading branch information
rainwoodman authored Jun 15, 2021
1 parent 2f77432 commit 4aec168
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 22 deletions.
27 changes: 12 additions & 15 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ name: main

on:
schedule:
- cron: '* * * * 5' # Runs on every Friday.
- cron: '0 0 * * 5' # Runs on every Friday.
push:
branches: [ '*', $default-branch ]
tags: ['[0-9]*'] # anything looks like a version.
Expand All @@ -25,13 +25,11 @@ jobs:
strategy:
fail-fast: false
matrix:
# Disable os-latest as we run into a dask error for now.
# os: [ ubuntu-latest, macos-latest ]
os: [ ubuntu-latest ]
numpy-version: [ 1.18 ]
os: [ ubuntu-latest, macos-latest ]
numpy-version: [ '1.20' ]
python-version: [ 3.8 ]
include:
- {deploy: true, os: ubuntu-latest, numpy-version: 1.18, python-version: 3.8 }
- {deploy: true, os: ubuntu-latest, numpy-version: '1.20', python-version: 3.8 }
steps:

- name: Checkout source code
Expand Down Expand Up @@ -70,16 +68,15 @@ jobs:
pip install coveralls
# install nbodykit itself
pip install .[extras]
conda list --explicit
# - name: Install Compilers For OSX
# if: ${{ runner.os == "macOS" }}
# run: |
# conda install -q -y clang_osx-64 clangxx_osx-64 gfortran_osx-64

# - name: Install Compilers For Linux
# if: ${{ runner.os == "Linux" }}
# run: |
# conda install -q -y gcc_linux-64 gxx_linux-64 gfortran_linux-64
- name: Install Compilers
run: |
if [ "$RUNNER_OS" == "macOS" ]; then
conda install -q -y clang_osx-64 clangxx_osx-64 gfortran_osx-64
else
conda install -q -y gcc_linux-64 gxx_linux-64 gfortran_linux-64
fi
- name: Python Unit tests
run: |
Expand Down
15 changes: 8 additions & 7 deletions nbodykit/tests/test_distributed.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,13 @@
import pytest

def setup():
from distributed import LocalCluster, Client
cluster = LocalCluster(n_workers=1, threads_per_worker=1, processes=False)
use_distributed(Client(cluster))
# only initializes the local cluster this on the root rank.
# all unit tests in this file must be protected by MPITest([1]).
from mpi4py import MPI
if MPI.COMM_WORLD.rank == 0:
from distributed import LocalCluster, Client
cluster = LocalCluster(n_workers=1, threads_per_worker=1, processes=False)
use_distributed(Client(cluster))

def teardown():
from mpi4py import MPI
Expand All @@ -19,13 +23,10 @@ def test_pickle(comm):
cat = UniformCatalog(1e-3, 512, comm=comm)
ss = pickle.dumps(cat)
cat2 = pickle.loads(ss)

assert_array_equal(cat['Position'], cat2['Position'])

import distributed

@pytest.mark.xfail(distributed.__version__ in ['2021.03.0',],
reason="https://github.com/dask/distributed/issues/4565")
@MPITest([1])
def test_save(comm):
cat = UniformCatalog(1e-3, 512, comm=comm)
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
numpy
scipy
astropy
pyerfa
mpi4py
six
runtests
Expand Down

0 comments on commit 4aec168

Please sign in to comment.