mirror of
https://github.com/wassname/ray.git
synced 2026-06-28 03:50:55 +08:00
Add gcs_service_enabled function to avoid getting environment variable directly (#7742)
This commit is contained in:
@@ -72,6 +72,8 @@ public class RayConfig {
|
||||
public final String jobResourcePath;
|
||||
public final String pythonWorkerCommand;
|
||||
|
||||
public final boolean gcsServiceEnabled;
|
||||
|
||||
private static volatile RayConfig instance = null;
|
||||
|
||||
public static RayConfig getInstance() {
|
||||
@@ -223,6 +225,9 @@ public class RayConfig {
|
||||
|
||||
numWorkersPerProcess = config.getInt("ray.raylet.config.num_workers_per_process_java");
|
||||
|
||||
gcsServiceEnabled = System.getenv("RAY_GCS_SERVICE_ENABLED") == null ||
|
||||
System.getenv("RAY_GCS_SERVICE_ENABLED").toLowerCase().equals("true");
|
||||
|
||||
// Validate config.
|
||||
validate();
|
||||
LOGGER.debug("Created config: {}", this);
|
||||
|
||||
@@ -226,8 +226,7 @@ public class RunManager {
|
||||
}
|
||||
|
||||
// start gcs server
|
||||
if (System.getenv("RAY_GCS_SERVICE_ENABLED") == null ||
|
||||
System.getenv("RAY_GCS_SERVICE_ENABLED") == "true") {
|
||||
if (rayConfig.gcsServiceEnabled) {
|
||||
String redisPasswordOption = "";
|
||||
if (!Strings.isNullOrEmpty(rayConfig.headRedisPassword)) {
|
||||
redisPasswordOption = rayConfig.headRedisPassword;
|
||||
|
||||
Reference in New Issue
Block a user