[Multi-tenancy] Delete flag enable_multi_tenancy and remove old code path (#10573)

This commit is contained in:
Kai Yang
2020-12-10 19:01:40 +08:00
committed by GitHub
parent d681991773
commit e3b5deb741
47 changed files with 279 additions and 530 deletions
@@ -12,10 +12,8 @@ class ClusterStarter {
static synchronized void startCluster(boolean isLocal) {
Preconditions.checkArgument(!Ray.isInitialized());
if (!isLocal) {
System.setProperty("ray.raylet.config.num_workers_per_process_java", "1");
System.setProperty("ray.run-mode", "CLUSTER");
} else {
System.clearProperty("ray.raylet.config.num_workers_per_process_java");
System.setProperty("ray.run-mode", "SINGLE_PROCESS");
}
@@ -25,7 +23,6 @@ class ClusterStarter {
public static synchronized void stopCluster() {
// Disconnect to the cluster.
Ray.shutdown();
System.clearProperty("ray.raylet.config.num_workers_per_process_java");
System.clearProperty("ray.run-mode");
}
}
@@ -60,7 +60,6 @@ public class StreamingQueueTest extends BaseUnitTest implements Serializable {
Ray.shutdown();
System.setProperty("ray.head-args.0", "--num-cpus=4");
System.setProperty("ray.head-args.1", "--resources={\"RES-A\":4}");
System.setProperty("ray.raylet.config.num_workers_per_process_java", "1");
System.setProperty("ray.run-mode", "CLUSTER");
System.setProperty("ray.redirect-output", "true");
Ray.init();
@@ -82,7 +81,6 @@ public class StreamingQueueTest extends BaseUnitTest implements Serializable {
Ray.shutdown();
System.setProperty("ray.head-args.0", "--num-cpus=4");
System.setProperty("ray.head-args.1", "--resources={\"RES-A\":4}");
System.setProperty("ray.raylet.config.num_workers_per_process_java", "1");
System.setProperty("ray.run-mode", "CLUSTER");
System.setProperty("ray.redirect-output", "true");
@@ -139,7 +137,6 @@ public class StreamingQueueTest extends BaseUnitTest implements Serializable {
Ray.shutdown();
System.setProperty("ray.head-args.0", "--num-cpus=4");
System.setProperty("ray.head-args.1", "--resources={\"RES-A\":4}");
System.setProperty("ray.raylet.config.num_workers_per_process_java", "1");
System.setProperty("ray.run-mode", "CLUSTER");
System.setProperty("ray.redirect-output", "true");
+2 -1
View File
@@ -1,5 +1,6 @@
import argparse
import logging
import sys
import time
import ray
@@ -65,7 +66,7 @@ if __name__ == "__main__":
args = parser.parse_args()
titles_file = str(args.titles_file)
ray.init(_load_code_from_local=True)
ray.init(job_config=ray.job_config.JobConfig(code_search_path=sys.path))
ctx = StreamingContext.Builder() \
.option(Config.CHANNEL_TYPE, Config.NATIVE_CHANNEL) \
+3 -1
View File
@@ -1,4 +1,5 @@
import subprocess
import sys
import time
from typing import List
@@ -8,7 +9,8 @@ from ray.streaming import StreamingContext
def test_word_count():
try:
ray.init(_load_code_from_local=True)
ray.init(
job_config=ray.job_config.JobConfig(code_search_path=sys.path))
# time.sleep(10) # for gdb to attach
ctx = StreamingContext.Builder() \
.option("streaming.context-backend.type", "local_file") \
+3 -3
View File
@@ -1,6 +1,7 @@
import json
import os
import subprocess
import sys
import ray
from ray.streaming import StreamingContext
@@ -34,9 +35,8 @@ def test_hybrid_stream():
print("java_worker_options", java_worker_options)
assert not ray.is_initialized()
ray.init(
_load_code_from_local=True,
_java_worker_options=java_worker_options,
_system_config={"num_workers_per_process_java": 1})
job_config=ray.job_config.JobConfig(code_search_path=sys.path),
_java_worker_options=java_worker_options)
sink_file = "/tmp/ray_streaming_test_hybrid_stream.txt"
if os.path.exists(sink_file):
+5 -3
View File
@@ -1,9 +1,11 @@
import sys
import ray
from ray.streaming import StreamingContext
def test_data_stream():
ray.init(_load_code_from_local=True)
ray.init(job_config=ray.job_config.JobConfig(code_search_path=sys.path))
ctx = StreamingContext.Builder().build()
stream = ctx.from_values(1, 2, 3)
java_stream = stream.as_java_stream()
@@ -17,7 +19,7 @@ def test_data_stream():
def test_key_data_stream():
ray.init(_load_code_from_local=True)
ray.init(job_config=ray.job_config.JobConfig(code_search_path=sys.path))
ctx = StreamingContext.Builder().build()
key_stream = ctx.from_values(
"a", "b", "c").map(lambda x: (x, 1)).key_by(lambda x: x[0])
@@ -32,7 +34,7 @@ def test_key_data_stream():
def test_stream_config():
ray.init(_load_code_from_local=True)
ray.init(job_config=ray.job_config.JobConfig(code_search_path=sys.path))
ctx = StreamingContext.Builder().build()
stream = ctx.from_values(1, 2, 3)
stream.with_config("k1", "v1")
+2 -1
View File
@@ -1,11 +1,12 @@
import os
import sys
import ray
from ray.streaming import StreamingContext
def test_union_stream():
ray.init(_load_code_from_local=True)
ray.init(job_config=ray.job_config.JobConfig(code_search_path=sys.path))
ctx = StreamingContext.Builder() \
.option("streaming.metrics.reporters", "") \
.build()
+3 -2
View File
@@ -1,11 +1,12 @@
import os
import sys
import ray
from ray.streaming import StreamingContext
from ray.test_utils import wait_for_condition
def test_word_count():
ray.init(_load_code_from_local=True)
ray.init(job_config=ray.job_config.JobConfig(code_search_path=sys.path))
ctx = StreamingContext.Builder() \
.build()
ctx.read_text_file(__file__) \
@@ -24,7 +25,7 @@ def test_word_count():
def test_simple_word_count():
ray.init(_load_code_from_local=True)
ray.init(job_config=ray.job_config.JobConfig(code_search_path=sys.path))
ctx = StreamingContext.Builder() \
.build()
sink_file = "/tmp/ray_streaming_test_simple_word_count.txt"