Skip to content

Commit 4fcb9af

Browse files
ZsailerGitHub Enterprise
authored andcommitted
Make connection ports configurable (jupyter-server#135)
* allow ports to be configured * Bump to 0.12.4
1 parent 002d426 commit 4fcb9af

File tree

5 files changed

+27
-9
lines changed

5 files changed

+27
-9
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "0.12.3" # pragma: no cover
1+
__version__ = "0.12.4" # pragma: no cover

data_studio_jupyter_extensions/configurables/provisioner.py

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,19 +33,27 @@ class NotebookServiceProvisioner(provisioning.KernelProvisionerBase):
3333
"""Kernel Provisioner that talks directly to the Notebook Service."""
3434

3535
ip = Unicode(allow_none=True).tag(config=True)
36+
3637
iopub_port = IntFromEnv(
3738
name=constants.IOPUBPORT, default_value=60317, allow_none=True
38-
)
39-
hb_port = IntFromEnv(name=constants.HBPORT, default_value=60320, allow_none=True)
39+
).tag(config=True)
40+
41+
hb_port = IntFromEnv(
42+
name=constants.HBPORT, default_value=60320, allow_none=True
43+
).tag(config=True)
44+
4045
control_port = IntFromEnv(
4146
name=constants.CONTROLPORT, default_value=60319, allow_none=True
42-
)
47+
).tag(config=True)
48+
4349
shell_port = IntFromEnv(
4450
name=constants.SHELLPORT, default_value=60316, allow_none=True
45-
)
51+
).tag(config=True)
52+
4653
stdin_port = IntFromEnv(
4754
name=constants.STDINPORT, default_value=60318, allow_none=True
48-
)
55+
).tag(config=True)
56+
4957
namespace = UnicodeFromEnv(name=constants.DS_NAMESPACE, allow_none=True)
5058

5159
kernelspec_id = UnicodeFromEnv(
@@ -450,8 +458,9 @@ async def _launch_kernel_cluster_to_cluster(
450458
# The connection info should be predetermined by the kernel itself.
451459
# Get the Host information from the kernel details endpoint.
452460
kernel_info = await self.nbservice_client.get_kernel_details(self.process_id)
453-
self.log.debug(f"Connection Info: {kernel_info}")
461+
self.log.debug(f"Kernel Info: {kernel_info}")
454462
self.ip = self.ip or kernel_info["host"]
463+
self.log.debug(f"Connection Info: {self.connection_info}")
455464
return self.connection_info
456465

457466
async def launch_kernel(

data_studio_jupyter_extensions/tests/configurables/test_provisioner.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,15 @@ async def delayed_monkeypatch():
4747
return _
4848

4949

50+
def test_init():
51+
nb = NotebookServiceProvisioner()
52+
assert nb.iopub_port == 60317
53+
assert nb.hb_port == 60320
54+
assert nb.control_port == 60319
55+
assert nb.shell_port == 60316
56+
assert nb.stdin_port == 60318
57+
58+
5059
def test_has_process(monkeypatch):
5160
# Test that has process returns False when
5261
# no environment variable is set.

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.3"
26+
current = "0.12.4"
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.3
1+
0.12.4

0 commit comments

Comments
 (0)