Remove colorful from ray core (#10723)

This commit is contained in:
Eric Liang
2020-09-10 18:41:59 -07:00
committed by GitHub
parent 7eaf063f29
commit cbc52a2a42
5 changed files with 7 additions and 55 deletions
-29
View File
@@ -10,9 +10,6 @@ import sys
import ray
import ray.ray_constants as ray_constants
from ray.autoscaler.cli_logger import cli_logger
import colorful as cf
logger = logging.getLogger(__name__)
# Prefix for the node id resource that is automatically added to each node.
@@ -223,32 +220,6 @@ class ResourceSpec(
round(memory / 1e9, 2),
int(100 * (memory / system_memory))))
rounded_memory = ray_constants.round_to_memory_units(
memory, round_up=False)
worker_ram = round(rounded_memory / (1024**3), 2)
object_ram = round(object_store_memory / (1024**3), 2)
# TODO(maximsmol): this behavior is strange since we do not have a
# good grasp on when this will get called
# (you have to study node.py to make a guess)
with cli_logger.group("Available RAM"):
cli_logger.labeled_value("Workers", "{} GiB", str(worker_ram))
cli_logger.labeled_value("Objects", "{} GiB", str(object_ram))
cli_logger.newline()
cli_logger.print("To adjust these values, use")
with cf.with_style("monokai") as c:
cli_logger.print(
" ray{0}init(memory{1}{2}, "
"object_store_memory{1}{2})", c.magenta("."),
c.magenta("="), c.purple("<bytes>"))
cli_logger.old_info(
logger,
"Starting Ray with {} GiB memory available for workers and up to "
"{} GiB for objects. You can adjust these settings "
"with ray.init(memory=<bytes>, "
"object_store_memory=<bytes>).", worker_ram, object_ram)
spec = ResourceSpec(num_cpus, num_gpus, memory, object_store_memory,
resources, redis_max_memory)
assert spec.resolved()