mirror of
https://github.com/wassname/ray.git
synced 2026-08-14 12:40:23 +08:00
Add API for getting total cluster resources. (#1736)
* Add API for getting total cluster resources. * Add test.
This commit is contained in:
committed by
Philipp Moritz
parent
794f547d0a
commit
2922e1c388
+4
-1
@@ -1840,7 +1840,10 @@ class GlobalStateAPI(unittest.TestCase):
|
||||
with self.assertRaises(Exception):
|
||||
ray.global_state.log_files()
|
||||
|
||||
ray.init()
|
||||
ray.init(num_cpus=5, num_gpus=3, resources={"CustomResource": 1})
|
||||
|
||||
resources = {"CPU": 5, "GPU": 3, "CustomResource": 1}
|
||||
assert ray.global_state.cluster_resources() == resources
|
||||
|
||||
self.assertEqual(ray.global_state.object_table(), dict())
|
||||
|
||||
|
||||
Reference in New Issue
Block a user