Skip to content
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

Kernel Provisioning - initial implementation #612

Merged
merged 42 commits into from
Jul 26, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
f61c4db
Kernel Environment Provisioning - begin implementation
kevin-bates Jan 21, 2021
bb13c98
Add initial tests
kevin-bates Jan 23, 2021
c9e5f0f
Minor refactoring, cleanup pre-start
kevin-bates Jan 25, 2021
31398ff
Cleanup launch to better show responsibilities
kevin-bates Feb 3, 2021
bc655f9
Merge branch 'master' into env-provisioning
kevin-bates Feb 15, 2021
76f45e9
Switch to AsyncKM and use async subproc
kevin-bates Feb 20, 2021
cac893c
Use popen on Windows
kevin-bates Feb 20, 2021
7db3d97
Use abstract base class
kevin-bates Feb 20, 2021
e6e381e
Rename to Kernel Provisioning, and default LocalProvisioner
kevin-bates Feb 21, 2021
f3692c3
Apply changes per review, add type hints, formalize default provisioner
kevin-bates Feb 23, 2021
e064f37
Enhance tests
kevin-bates Feb 26, 2021
b0ee134
Fix "enhanced" tests
kevin-bates Feb 26, 2021
6bd9f56
Fix configurable behaviors
kevin-bates Mar 2, 2021
9856c9f
Updates stemming from POC with other provisioners
kevin-bates Mar 18, 2021
09c1adc
Update to master (7.0), make request_shutdown async, add restart to f…
kevin-bates Apr 20, 2021
cb68ade
Address pre-commit and mypy issues
kevin-bates Apr 23, 2021
654549d
Get tests passing again
kevin-bates Apr 25, 2021
6097f8a
Use naming convention for provisioners
kevin-bates Apr 26, 2021
c2c3ccb
Fix tests, remove async_generator dependency
kevin-bates Apr 27, 2021
ccce1d0
Use lowercase convention for provisioner names
kevin-bates Apr 28, 2021
1c1f71a
Move provisioning to sub-package
kevin-bates Apr 29, 2021
2c034a9
Restore launcher, don't offer async launch_kernel
kevin-bates Apr 29, 2021
a7cb408
Restore whitespace to launch_kernel docstring
kevin-bates Apr 30, 2021
73fa0fa
Remove dual self.kernel, self.provisioner
kevin-bates May 8, 2021
516d9df
Stop mirroring self.provisioner as self.kernel
kevin-bates May 8, 2021
53cb496
Stop mirroring self.provisioner as self.kernel
kevin-bates May 8, 2021
2df20c4
Move port caching to LocalProvisioner
kevin-bates May 19, 2021
314e94a
KernelManager is provisioner parent
kevin-bates May 21, 2021
57c70ff
Initial docs update
kevin-bates Jun 3, 2021
7786aa4
Fixup connection_info handling, update with master
kevin-bates Jun 15, 2021
0efc1b4
Add ability to list available kernel provisioners
kevin-bates Jun 18, 2021
797360b
Tolerate exception within excepton handler
kevin-bates Jun 24, 2021
d383cdb
Cleanup messaging when NoSuchKernel is raised
kevin-bates Jun 30, 2021
489b6b2
Update docs/provisioning.rst
Jul 9, 2021
31dcb88
Update docs/provisioning.rst
Jul 9, 2021
cc2130f
Update docs/provisioning.rst
Jul 9, 2021
fe75742
Update jupyter_client/tests/test_provisioning.py
kevin-bates Jul 9, 2021
3c40b56
Properly instantiate KPFactory in kernelspecapp
kevin-bates Jul 23, 2021
3f206e8
Merge remote-tracking branch 'upstream/master' into env-provisioning
kevin-bates Jul 23, 2021
d697fb4
Add entrypoints into new requirements.txt
kevin-bates Jul 23, 2021
d3e01ea
Update mypy to install missing types
kevin-bates Jul 23, 2021
fc3227e
Clarify example that method is part of custom provisioner impl
kevin-bates Jul 24, 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
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ jobs:
pip freeze

- name: Check types
run: mypy jupyter_client --exclude '\/tests|kernelspecapp|ioloop|runapp'
run: mypy jupyter_client --exclude '\/tests|kernelspecapp|ioloop|runapp' --install-types --non-interactive

- name: Run the tests
run: pytest --cov jupyter_client -v jupyter_client
Expand Down
1 change: 1 addition & 0 deletions docs/api/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ jupyter_client API
kernelspec
manager
client
provisioners
7 changes: 3 additions & 4 deletions docs/api/manager.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,11 @@ manager - starting, stopping, signalling

The name of the kernel to launch (see :ref:`kernelspecs`).

.. automethod:: start_kernel
.. autoattribute:: provisioner

.. attribute:: kernel
The kernel provisioner with which this :class:`KernelManager` is communicating. This will generally be a :class:`LocalProvisioner` instance unless the kernelspec indicates otherwise.

Once the kernel has been started, this is the :class:`subprocess.Popen`
class for the kernel process.
.. automethod:: start_kernel

.. automethod:: is_alive

Expand Down
71 changes: 71 additions & 0 deletions docs/api/provisioners.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
kernel provisioner apis
=======================

.. seealso::

:doc:`/provisioning`

.. module:: jupyter_client.provisioning.provisioner_base

.. autoclass:: KernelProvisionerBase

.. attribute:: kernel_spec

The kernel specification associated with the provisioned kernel (see :ref:`kernelspecs`).

.. attribute:: kernel_id

The provisioned kernel's ID.

.. attribute:: connection_info

The provisioned kernel's connection information.


.. autoproperty:: has_process

.. automethod:: poll

.. automethod:: wait

.. automethod:: send_signal

.. automethod:: kill

.. automethod:: terminate

.. automethod:: launch_kernel

.. automethod:: cleanup

.. automethod:: shutdown_requested

.. automethod:: pre_launch

.. automethod:: post_launch

.. automethod:: get_provisioner_info

.. automethod:: load_provisioner_info

.. automethod:: get_shutdown_wait_time

.. automethod:: _finalize_env

.. automethod:: __apply_env_substitutions

.. module:: jupyter_client.provisioning.local_provisioner

.. autoclass:: LocalProvisioner

.. module:: jupyter_client.provisioning.factory

.. autoclass:: KernelProvisionerFactory

.. attribute:: default_provisioner_name

Indicates the name of the provisioner to use when no kernel_provisioner entry is present in the kernel specification. This value can also be specified via the environment variable ``JUPYTER_DEFAULT_PROVISIONER_NAME``.

.. automethod:: is_provisioner_available

.. automethod:: create_provisioner_instance
1 change: 1 addition & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ with Jupyter kernels.

kernels
wrapperkernels
provisioning

.. toctree::
:maxdepth: 2
Expand Down
Loading