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

Add Session workflows documentation #808

Merged
merged 6 commits into from
Apr 27, 2022

Conversation

andreyvelich
Copy link
Contributor

I added create and delete Session workflow to architecture diagrams.
Please take a look at the doc changes.

cc @Zsailer @kevin-bates @blink1073

@codecov-commenter
Copy link

codecov-commenter commented Apr 26, 2022

Codecov Report

Merging #808 (1d8d771) into main (241f0f2) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             main     #808   +/-   ##
=======================================
  Coverage   69.96%   69.96%           
=======================================
  Files          62       62           
  Lines        7368     7368           
  Branches     1223     1223           
=======================================
  Hits         5155     5155           
  Misses       1841     1841           
  Partials      372      372           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 241f0f2...1d8d771. Read the comment docs.

Copy link
Member

@kevin-bates kevin-bates left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another useful diagram - thank you @andreyvelich! Here are some initial comments...

Create Session Workflow
-----------------------

The create Session workflow can be seen in figure below:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The create Session workflow can be seen in figure below:
The create Session workflow can be seen in the figure below:

:width: 90%
:align: center

When a user starts a new Kernel, the following steps process:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
When a user starts a new Kernel, the following steps process:
When a user starts a new kernel, the following steps occur:

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think "Kernel" should be "kernel" except when it's a proper noun (e.g., Mapping Kernel Manager, Kernel Spec Manager, etc.). I believe this was also true in the general architecture section as well. Perhaps a sweep can be made for such instances.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good, I will change it to "kernel".

Comment on lines 152 to 153
- When interrupt mode is ``Signal``, **Kernel Provisioner** kills the Kernel
with ``SIGINT`` operating system signal.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- When interrupt mode is ``Signal``, **Kernel Provisioner** kills the Kernel
with ``SIGINT`` operating system signal.
- When the interrupt mode is ``Signal``, the **Kernel Provisioner** interrupts the kernel
with the ``SIGINT`` operating system signal (although other provisioner implementations may use a different approach).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The diagram for the signal-based interrupt should probably replace Kill with Interrupt as well.

Comment on lines 160 to 161
#. When Kernel is shutdown, **Session Manager** deletes the Session data from
the SQLite3 DataBase and responses 204 Status Code to the Notebook client.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should the kernel's shutdown be detailed similar to its interrupt? I know that can be a lot and we might be trying to limit text. Perhaps we could do something like...

When the kernel is shutdown, ...

and point to the code (or documentation produced from the code)?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kevin-bates I think that makes sense. I added steps after kernel interrupt.
Please let me know, what do you think.

Copy link
Member

@kevin-bates kevin-bates left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @andreyvelich - thanks for the updates! Just had a couple of minor comments regarding shutdown.

#. **Mapping Kernel Manager** starts the kernel shutdown process by using
**Multi Kernel Manager** and **Kernel Manager**.

#. **Kernel Manager** receives interrupt mode from **Kernel Spec Manager**.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
#. **Kernel Manager** receives interrupt mode from **Kernel Spec Manager**.
#. **Kernel Manager** determines the mode of interrupt from the **Kernel Spec Manager**.

message on the control channel.

#. **Kernel Manager** waits for the kernel shutdown. After the timeout,
**Kernel Manager** interrupts the kernel with ``SIGTERM`` operating system signal.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
**Kernel Manager** interrupts the kernel with ``SIGTERM`` operating system signal.
**Kernel Manager** terminates the kernel sending a ``SIGTERM`` operating system signal (or provisioner equivalent). If it finds the kernel process has not terminated, the **Kernel Manager** will follow up with a ``SIGKILL`` operating system signal (or provisioner equivalent) to ensure the kernel's termination.

Control, and Heartbeat ports.

#. When shutdown is finished, **Session Manager** deletes the Session data from
the SQLite3 DataBase and responses 204 Status Code to the Notebook client.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
the SQLite3 DataBase and responses 204 Status Code to the Notebook client.
the SQLite3 database and responses 204 status code to the Notebook client.

#. After interrupting kernel, Session sends the `"shutdown_request" <https://jupyter-client.readthedocs.io/en/latest/messaging.html#kernel-shutdown>`_
message on the control channel.

#. **Kernel Manager** waits for the kernel shutdown. After the timeout,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
#. **Kernel Manager** waits for the kernel shutdown. After the timeout,
#. **Kernel Manager** waits for the kernel shutdown. After the timeout, and if it detects the kernel process is still running, the

@andreyvelich
Copy link
Contributor Author

Thank you for the review @kevin-bates!
I made these changes.

docs/source/developers/architecture.rst Outdated Show resolved Hide resolved
docs/source/developers/architecture.rst Outdated Show resolved Hide resolved
docs/source/developers/architecture.rst Outdated Show resolved Hide resolved
kevin-bates
kevin-bates previously approved these changes Apr 27, 2022
Copy link
Member

@kevin-bates kevin-bates left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good @andreyvelich - thank you!

andreyvelich and others added 3 commits April 27, 2022 17:56
Co-authored-by: Steven Silvester <steven.silvester@ieee.org>
Co-authored-by: Steven Silvester <steven.silvester@ieee.org>
Co-authored-by: Steven Silvester <steven.silvester@ieee.org>
@andreyvelich
Copy link
Contributor Author

Thank you for your feedback @blink1073 @kevin-bates !

Copy link
Collaborator

@blink1073 blink1073 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Failure is unrelated

@blink1073 blink1073 merged commit 3a91f36 into jupyter-server:main Apr 27, 2022
@andreyvelich andreyvelich deleted the add-workflow-diagrams branch April 27, 2022 22:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants