Skip to content

Commit

Permalink
Update continous integration environment
Browse files Browse the repository at this point in the history
  • Loading branch information
jan-janssen committed May 29, 2024
1 parent 9377818 commit ed541e0
Show file tree
Hide file tree
Showing 5 changed files with 91 additions and 73 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/unittest-flux-mpich.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Unittests-flux-mpich

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Extend environment
shell: bash -l {0}
timeout-minutes: 5
run: |
echo -e '- coverage\n- flux-core =0.59.0\n- versioneer =0.28'>> .ci_support/environment-mpich.yml
cat .ci_support/environment-mpich.yml
- uses: conda-incubator/setup-miniconda@v2.2.0
with:
python-version: '3.12'
mamba-version: "*"
channels: conda-forge
miniforge-variant: Mambaforge
channel-priority: strict
auto-update-conda: true
environment-file: .ci_support/environment-mpich.yml
- name: Test
shell: bash -l {0}
timeout-minutes: 5
run: |
pip install . --no-deps --no-build-isolation
python -m unittest discover tests
- name: Test Flux
shell: bash -l {0}
timeout-minutes: 5
run: >
flux start
python -m unittest tests/test_flux_executor.py tests/test_executor_backend_flux.py;
45 changes: 45 additions & 0 deletions .github/workflows/unittest-flux-openmpi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Unittests-flux-openmpi

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Extend environment
shell: bash -l {0}
timeout-minutes: 5
run: |
echo -e '- coverage\n- flux-core =0.59.0\n- flux-pmix=0.5.0\n- versioneer =0.28' >> .ci_support/environment-openmpi.yml
cat .ci_support/environment-openmpi.yml
- uses: conda-incubator/setup-miniconda@v2.2.0
with:
python-version: '3.12'
mamba-version: "*"
channels: conda-forge
miniforge-variant: Mambaforge
channel-priority: strict
auto-update-conda: true
environment-file: .ci_support/environment-openmpi.yml
- name: Test
shell: bash -l {0}
timeout-minutes: 5
run: |
pip install . --no-deps --no-build-isolation
coverage run -a --omit="pympipool/_version.py,tests/*" -m unittest discover tests
- name: Test Flux with OpenMPI
shell: bash -l {0}
timeout-minutes: 5
run: >
flux start
coverage run -a --omit="pympipool/_version.py,tests/*" -m unittest tests/test_flux_executor.py tests/test_executor_backend_flux.py;
coverage xml
env:
PYMPIPOOL_PMIX: "pmix"
- name: Coveralls
uses: coverallsapp/github-action@v2
71 changes: 0 additions & 71 deletions .github/workflows/unittest-flux.yml

This file was deleted.

3 changes: 3 additions & 0 deletions tests/test_executor_backend_flux.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
)

skip_flux_test = "FLUX_URI" not in os.environ
pmi = os.environ.get("PYMPIPOOL_PMIX", None)
except ImportError:
skip_flux_test = True

Expand Down Expand Up @@ -81,6 +82,7 @@ def test_flux_executor_parallel(self):
executor=self.executor,
backend="flux",
block_allocation=True,
pmi=pmi,
) as exe:
fs_1 = exe.submit(mpi_funct, 1)
self.assertEqual(fs_1.result(), [(1, 2, 0), (1, 2, 1)])
Expand All @@ -93,6 +95,7 @@ def test_single_task(self):
executor=self.executor,
backend="flux",
block_allocation=True,
pmi=pmi,
) as p:
output = p.map(mpi_funct, [1, 2, 3])
self.assertEqual(
Expand Down
5 changes: 3 additions & 2 deletions tests/test_flux_executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
)

skip_flux_test = "FLUX_URI" not in os.environ
pmi = os.environ.get("PYMPIPOOL_PMIX", None)
except ImportError:
skip_flux_test = True

Expand Down Expand Up @@ -69,15 +70,15 @@ def test_flux_executor_threads(self):

def test_flux_executor_parallel(self):
with PyFluxExecutor(
max_workers=1, cores_per_worker=2, executor=self.executor
max_workers=1, cores_per_worker=2, executor=self.executor, pmi=pmi
) as exe:
fs_1 = exe.submit(mpi_funct, 1)
self.assertEqual(fs_1.result(), [(1, 2, 0), (1, 2, 1)])
self.assertTrue(fs_1.done())

def test_single_task(self):
with PyFluxExecutor(
max_workers=1, cores_per_worker=2, executor=self.executor
max_workers=1, cores_per_worker=2, executor=self.executor, pmi=pmi
) as p:
output = p.map(mpi_funct, [1, 2, 3])
self.assertEqual(
Expand Down

0 comments on commit ed541e0

Please sign in to comment.