##// END OF EJS Templates
fix --ip='*' argument in various apps...
MinRK -
Show More
@@ -54,7 +54,7 b' from IPython.parallel.controller.hub import HubFactory'
54 from IPython.parallel.controller.scheduler import TaskScheduler,launch_scheduler
54 from IPython.parallel.controller.scheduler import TaskScheduler,launch_scheduler
55 from IPython.parallel.controller.sqlitedb import SQLiteDB
55 from IPython.parallel.controller.sqlitedb import SQLiteDB
56
56
57 from IPython.parallel.util import signal_children, split_url, asbytes
57 from IPython.parallel.util import signal_children, split_url, asbytes, disambiguate_url
58
58
59 # conditional import of MongoDB backend class
59 # conditional import of MongoDB backend class
60
60
@@ -287,13 +287,15 b' class IPControllerApp(BaseParallelApplication):'
287 mq = import_item(str(self.mq_class))
287 mq = import_item(str(self.mq_class))
288
288
289 hub = self.factory
289 hub = self.factory
290 # maybe_inproc = 'inproc://monitor' if self.use_threads else self.monitor_url
290 # disambiguate url, in case of *
291 monitor_url = disambiguate_url(hub.monitor_url)
292 # maybe_inproc = 'inproc://monitor' if self.use_threads else monitor_url
291 # IOPub relay (in a Process)
293 # IOPub relay (in a Process)
292 q = mq(zmq.PUB, zmq.SUB, zmq.PUB, b'N/A',b'iopub')
294 q = mq(zmq.PUB, zmq.SUB, zmq.PUB, b'N/A',b'iopub')
293 q.bind_in(hub.client_info['iopub'])
295 q.bind_in(hub.client_info['iopub'])
294 q.bind_out(hub.engine_info['iopub'])
296 q.bind_out(hub.engine_info['iopub'])
295 q.setsockopt_out(zmq.SUBSCRIBE, b'')
297 q.setsockopt_out(zmq.SUBSCRIBE, b'')
296 q.connect_mon(hub.monitor_url)
298 q.connect_mon(monitor_url)
297 q.daemon=True
299 q.daemon=True
298 children.append(q)
300 children.append(q)
299
301
@@ -302,7 +304,7 b' class IPControllerApp(BaseParallelApplication):'
302 q.bind_in(hub.client_info['mux'])
304 q.bind_in(hub.client_info['mux'])
303 q.setsockopt_in(zmq.IDENTITY, b'mux')
305 q.setsockopt_in(zmq.IDENTITY, b'mux')
304 q.bind_out(hub.engine_info['mux'])
306 q.bind_out(hub.engine_info['mux'])
305 q.connect_mon(hub.monitor_url)
307 q.connect_mon(monitor_url)
306 q.daemon=True
308 q.daemon=True
307 children.append(q)
309 children.append(q)
308
310
@@ -311,7 +313,7 b' class IPControllerApp(BaseParallelApplication):'
311 q.bind_in(hub.client_info['control'])
313 q.bind_in(hub.client_info['control'])
312 q.setsockopt_in(zmq.IDENTITY, b'control')
314 q.setsockopt_in(zmq.IDENTITY, b'control')
313 q.bind_out(hub.engine_info['control'])
315 q.bind_out(hub.engine_info['control'])
314 q.connect_mon(hub.monitor_url)
316 q.connect_mon(monitor_url)
315 q.daemon=True
317 q.daemon=True
316 children.append(q)
318 children.append(q)
317 try:
319 try:
@@ -326,7 +328,7 b' class IPControllerApp(BaseParallelApplication):'
326 q.bind_in(hub.client_info['task'][1])
328 q.bind_in(hub.client_info['task'][1])
327 q.setsockopt_in(zmq.IDENTITY, b'task')
329 q.setsockopt_in(zmq.IDENTITY, b'task')
328 q.bind_out(hub.engine_info['task'])
330 q.bind_out(hub.engine_info['task'])
329 q.connect_mon(hub.monitor_url)
331 q.connect_mon(monitor_url)
330 q.daemon=True
332 q.daemon=True
331 children.append(q)
333 children.append(q)
332 elif scheme == 'none':
334 elif scheme == 'none':
@@ -335,7 +337,7 b' class IPControllerApp(BaseParallelApplication):'
335 else:
337 else:
336 self.log.info("task::using Python %s Task scheduler"%scheme)
338 self.log.info("task::using Python %s Task scheduler"%scheme)
337 sargs = (hub.client_info['task'][1], hub.engine_info['task'],
339 sargs = (hub.client_info['task'][1], hub.engine_info['task'],
338 hub.monitor_url, hub.client_info['notification'])
340 monitor_url, disambiguate_url(hub.client_info['notification']))
339 kwargs = dict(logname='scheduler', loglevel=self.log_level,
341 kwargs = dict(logname='scheduler', loglevel=self.log_level,
340 log_url = self.log_url, config=dict(self.config))
342 log_url = self.log_url, config=dict(self.config))
341 if 'Process' in self.mq_class:
343 if 'Process' in self.mq_class:
@@ -31,15 +31,14 b' class Heartbeat(Thread):'
31 def __init__(self, context, addr=(LOCALHOST, 0)):
31 def __init__(self, context, addr=(LOCALHOST, 0)):
32 Thread.__init__(self)
32 Thread.__init__(self)
33 self.context = context
33 self.context = context
34 self.addr = addr
34 self.ip, self.port = addr
35 self.ip = addr[0]
36 self.port = addr[1]
37 if self.port == 0:
35 if self.port == 0:
38 s = socket.socket()
36 s = socket.socket()
39 s.bind(self.addr)
37 # '*' means all interfaces to 0MQ, which is '' to socket.socket
38 s.bind(('' if self.ip == '*' else self.ip, 0))
40 self.port = s.getsockname()[1]
39 self.port = s.getsockname()[1]
41 s.close()
40 s.close()
42 self.addr = (self.ip, self.port)
41 self.addr = (self.ip, self.port)
43 self.daemon = True
42 self.daemon = True
44
43
45 def run(self):
44 def run(self):
@@ -710,6 +710,9 b' class KernelManager(HasTraits):'
710 # The addresses for the communication channels.
710 # The addresses for the communication channels.
711 connection_file = Unicode('')
711 connection_file = Unicode('')
712 ip = Unicode(LOCALHOST)
712 ip = Unicode(LOCALHOST)
713 def _ip_changed(self, name, old, new):
714 if new == '*':
715 self.ip = '0.0.0.0'
713 shell_port = Int(0)
716 shell_port = Int(0)
714 iopub_port = Int(0)
717 iopub_port = Int(0)
715 stdin_port = Int(0)
718 stdin_port = Int(0)
General Comments 0
You need to be logged in to leave comments. Login now