Enable GCS Service by default (#7541)

This commit is contained in:
fangfengbin
2020-03-24 14:20:23 +08:00
committed by GitHub
parent b4030cdbbe
commit bf866de6fd
10 changed files with 24 additions and 15 deletions
+6
View File
@@ -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_
+2 -1
View File
@@ -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<ray::gcs::ServiceBasedGcsClient>(gcs_options);
} else {
gcs_client_ = std::make_shared<ray::gcs::RedisGcsClient>(gcs_options);
+2 -1
View File
@@ -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
+2 -2
View File
@@ -177,8 +177,8 @@ int main(int argc, char *argv[]) {
ray::gcs::GcsClientOptions client_options(redis_address, redis_port, redis_password);
std::shared_ptr<ray::gcs::GcsClient> 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<ray::gcs::ServiceBasedGcsClient>(client_options);
} else {
gcs_client = std::make_shared<ray::gcs::RedisGcsClient>(client_options);