Skip to content

Commit a04d16f

Browse files
ZsailerGitHub Enterprise
authored andcommitted
Wait for the kernel to start before setting pod IP (jupyter-server#132)
* wait for kernel to be ready before getting host * Bump to 0.12.1
1 parent 6d70a42 commit a04d16f

File tree

4 files changed

+12
-6
lines changed

4 files changed

+12
-6
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "0.12.0" # pragma: no cover
1+
__version__ = "0.12.1" # pragma: no cover

data_studio_jupyter_extensions/configurables/provisioner.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,9 @@ async def _launch_kernel_local_to_local(self) -> KernelConnectionInfo:
390390
response = await self.nbservice_client.start_kernel(self.kernelspec_id)
391391
self.process_id = str(response["id"])
392392

393+
# Wait for that kernel to come online before getting its info.
394+
await self.wait_for_ready()
395+
393396
# The local notebook service client *must* return the
394397
# connection info when the kernel is started, since
395398
# there might be multiple kernels competing for the
@@ -412,6 +415,9 @@ async def _launch_kernel_local_to_cluster(
412415
response = await self.nbservice_client.start_kernel(self.kernelspec_id)
413416
self.process_id = response["id"]
414417

418+
# Wait for that kernel to come online before getting its info.
419+
await self.wait_for_ready()
420+
415421
# Ports and host will depend on the ingress routes
416422
# set by the kubernetes cluster.
417423
host, port_map = await self.open_route(self.process_id)
@@ -430,6 +436,9 @@ async def _launch_kernel_cluster_to_cluster(
430436
response = await self.nbservice_client.start_kernel(self.kernelspec_id)
431437
self.process_id = response["id"]
432438

439+
# Wait for that kernel to come online before getting its info.
440+
await self.wait_for_ready()
441+
433442
# The connection info should be predetermined by the kernel itself.
434443
# Get the Host information from the kernel details endpoint.
435444
kernel_info = await self.nbservice_client.get_kernel_details(self.process_id)
@@ -455,9 +464,6 @@ async def launch_kernel(
455464
else: # pragma: no cover
456465
await self._launch_kernel_cluster_to_cluster()
457466

458-
# Wait for that kernel to come online.
459-
await self.wait_for_ready()
460-
461467
# Return connection info once the Kernel is live.
462468
return self.connection_info
463469

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ testpaths = [
2323
]
2424

2525
[tool.tbump.version]
26-
current = "0.12.0"
26+
current = "0.12.1"
2727
regex = '''
2828
(?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)
2929
((?P<channel>a|b|rc|.dev)(?P<release>\d+))?

version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.12.0
1+
0.12.1

0 commit comments

Comments
 (0)