Automatically create custom node id resource (#5882)

* node id

* comment

* comments

* fix tests
This commit is contained in:
Eric Liang
2019-10-15 21:31:11 -07:00
committed by GitHub
parent c52bb0621d
commit 6843a01a7f
6 changed files with 73 additions and 1 deletions
+1
View File
@@ -496,6 +496,7 @@ class RayTrialExecutor(TrialExecutor):
self._committed_resources.get_res_total(name),
self._avail_resources.get_res_total(name), name)
for name in self._avail_resources.custom_resources
if not name.startswith(ray.resource_spec.NODE_ID_PREFIX)
])
if customs:
status += " ({})".format(customs)
+2
View File
@@ -9,6 +9,7 @@ from numbers import Number
# For compatibility under py2 to consider unicode as str
from six import string_types
import ray
from ray.tune import TuneError
logger = logging.getLogger(__name__)
@@ -111,6 +112,7 @@ class Resources(
custom_summary = ", ".join([
"{} {}".format(self.get_res_total(res), res)
for res in self.custom_resources
if not res.startswith(ray.resource_spec.NODE_ID_PREFIX)
])
if custom_summary:
summary += " ({})".format(custom_summary)