Prevent actors from being placed on removed nodes or nodes with no CPUs. (#527)

* Make note about bug in which actor creation notification message is not received.

* Prevent actors from being created on removed nodes.

* Prevent actors from being created on nodes with no CPUs.

* Fix linting.

* Add test for scheduling actors on local schedulers with no CPUs.

* Improve error message when actors created before ray.init called.
This commit is contained in:
Robert Nishihara
2017-05-08 20:39:43 -07:00
committed by Philipp Moritz
parent c688a64235
commit f32368bcbe
2 changed files with 40 additions and 16 deletions
+13
View File
@@ -565,6 +565,19 @@ class ActorSchedulingProperties(unittest.TestCase):
class ActorsOnMultipleNodes(unittest.TestCase):
def testActorsOnNodesWithNoCPUs(self):
ray.init(num_cpus=0)
@ray.actor
class Foo(object):
def __init__(self):
pass
with self.assertRaises(Exception):
Foo()
ray.worker.cleanup()
def testActorLoadBalancing(self):
num_local_schedulers = 3
ray.worker._init(start_ray_local=True, num_workers=0,