Skip to content

Cluster Python API #463

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 31 commits into from
Jun 21, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
af269a3
create cluster subpackage
minrk Jun 1, 2021
a6ac4a3
add basic async-wrapper utility
minrk Jun 2, 2021
0873112
use start_new_session to avoid forwarding signals to launcher subproc…
minrk Jun 2, 2021
331e1b4
use tornado for better compatiblity than raw asyncio
minrk Jun 3, 2021
c307d5d
make raises_remote usable outside ClientTest
minrk Jun 3, 2021
eef3718
avoid terminating engines with SIGINT
minrk Jun 3, 2021
6972d72
remove some unnecessary use of tornado
minrk Jun 3, 2021
ad5e559
WIP cluster API
minrk Jun 3, 2021
74dc0e8
move launcher to cluster subpackage
minrk Jun 8, 2021
924812c
use Cluster API in ipcluster apps
minrk Jun 8, 2021
d51e7c7
start heart beating after other channels
minrk Jun 8, 2021
df56a87
terminate with SIGTERM
minrk Jun 8, 2021
10d0b65
install mpich with micromamba
minrk Jun 8, 2021
f589961
update test dependencies
minrk Jun 9, 2021
5affde1
nicer repr for Cluster object
minrk Jun 9, 2021
e8739e9
cluster: default engine set methods to all engines if unspecified
minrk Jun 9, 2021
89f66ad
cluster test: close clients
minrk Jun 9, 2021
3fbd934
use client.wait_for_engines in cluster context managers
minrk Jun 9, 2021
4b9da9c
add Cluster API example notebook
minrk Jun 9, 2021
d0505f4
give clients a handle on their parent cluster object, if they have one
minrk Jun 9, 2021
f093b39
more test coverage for Cluster API
minrk Jun 10, 2021
caba06b
allow using clients as context managers
minrk Jun 10, 2021
aaa4483
promote Cluster to top-level namespace
minrk Jun 10, 2021
cf9d1cb
hook up tornado when running launchers
minrk Jun 10, 2021
9e1fe6d
run mpi tests with more output
minrk Jun 10, 2021
66b18dd
shorten ping for cluster tests
minrk Jun 10, 2021
44c32f3
handle short-circuit in wait_for_engines(block=False)
minrk Jun 10, 2021
68e4397
relax timeout in cluster tests
minrk Jun 10, 2021
95789d5
fix setting config on common base classes
minrk Jun 10, 2021
2d9e17c
install mpi4py for mpi tests
minrk Jun 10, 2021
f61f383
less output now that mpi tests are passing
minrk Jun 10, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,36 @@ jobs:
- python: "3.6"
- python: "3.7"
- python: "3.8"
mpi: true
- python: "3.9"

steps:
- uses: actions/checkout@v2

- name: Cache conda environment
uses: actions/cache@v2
with:
path: |
~/conda
key: conda

- name: Install Python (conda) ${{ matrix.python }}
if: matrix.mpi
run: |
export MAMBA_ROOT_PREFIX=$HOME/conda
test -d $MAMBA_ROOT_PREFIX || mkdir $MAMBA_ROOT_PREFIX
wget -qO- https://micro.mamba.pm/api/micromamba/linux-64/latest | tar -xvj bin/micromamba
eval "$(./bin/micromamba shell hook -s posix)"
micromamba activate
micromamba install -y -c conda-forge mpich mpi4py python=${{ matrix.python }}
echo "PATH=$MAMBA_ROOT_PREFIX/bin:$PATH" >> $GITHUB_ENV

- name: Install Python ${{ matrix.python }}
if: ${{ ! matrix.mpi }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python }}

- name: Install Python dependencies
run: |
pip install --upgrade pip
Expand All @@ -67,11 +88,18 @@ jobs:
- name: Show environment
run: pip freeze

- name: Run mpi tests
if: ${{ matrix.mpi }}
run: |
pytest -vx --color=yes --cov=ipyparallel ipyparallel/tests/test_cluster.py

- name: Run tests
if: ${{ ! matrix.mpi }}
# FIXME: --color=yes explicitly set because:
# https://github.com/actions/runner/issues/241
run: |
pytest -v --maxfail=3 --color=yes --cov=ipyparallel ipyparallel/tests

- name: Submit codecov report
run: |
codecov
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,4 @@ __pycache__
*coverage.xml
.coverage.*
.idea
htmlcov
2 changes: 2 additions & 0 deletions docs/source/api/ipyparallel.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ API Reference
Classes
-------

.. autoclass:: Cluster

.. autoclass:: Client

.. autoclass:: DirectView
Expand Down
4 changes: 2 additions & 2 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,13 @@
# You can specify multiple suffix as a list of string:
source_suffix = ['.rst', '.md']

from traitlets.config import HasTraits
from traitlets.config import LoggingConfigurable

# exclude members inherited from HasTraits by default
autodoc_default_options = {
'members': None,
"inherited-members": None,
"exclude-members": ','.join(dir(HasTraits)),
"exclude-members": ','.join(dir(LoggingConfigurable)),
}

# Add dev disclaimer.
Expand Down
4 changes: 2 additions & 2 deletions docs/source/tutorial/process.rst
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ and Windows HPC Server.

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

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

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