Skip to content

Commit bc375ae

Browse files
authored
Merge pull request #499 from minrk/loction-typo
Fixes for ipcontroller --ip=*
2 parents 33bd6cd + f47a6e3 commit bc375ae

File tree

4 files changed

+19
-2
lines changed

4 files changed

+19
-2
lines changed

.github/workflows/test.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ jobs:
2222
tornado: "5.1.1"
2323
- python: "3.6"
2424
- python: "3.7"
25+
controller_ip: "*"
2526
- python: "3.8"
2627
mpi: true
2728
- python: "3.9"
@@ -36,6 +37,11 @@ jobs:
3637
~/conda
3738
key: conda
3839

40+
- name: Set environment variables
41+
if: matrix.controller_ip
42+
run: |
43+
echo "IPP_CONTROLLER_IP=${{ matrix.controller_ip }}" >> $GITHUB_ENV
44+
3945
- name: Install Python (conda) ${{ matrix.python }}
4046
if: matrix.mpi
4147
run: |

ipyparallel/controller/app.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -766,9 +766,18 @@ def recursively_start_schedulers(identity, depth):
766766
outgoing_id1 = identity * 2 + 1
767767
outgoing_id2 = outgoing_id1 + 1
768768
is_leaf = depth == self.broadcast_scheduler_depth
769+
is_root = depth == 0
770+
771+
# FIXME: use localhost, not client ip for internal communication
772+
# this will still be localhost anyway for the most common cases
773+
# of localhost or */0.0.0.0
774+
in_addr = self.client_url(BroadcastScheduler.port_name, identity)
775+
if not is_root:
776+
# non-root schedulers connect, so they need a disambiguated url
777+
in_addr = disambiguate_url(in_addr)
769778

770779
scheduler_args = dict(
771-
in_addr=self.client_url(BroadcastScheduler.port_name, identity),
780+
in_addr=in_addr,
772781
mon_addr=monitor_url,
773782
not_addr=disambiguate_url(self.client_url('notification')),
774783
reg_addr=disambiguate_url(self.client_url('registration')),

ipyparallel/engine/app.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ def load_connector_file(self):
302302
# allow hand-override of location for disambiguation
303303
# and ssh-server
304304
if 'IPEngine.location' not in self.cli_config:
305-
self.loction = d['location']
305+
self.location = d['location']
306306
if 'ssh' in d and not self.sshserver:
307307
self.sshserver = d.get("ssh")
308308

ipyparallel/tests/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ def __str__(self):
6868
'--ping=250',
6969
'--dictdb',
7070
]
71+
if os.environ.get("IPP_CONTROLLER_IP"):
72+
cp.cmd_and_args.append(f"--ip={os.environ['IPP_CONTROLLER_IP']}")
7173
cp.start()
7274
launchers.append(cp)
7375
tic = time.time()

0 commit comments

Comments
 (0)