akshaychitneni commented on code in PR #34840:
URL: https://github.com/apache/airflow/pull/34840#discussion_r1385345068


##########
airflow/providers/papermill/hooks/kernel.py:
##########
@@ -0,0 +1,48 @@
+from airflow.hooks.base import BaseHook
+
+JUPYTER_KERNEL_SHELL_PORT = 60316
+JUPYTER_KERNEL_IOPUB_PORT = 60317
+JUPYTER_KERNEL_STDIN_PORT = 60318
+JUPYTER_KERNEL_CONTROL_PORT = 60319
+JUPYTER_KERNEL_HB_PORT = 60320
+
+
+def register_remote_engine():
+    """
+    Registers ``RemoteKernelEngine`` papermill engine
+    """
+    from papermill.engines import papermill_engines
+    from airflow.providers.papermill.operators.papermill import 
RemoteKernelEngine, REMOTE_KERNEL_ENGINE
+
+    papermill_engines.register(REMOTE_KERNEL_ENGINE, RemoteKernelEngine)
+
+
+class KernelHook(BaseHook):
+    """
+    The KernelHook can be used to interact with remote jupyter kernel.
+
+    Takes kernel host/ip from connection and refers to jupyter kernel ports 
and session_key
+     from ``extra`` field.
+
+    :param kernel_conn_id: connection that has kernel host/ip
+    """
+
+    conn_name_attr = "kernel_conn_id"
+    default_conn_name = "jupyter_kernel_default"
+    conn_type = "jupyter_kernel"
+    hook_name = "Jupyter Kernel"

Review Comment:
   Added connection documentation.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@airflow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to