You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
PBSControllerLauncher: Unable to connect_client_sync() #619
I have been using ipyparallel 6 for a while and would like to migrate to ipyparallel 7 mainly due to fact that the new Cluster API enables you to manage the entire process through a Jupyter Notebook. Unfortunatelly, I am having difficulties to connect a client to my cluster.
I have created a new IPython profile adding a custom ipcluster_config.py, which is a modified version of my existing/working config for ipp 6 (see below).
I can successfully start a cluster spawning two PBS jobs (controller and engine).
because the config files created in PROFILE/security are named ipcontroller-client.json and ipcontroller-engine.json whereas the program expects the filenames to include cluster_id, e.g. ipcontroller-1635416202-ou8n-client.json, ipcontroller-1635416202-ou8n-engine.json. Is this also fixed in #606?
This is why I need to get CI tests for all the non-slurm batch launchers (#604)!
I do believe the issue is fixed in dev, but those custom templates will still reintroduce the problem. If you add --cluster-id={cluster_id} it will be fixed. The generic fix is to use {program_and_args} instead of ipengine --profile-dir={profile_dir}.
Thank you for the quick reply! The general method works. 👍
Is it possible to instantiate a Cluster without an existing IPython profile and ipcluster_config.py by passing c.PBSControllerLauncher.batch_template and c.PBSEngineSetLauncher.batch_template somehow directly to the class constructor from a Jupyter Notebook?
Yes! You populate the cluster.config object, which is the same as c in your ipcluster_config.py:
cluster=ipp.Cluster(
n=4,
controller_ip='*',
profile='pbs-2021-10-28',
)
# this is the same config object you would configure in ipcluster_config.py# you don't have to call it `c`, but if you do, the rest will look familiarc=cluster.configc.PBSControllerLauncher.batch_template=controller_templatec.PBSEngineSetLauncher.batch_template=engine_templateawaitcluster.start_cluster()
I've got another question and potential point for the documentation todo list: How do you configure the controller dynamically in Python / Jupyter Notebook (replacement for ipcontroller_config.py)? For instance, how would you set c.HubFactory.ip='*'?
That can be c.Cluster.controller_ip via config, or since it's on the Cluster object, it can be a constructor argument:
Cluster(controller_ip="*")
HubFactory is removed and replaced by IPController, so if you do still have an ipcontroller_config.pyit would bec.IPController.ip = '*'`.
The ambiguity is because there are really two things you are configuring:
Cluster (and thereby Launchers) which start processes like ipcontroller, and
ipcontroller, ipengine themselves
Some common options for configuring the controller itself can be done on the Cluster, but for the most part ipcontroller is configured directly through either ipcontroller_config.py or ControllerLauncher.controller_args. Cluster(controller_ip="*") is really a shortcut for c.ControllerLauncher.controler_args.append("--ip=*").
I've installed the new beta version 8.0.0b1 and everything is looking fine - except for start_cluster_sync, which now appears to be significantly slower. The controller starts immediately but there is some noticeable delay before the engines come up. I haven't tested if this delay scales with the number of engines. I was using 4 engines in my test.
except for start_cluster_sync, which now appears to be significantly slower.
That makes sense. It's the new Cluster.send_engines_connection_env option, which means by default start_cluster waits for the controller to finish starting before starting the engines, because the connection info is passed via environment through the Launcher. To disable this and rely on the connection files on disk (pre-8.0 behavior):
Activity
lukas-koschmieder commentedon Oct 28, 2021
The program hangs in the while loop at
ipyparallel/ipyparallel/cluster/launcher.py
Line 339 in 527d7b2
PROFILE/securityare namedipcontroller-client.jsonandipcontroller-engine.jsonwhereas the program expects the filenames to includecluster_id, e.g.ipcontroller-1635416202-ou8n-client.json,ipcontroller-1635416202-ou8n-engine.json. Is this also fixed in #606?minrk commentedon Oct 28, 2021
This is why I need to get CI tests for all the non-slurm batch launchers (#604)!
I do believe the issue is fixed in dev, but those custom templates will still reintroduce the problem. If you add
--cluster-id={cluster_id}it will be fixed. The generic fix is to use{program_and_args}instead ofipengine --profile-dir={profile_dir}.I believe these templates will work:
The next release uses environment variables to pass things like the cluster id, which means you must add
#PBS -Vto your options.lukas-koschmieder commentedon Oct 28, 2021
Thank you for the quick reply! The general method works. 👍
Is it possible to instantiate a
Clusterwithout an existing IPython profile andipcluster_config.pyby passingc.PBSControllerLauncher.batch_templateandc.PBSEngineSetLauncher.batch_templatesomehow directly to the class constructor from a Jupyter Notebook?Pseudocode:
minrk commentedon Oct 28, 2021
Yes! You populate the
cluster.configobject, which is the same ascin youripcluster_config.py:lukas-koschmieder commentedon Oct 28, 2021
Fantastic! Thank you!
minrk commentedon Oct 28, 2021
Adding lots of examples to my documentation todo list...
minrk commentedon Oct 28, 2021
I'll make an 8.0 beta tomorrow. It would be great if you could test it out!
lukas-koschmieder commentedon Oct 28, 2021
Okay, great, I will test it.
lukas-koschmieder commentedon Oct 28, 2021
I've got another question and potential point for the documentation todo list: How do you configure the controller dynamically in Python / Jupyter Notebook (replacement for
ipcontroller_config.py)? For instance, how would you setc.HubFactory.ip='*'?minrk commentedon Oct 29, 2021
That can be
c.Cluster.controller_ipvia config, or since it's on the Cluster object, it can be a constructor argument:HubFactoryis removed and replaced byIPController, so if you do still have an ipcontroller_config.pyit would bec.IPController.ip = '*'`.The ambiguity is because there are really two things you are configuring:
Some common options for configuring the controller itself can be done on the Cluster, but for the most part ipcontroller is configured directly through either
ipcontroller_config.pyorControllerLauncher.controller_args.Cluster(controller_ip="*")is really a shortcut forc.ControllerLauncher.controler_args.append("--ip=*").[-]Unable to connect_client_sync()[/-][+]PBSControllerLauncher: Unable to connect_client_sync()[/+]minrk commentedon Oct 29, 2021
I just published
8.0.0b1if you could give it a trylukas-koschmieder commentedon Oct 29, 2021
Okay, I'm currently in the middle of something but I will give it a try this afternoon/evening.
minrk commentedon Oct 29, 2021
No rush! I've only got a few more minutes of work before the weekend. I'll probably aim to do a release around the end of next week.
lukas-koschmieder commentedon Oct 31, 2021
I've installed the new beta version
8.0.0b1and everything is looking fine - except forstart_cluster_sync, which now appears to be significantly slower. The controller starts immediately but there is some noticeable delay before the engines come up. I haven't tested if this delay scales with the number of engines. I was using 4 engines in my test.8.0.0b1output7.1.0(conda-forge) outputEdit: If the release is next week, unfortunately I won't be able to participate in additional beta testing because I am on holiday until Nov 8th.
minrk commentedon Nov 1, 2021
That makes sense. It's the new
Cluster.send_engines_connection_envoption, which means by defaultstart_clusterwaits for the controller to finish starting before starting the engines, because the connection info is passed via environment through the Launcher. To disable this and rely on the connection files on disk (pre-8.0 behavior):then the engine and controller jobs should both be submitted immediately.
minrk commentedon Nov 11, 2021
@lukas-koschmieder I just published 8.0.0rc1. Can you test and then close here if you think everything is resolved?