Skip to content

Commit 508af10

Browse files
authored
Merge pull request #463 from minrk/cluster-manager
Cluster Python API
2 parents 6928c6e + f61f383 commit 508af10

32 files changed

+3786
-2170
lines changed

.github/workflows/test.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,36 @@ jobs:
4646
- python: "3.6"
4747
- python: "3.7"
4848
- python: "3.8"
49+
mpi: true
4950
- python: "3.9"
5051

5152
steps:
5253
- uses: actions/checkout@v2
5354

55+
- name: Cache conda environment
56+
uses: actions/cache@v2
57+
with:
58+
path: |
59+
~/conda
60+
key: conda
61+
62+
- name: Install Python (conda) ${{ matrix.python }}
63+
if: matrix.mpi
64+
run: |
65+
export MAMBA_ROOT_PREFIX=$HOME/conda
66+
test -d $MAMBA_ROOT_PREFIX || mkdir $MAMBA_ROOT_PREFIX
67+
wget -qO- https://micro.mamba.pm/api/micromamba/linux-64/latest | tar -xvj bin/micromamba
68+
eval "$(./bin/micromamba shell hook -s posix)"
69+
micromamba activate
70+
micromamba install -y -c conda-forge mpich mpi4py python=${{ matrix.python }}
71+
echo "PATH=$MAMBA_ROOT_PREFIX/bin:$PATH" >> $GITHUB_ENV
72+
5473
- name: Install Python ${{ matrix.python }}
74+
if: ${{ ! matrix.mpi }}
5575
uses: actions/setup-python@v2
5676
with:
5777
python-version: ${{ matrix.python }}
78+
5879
- name: Install Python dependencies
5980
run: |
6081
pip install --upgrade pip
@@ -67,11 +88,18 @@ jobs:
6788
- name: Show environment
6889
run: pip freeze
6990

91+
- name: Run mpi tests
92+
if: ${{ matrix.mpi }}
93+
run: |
94+
pytest -vx --color=yes --cov=ipyparallel ipyparallel/tests/test_cluster.py
95+
7096
- name: Run tests
97+
if: ${{ ! matrix.mpi }}
7198
# FIXME: --color=yes explicitly set because:
7299
# https://github.com/actions/runner/issues/241
73100
run: |
74101
pytest -v --maxfail=3 --color=yes --cov=ipyparallel ipyparallel/tests
102+
75103
- name: Submit codecov report
76104
run: |
77105
codecov

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,4 @@ __pycache__
2222
*coverage.xml
2323
.coverage.*
2424
.idea
25+
htmlcov

docs/source/api/ipyparallel.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ API Reference
1111
Classes
1212
-------
1313

14+
.. autoclass:: Cluster
15+
1416
.. autoclass:: Client
1517

1618
.. autoclass:: DirectView

docs/source/conf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,13 +60,13 @@
6060
# You can specify multiple suffix as a list of string:
6161
source_suffix = ['.rst', '.md']
6262

63-
from traitlets.config import HasTraits
63+
from traitlets.config import LoggingConfigurable
6464

6565
# exclude members inherited from HasTraits by default
6666
autodoc_default_options = {
6767
'members': None,
6868
"inherited-members": None,
69-
"exclude-members": ','.join(dir(HasTraits)),
69+
"exclude-members": ','.join(dir(LoggingConfigurable)),
7070
}
7171

7272
# Add dev disclaimer.

docs/source/tutorial/process.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ and Windows HPC Server.
165165

166166
In general, these are configured by the :attr:`IPClusterEngines.engine_set_launcher_class`,
167167
and :attr:`IPClusterStart.controller_launcher_class` configurables, which can be the
168-
fully specified object name (e.g. ``'ipyparallel.apps.launcher.LocalControllerLauncher'``),
168+
fully specified object name (e.g. ``'ipyparallel.cluster.launcher.LocalControllerLauncher'``),
169169
but if you are using IPython's builtin launchers, you can specify a launcher by its prefix e.g:
170170

171171
.. sourcecode:: python
@@ -174,7 +174,7 @@ but if you are using IPython's builtin launchers, you can specify a launcher by
174174
# equivalent to
175175
c.IPClusterEngines.engine_launcher_class = 'SSHEngineSetLauncher'
176176
# both of which expand to
177-
c.IPClusterEngines.engine_launcher_class = 'ipyparallel.apps.launcher.SSHEngineSetLauncher'
177+
c.IPClusterEngines.engine_launcher_class = 'ipyparallel.cluster.launcher.SSHEngineSetLauncher'
178178

179179
The shortest form being of particular use on the command line, where all you need to do to
180180
get an IPython cluster running with engines started with MPI is:

0 commit comments

Comments
 (0)