diff --git a/.travis.yml b/.travis.yml index f7ffd2be3..4b6043109 100644 --- a/.travis.yml +++ b/.travis.yml @@ -49,11 +49,11 @@ matrix: - os: linux env: - - TESTSUITE=gcs_service + - TESTSUITE=gcs_service_disabled - JDK='Oracle JDK 8' - - RAY_GCS_SERVICE_ENABLED=true - PYTHON=3.6 PYTHONWARNINGS=ignore - RAY_INSTALL_JAVA=1 + - RAY_GCS_SERVICE_ENABLED=false install: - eval `python $TRAVIS_BUILD_DIR/ci/travis/determine_tests_to_run.py` - ./ci/travis/install-bazel.sh @@ -69,11 +69,11 @@ matrix: - os: linux env: - - TESTSUITE=gcs_service_python_testcase + - TESTSUITE=gcs_service_disabled_python_testcase - JDK='Oracle JDK 8' - - RAY_GCS_SERVICE_ENABLED=true - PYTHON=3.6 PYTHONWARNINGS=ignore - RAY_INSTALL_JAVA=1 + - RAY_GCS_SERVICE_ENABLED=false install: - eval `python $TRAVIS_BUILD_DIR/ci/travis/determine_tests_to_run.py` - ./ci/travis/install-bazel.sh diff --git a/java/runtime/src/main/java/org/ray/runtime/runner/RunManager.java b/java/runtime/src/main/java/org/ray/runtime/runner/RunManager.java index 13851f119..626887768 100644 --- a/java/runtime/src/main/java/org/ray/runtime/runner/RunManager.java +++ b/java/runtime/src/main/java/org/ray/runtime/runner/RunManager.java @@ -226,7 +226,8 @@ public class RunManager { } // start gcs server - if (System.getenv("RAY_GCS_SERVICE_ENABLED") != null) { + if (System.getenv("RAY_GCS_SERVICE_ENABLED") == null || + System.getenv("RAY_GCS_SERVICE_ENABLED") == "true") { String redisPasswordOption = ""; if (!Strings.isNullOrEmpty(rayConfig.headRedisPassword)) { redisPasswordOption = rayConfig.headRedisPassword; diff --git a/python/ray/node.py b/python/ray/node.py index 06143bcf7..60f41d869 100644 --- a/python/ray/node.py +++ b/python/ray/node.py @@ -626,7 +626,7 @@ class Node: # If this is the head node, start the relevant head node processes. self.start_redis() - if os.environ.get(ray_constants.RAY_GCS_SERVICE_ENABLED, None): + if os.environ.get(ray_constants.RAY_GCS_SERVICE_ENABLED, True): self.start_gcs_server() else: self.start_raylet_monitor() diff --git a/python/ray/tests/test_component_failures_3.py b/python/ray/tests/test_component_failures_3.py index 8f082312b..c5aba39d5 100644 --- a/python/ray/tests/test_component_failures_3.py +++ b/python/ray/tests/test_component_failures_3.py @@ -82,7 +82,7 @@ def test_driver_lives_sequential(ray_start_regular): ray.worker._global_node.kill_plasma_store() ray.worker._global_node.kill_log_monitor() ray.worker._global_node.kill_monitor() - if os.environ.get(ray_constants.RAY_GCS_SERVICE_ENABLED, None): + if os.environ.get(ray_constants.RAY_GCS_SERVICE_ENABLED, True): ray.worker._global_node.kill_gcs_server() else: ray.worker._global_node.kill_raylet_monitor() @@ -96,7 +96,7 @@ def test_driver_lives_sequential(ray_start_regular): def test_driver_lives_parallel(ray_start_regular): all_processes = ray.worker._global_node.all_processes - if os.environ.get(ray_constants.RAY_GCS_SERVICE_ENABLED, None): + if os.environ.get(ray_constants.RAY_GCS_SERVICE_ENABLED, True): process_infos = (all_processes[ray_constants.PROCESS_TYPE_PLASMA_STORE] + all_processes[ray_constants.PROCESS_TYPE_GCS_SERVER] + all_processes[ray_constants.PROCESS_TYPE_RAYLET] + diff --git a/python/ray/tests/test_multinode_failures_2.py b/python/ray/tests/test_multinode_failures_2.py index b29b77847..3d6f98b40 100644 --- a/python/ray/tests/test_multinode_failures_2.py +++ b/python/ray/tests/test_multinode_failures_2.py @@ -132,7 +132,7 @@ def test_driver_lives_sequential(ray_start_regular): ray.worker._global_node.kill_plasma_store() ray.worker._global_node.kill_log_monitor() ray.worker._global_node.kill_monitor() - if os.environ.get(ray_constants.RAY_GCS_SERVICE_ENABLED, None): + if os.environ.get(ray_constants.RAY_GCS_SERVICE_ENABLED, True): ray.worker._global_node.kill_gcs_server() else: ray.worker._global_node.kill_raylet_monitor() @@ -145,7 +145,7 @@ def test_driver_lives_sequential(ray_start_regular): reason="Hanging with new GCS API.") def test_driver_lives_parallel(ray_start_regular): all_processes = ray.worker._global_node.all_processes - if os.environ.get(ray_constants.RAY_GCS_SERVICE_ENABLED, None): + if os.environ.get(ray_constants.RAY_GCS_SERVICE_ENABLED, True): process_infos = (all_processes[ray_constants.PROCESS_TYPE_PLASMA_STORE] + all_processes[ray_constants.PROCESS_TYPE_GCS_SERVER] + all_processes[ray_constants.PROCESS_TYPE_RAYLET] + diff --git a/python/ray/tests/test_tempfile.py b/python/ray/tests/test_tempfile.py index 473d940a3..94c9c14fd 100644 --- a/python/ray/tests/test_tempfile.py +++ b/python/ray/tests/test_tempfile.py @@ -145,7 +145,7 @@ def test_raylet_tempfiles(shutdown_only): "raylet.err" } - if os.environ.get(ray_constants.RAY_GCS_SERVICE_ENABLED, None): + if os.environ.get(ray_constants.RAY_GCS_SERVICE_ENABLED, True): log_files_expected.update({"gcs_server.out", "gcs_server.err"}) else: log_files_expected.update({"raylet_monitor.out", "raylet_monitor.err"}) diff --git a/src/ray/common/constants.h b/src/ray/common/constants.h index f28cd8299..28c3d2d03 100644 --- a/src/ray/common/constants.h +++ b/src/ray/common/constants.h @@ -43,4 +43,10 @@ constexpr char kWorkerDynamicOptionPlaceholderPrefix[] = constexpr char kWorkerRayletConfigPlaceholder[] = "RAY_WORKER_RAYLET_CONFIG_PLACEHOLDER"; +/// RAY_GCS_SERVICE_ENABLED is an env variable which only set in ci job. +/// If the value of RAY_GCS_SERVICE_ENABLED is false, we will disable gcs service, +/// otherwise gcs service is enabled. +/// TODO(ffbin): Once we entirely migrate to service-based GCS, we should remove it. +constexpr char kRayGcsServiceEnabled[] = "RAY_GCS_SERVICE_ENABLED"; + #endif // RAY_CONSTANTS_H_ diff --git a/src/ray/core_worker/core_worker.cc b/src/ray/core_worker/core_worker.cc index 3c07fe5d7..cadb5c42f 100644 --- a/src/ray/core_worker/core_worker.cc +++ b/src/ray/core_worker/core_worker.cc @@ -115,7 +115,8 @@ CoreWorker::CoreWorker(const WorkerType worker_type, const Language language, RayLog::InstallFailureSignalHandler(); } // Initialize gcs client. - if (getenv("RAY_GCS_SERVICE_ENABLED") != nullptr) { + if (getenv(kRayGcsServiceEnabled) == nullptr || + strcmp(getenv(kRayGcsServiceEnabled), "true") == 0) { gcs_client_ = std::make_shared(gcs_options); } else { gcs_client_ = std::make_shared(gcs_options); diff --git a/src/ray/core_worker/test/core_worker_test.cc b/src/ray/core_worker/test/core_worker_test.cc index 402f4e23d..57f3f0343 100644 --- a/src/ray/core_worker/test/core_worker_test.cc +++ b/src/ray/core_worker/test/core_worker_test.cc @@ -109,7 +109,8 @@ class CoreWorkerTest : public ::testing::Test { } // start gcs server - if (getenv("RAY_GCS_SERVICE_ENABLED") != nullptr) { + if (getenv(kRayGcsServiceEnabled) == nullptr || + strcmp(getenv(kRayGcsServiceEnabled), "true") == 0) { gcs_server_pid_ = StartGcsServer("127.0.0.1"); } else { // core worker test relies on node resources. It's important that one raylet can diff --git a/src/ray/raylet/main.cc b/src/ray/raylet/main.cc index 7066f79cc..4c1ae4131 100644 --- a/src/ray/raylet/main.cc +++ b/src/ray/raylet/main.cc @@ -177,8 +177,8 @@ int main(int argc, char *argv[]) { ray::gcs::GcsClientOptions client_options(redis_address, redis_port, redis_password); std::shared_ptr gcs_client; - // RAY_GCS_SERVICE_ENABLED only set in ci job, so we just check if it is null. - if (getenv("RAY_GCS_SERVICE_ENABLED") != nullptr) { + if (getenv(kRayGcsServiceEnabled) == nullptr || + strcmp(getenv(kRayGcsServiceEnabled), "true") == 0) { gcs_client = std::make_shared(client_options); } else { gcs_client = std::make_shared(client_options);