mirror of
https://github.com/wassname/ray.git
synced 2026-06-27 21:38:18 +08:00
[Multi-tenancy] Delete flag enable_multi_tenancy and remove old code path (#10573)
This commit is contained in:
@@ -13,7 +13,6 @@ import io.ray.runtime.generated.Common.WorkerType;
|
||||
import io.ray.runtime.util.NetworkUtil;
|
||||
import java.io.File;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@@ -174,34 +173,12 @@ public class RayConfig {
|
||||
if (config.hasPath("ray.job.code-search-path")) {
|
||||
codeSearchPathString = config.getString("ray.job.code-search-path");
|
||||
}
|
||||
if (!StringUtils.isEmpty(codeSearchPathString)) {
|
||||
codeSearchPath = Arrays.asList(codeSearchPathString.split(":"));
|
||||
} else {
|
||||
codeSearchPath = Collections.emptyList();
|
||||
if (StringUtils.isEmpty(codeSearchPathString)) {
|
||||
codeSearchPathString = System.getProperty("java.class.path");
|
||||
}
|
||||
codeSearchPath = Arrays.asList(codeSearchPathString.split(":"));
|
||||
|
||||
boolean enableMultiTenancy;
|
||||
if (config.hasPath("ray.raylet.config.enable_multi_tenancy")) {
|
||||
enableMultiTenancy =
|
||||
Boolean.valueOf(config.getString("ray.raylet.config.enable_multi_tenancy"));
|
||||
} else {
|
||||
String envString = System.getenv("RAY_ENABLE_MULTI_TENANCY");
|
||||
if (StringUtils.isNotBlank(envString)) {
|
||||
enableMultiTenancy = "1".equals(envString);
|
||||
} else {
|
||||
enableMultiTenancy = true; // Default value
|
||||
}
|
||||
}
|
||||
|
||||
if (!enableMultiTenancy) {
|
||||
if (!isDriver) {
|
||||
numWorkersPerProcess = config.getInt("ray.raylet.config.num_workers_per_process_java");
|
||||
} else {
|
||||
numWorkersPerProcess = 1; // Actually this value isn't used in RayNativeRuntime.
|
||||
}
|
||||
} else {
|
||||
numWorkersPerProcess = config.getInt("ray.job.num-java-workers-per-process");
|
||||
}
|
||||
numWorkersPerProcess = config.getInt("ray.job.num-java-workers-per-process");
|
||||
|
||||
headArgs = config.getStringList("ray.head-args");
|
||||
|
||||
|
||||
@@ -5,7 +5,6 @@ import com.google.gson.Gson;
|
||||
import com.google.gson.JsonObject;
|
||||
import com.google.gson.JsonParser;
|
||||
import io.ray.runtime.config.RayConfig;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.nio.charset.Charset;
|
||||
import java.util.ArrayList;
|
||||
@@ -31,12 +30,6 @@ public class RunManager {
|
||||
*/
|
||||
public static void startRayHead(RayConfig rayConfig) {
|
||||
LOGGER.debug("Starting ray runtime @ {}.", rayConfig.nodeIp);
|
||||
String codeSearchPath;
|
||||
if (!rayConfig.codeSearchPath.isEmpty()) {
|
||||
codeSearchPath = Joiner.on(File.pathSeparator).join(rayConfig.codeSearchPath);
|
||||
} else {
|
||||
codeSearchPath = System.getProperty("java.class.path");
|
||||
}
|
||||
List<String> command = new ArrayList<>();
|
||||
command.add("ray");
|
||||
command.add("start");
|
||||
@@ -44,7 +37,6 @@ public class RunManager {
|
||||
command.add("--redis-password");
|
||||
command.add(rayConfig.redisPassword);
|
||||
command.add("--system-config=" + new Gson().toJson(rayConfig.rayletConfigParameters));
|
||||
command.add("--code-search-path=" + codeSearchPath);
|
||||
command.addAll(rayConfig.headArgs);
|
||||
String output;
|
||||
try {
|
||||
|
||||
+2
-2
@@ -39,7 +39,7 @@ echo "Build test jar."
|
||||
bazel build //java:all_tests_deploy.jar
|
||||
|
||||
# Enable multi-worker feature in Java test
|
||||
TEST_ARGS=(-Dray.raylet.config.num_workers_per_process_java=10 -Dray.job.num-java-workers-per-process=10)
|
||||
TEST_ARGS=(-Dray.job.num-java-workers-per-process=10)
|
||||
|
||||
echo "Running tests under cluster mode."
|
||||
# TODO(hchen): Ideally, we should use the following bazel command to run Java tests. However, if there're skipped tests,
|
||||
@@ -57,7 +57,7 @@ case "${OSTYPE}" in
|
||||
darwin*) ip=$(ipconfig getifaddr en0);;
|
||||
*) echo "Can't get ip address for ${OSTYPE}"; exit 1;;
|
||||
esac
|
||||
RAY_BACKEND_LOG_LEVEL=debug ray start --head --port=6379 --redis-password=123456 --code-search-path="$PWD/bazel-bin/java/all_tests_deploy.jar"
|
||||
RAY_BACKEND_LOG_LEVEL=debug ray start --head --port=6379 --redis-password=123456
|
||||
RAY_BACKEND_LOG_LEVEL=debug java -cp bazel-bin/java/all_tests_deploy.jar -Dray.address="$ip:6379"\
|
||||
-Dray.redis.password='123456' -Dray.job.code-search-path="$PWD/bazel-bin/java/all_tests_deploy.jar" io.ray.test.MultiDriverTest
|
||||
ray stop
|
||||
|
||||
@@ -30,13 +30,13 @@ public class FailureTest extends BaseTest {
|
||||
// This is needed by `testGetThrowsQuicklyWhenFoundException`.
|
||||
// Set one worker per process. Otherwise, if `badFunc2` and `slowFunc` run in the same
|
||||
// process, `sleep` will delay `System.exit`.
|
||||
oldNumWorkersPerProcess = System.getProperty("ray.raylet.config.num_workers_per_process_java");
|
||||
System.setProperty("ray.raylet.config.num_workers_per_process_java", "1");
|
||||
oldNumWorkersPerProcess = System.getProperty("ray.job.num-java-workers-per-process");
|
||||
System.setProperty("ray.job.num-java-workers-per-process", "1");
|
||||
}
|
||||
|
||||
@AfterClass
|
||||
public void tearDown() {
|
||||
System.setProperty("ray.raylet.config.num_workers_per_process_java", oldNumWorkersPerProcess);
|
||||
System.setProperty("ray.job.num-java-workers-per-process", oldNumWorkersPerProcess);
|
||||
}
|
||||
|
||||
public static int badFunc() {
|
||||
|
||||
@@ -14,7 +14,6 @@ public class JobConfigTest extends BaseTest {
|
||||
|
||||
@BeforeClass
|
||||
public void setupJobConfig() {
|
||||
System.setProperty("ray.raylet.config.enable_multi_tenancy", "true");
|
||||
oldNumWorkersPerProcess = System.getProperty("ray.job.num-java-workers-per-process");
|
||||
System.setProperty("ray.job.num-java-workers-per-process", "3");
|
||||
System.setProperty("ray.job.jvm-options.0", "-DX=999");
|
||||
@@ -25,7 +24,6 @@ public class JobConfigTest extends BaseTest {
|
||||
|
||||
@AfterClass
|
||||
public void tearDownJobConfig() {
|
||||
System.clearProperty("ray.raylet.config.enable_multi_tenancy");
|
||||
System.setProperty("ray.job.num-java-workers-per-process", oldNumWorkersPerProcess);
|
||||
System.clearProperty("ray.job.jvm-options.0");
|
||||
System.clearProperty("ray.job.jvm-options.1");
|
||||
|
||||
@@ -18,13 +18,13 @@ public class KillActorTest extends BaseTest {
|
||||
|
||||
@BeforeClass
|
||||
public void setUp() {
|
||||
oldNumWorkersPerProcess = System.getProperty("ray.raylet.config.num_workers_per_process_java");
|
||||
System.setProperty("ray.raylet.config.num_workers_per_process_java", "1");
|
||||
oldNumWorkersPerProcess = System.getProperty("ray.job.num-java-workers-per-process");
|
||||
System.setProperty("ray.job.num-java-workers-per-process", "1");
|
||||
}
|
||||
|
||||
@AfterClass
|
||||
public void tearDown() {
|
||||
System.setProperty("ray.raylet.config.num_workers_per_process_java", oldNumWorkersPerProcess);
|
||||
System.setProperty("ray.job.num-java-workers-per-process", oldNumWorkersPerProcess);
|
||||
}
|
||||
|
||||
public static class HangActor {
|
||||
|
||||
@@ -15,8 +15,6 @@ import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
import org.testng.Assert;
|
||||
import org.testng.annotations.AfterClass;
|
||||
import org.testng.annotations.BeforeClass;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
@Test(groups = {"cluster"})
|
||||
@@ -27,16 +25,6 @@ public class MultiDriverTest extends BaseTest {
|
||||
private static final int ACTOR_COUNT_PER_DRIVER = 10;
|
||||
private static final String PID_LIST_PREFIX = "PID: ";
|
||||
|
||||
@BeforeClass
|
||||
public void setUpClass() {
|
||||
System.setProperty("ray.raylet.config.enable_multi_tenancy", "true");
|
||||
}
|
||||
|
||||
@AfterClass
|
||||
public void tearDownClass() {
|
||||
System.clearProperty("ray.raylet.config.enable_multi_tenancy");
|
||||
}
|
||||
|
||||
static int getPid() {
|
||||
return SystemUtil.pid();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user