From 6aae9a12fb9e81f25605b57e65ec953c9fa2bed3 Mon Sep 17 00:00:00 2001 From: Robert Nishihara Date: Sat, 9 Dec 2017 14:20:56 -0800 Subject: [PATCH] Improve version checking at startup. (#1307) * Check pyarrow version at startup. * For version check, use absolute path to ray module. --- python/ray/services.py | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/python/ray/services.py b/python/ray/services.py index 8da55dbaa..b0f8fad96 100644 --- a/python/ray/services.py +++ b/python/ray/services.py @@ -8,6 +8,7 @@ import cloudpickle import json import os import psutil +import pyarrow import random import redis import shutil @@ -279,23 +280,25 @@ def wait_for_redis_to_start(redis_ip_address, redis_port, num_retries=5): def _compute_version_info(): - """Compute the versions of Python, cloudpickle, and Ray. + """Compute the versions of Python, cloudpickle, pyarrow, and Ray. Returns: A tuple containing the version information. """ ray_version = ray.__version__ - ray_location = ray.__file__ + ray_location = os.path.abspath(ray.__file__) python_version = ".".join(map(str, sys.version_info[:3])) cloudpickle_version = cloudpickle.__version__ - return ray_version, ray_location, python_version, cloudpickle_version + pyarrow_version = pyarrow.__version__ + return (ray_version, ray_location, python_version, cloudpickle_version, + pyarrow_version) def _put_version_info_in_redis(redis_client): """Store version information in Redis. This will be used to detect if workers or drivers are started using - different versions of Python, cloudpickle, or Ray. + different versions of Python, cloudpickle, pyarrow, or Ray. Args: redis_client: A client for the primary Redis shard. @@ -307,7 +310,7 @@ def check_version_info(redis_client): """Check if various version info of this process is correct. This will be used to detect if workers or drivers are started using - different versions of Python, cloudpickle, or Ray. If the version + different versions of Python, cloudpickle, pyarrow, or Ray. If the version information is not present in Redis, then no check is done. Args: @@ -332,12 +335,14 @@ def check_version_info(redis_client): " Ray location: " + true_version_info[1] + "\n" " Python: " + true_version_info[2] + "\n" " Cloudpickle: " + true_version_info[3] + "\n" + " Pyarrow: " + true_version_info[4] + "\n" "This process on node " + node_ip_address + " was started with:" + "\n" " Ray: " + version_info[0] + "\n" " Ray location: " + version_info[1] + "\n" " Python: " + version_info[2] + "\n" - " Cloudpickle: " + version_info[3]) + " Cloudpickle: " + version_info[3] + "\n" + " Pyarrow: " + version_info[4]) def start_redis(node_ip_address,