Skip to content

Commit

Permalink
[core] Upgrade redis from 6.x to 7.0.5. (#28936)
Browse files Browse the repository at this point in the history
Due to the SSL support and also security issues, upgrade the redis from 6.x to 7.0.5.
  • Loading branch information
fishbone authored Oct 1, 2022
1 parent 8313fe8 commit 6d2faa3
Show file tree
Hide file tree
Showing 5 changed files with 63 additions and 54 deletions.
4 changes: 2 additions & 2 deletions bazel/ray_deps_setup.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,8 @@ def ray_deps_setup():
auto_http_archive(
name = "com_github_antirez_redis",
build_file = "@com_github_ray_project_ray//bazel:BUILD.redis",
url = "https://github.com/redis/redis/archive/6.0.10.tar.gz",
sha256 = "900cb82227bac58242c9b7668e7113cd952253b256fe04bbdab1b78979cf255a",
url = "https://github.com/redis/redis/archive/refs/tags/7.0.5.tar.gz",
sha256 = "40827fcaf188456ad9b3be8e27a4f403c43672b6bb6201192dc15756af6f1eae",
patches = [
"@com_github_ray_project_ray//thirdparty/patches:redis-quiet.patch",
],
Expand Down
2 changes: 2 additions & 0 deletions python/ray/_private/services.py
Original file line number Diff line number Diff line change
Expand Up @@ -1112,6 +1112,8 @@ def _start_redis_instance(
command += ["--bind", "127.0.0.1"]
pidfile = os.path.join(session_dir_path, "redis-" + uuid.uuid4().hex + ".pid")
command += ["--pidfile", pidfile]
if sys.platform != "win32":
command += ["--save", "", "--appendonly", "no"]
process_info = start_ray_process(
command,
ray_constants.PROCESS_TYPE_REDIS_SERVER,
Expand Down
5 changes: 5 additions & 0 deletions src/ray/common/test_util.cc
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,12 @@ int TestSetupUtil::StartUpRedisServer(const int &port) {
}

std::string program = TEST_REDIS_SERVER_EXEC_PATH;
#ifdef _WIN32
std::vector<std::string> cmdargs({program, "--loglevel", "warning"});
#else
std::vector<std::string> cmdargs(
{program, "--loglevel", "warning", "--save", "", "--appendonly", "no"});
#endif
cmdargs.insert(cmdargs.end(), {"--port", std::to_string(actual_port)});
RAY_LOG(INFO) << "Start redis command is: " << CreateCommandLine(cmdargs);
RAY_CHECK(!Process::Spawn(cmdargs, true).second);
Expand Down
12 changes: 6 additions & 6 deletions src/ray/gcs/gcs_server/test/gcs_server_rpc_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -357,9 +357,9 @@ TEST_F(GcsServerTest, TestHeartbeatWithNoRegistering) {
register_node_info_request.mutable_node_info()->CopyFrom(*gcs_node_info);
ASSERT_TRUE(RegisterNode(register_node_info_request));
std::vector<rpc::GcsNodeInfo> node_info_list = GetAllNodeInfo();
ASSERT_TRUE(node_info_list.size() == 1);
ASSERT_TRUE(node_info_list[0].state() ==
rpc::GcsNodeInfo_GcsNodeState::GcsNodeInfo_GcsNodeState_ALIVE);
ASSERT_EQ(1, node_info_list.size());
ASSERT_EQ(rpc::GcsNodeInfo_GcsNodeState::GcsNodeInfo_GcsNodeState_ALIVE,
node_info_list[0].state());

// Report heartbeat
report_heartbeat_request.mutable_heartbeat()->set_node_id(gcs_node_info->node_id());
Expand All @@ -371,9 +371,9 @@ TEST_F(GcsServerTest, TestHeartbeatWithNoRegistering) {
draining_request->set_node_id(gcs_node_info->node_id());
ASSERT_TRUE(DrainNode(unregister_node_info_request));
node_info_list = GetAllNodeInfo();
ASSERT_TRUE(node_info_list.size() == 1);
ASSERT_TRUE(node_info_list[0].state() ==
rpc::GcsNodeInfo_GcsNodeState::GcsNodeInfo_GcsNodeState_DEAD);
ASSERT_EQ(1, node_info_list.size());
ASSERT_EQ(rpc::GcsNodeInfo_GcsNodeState::GcsNodeInfo_GcsNodeState_DEAD,
node_info_list[0].state());
}

TEST_F(GcsServerTest, TestStats) {
Expand Down
94 changes: 48 additions & 46 deletions thirdparty/patches/redis-quiet.patch
Original file line number Diff line number Diff line change
@@ -1,73 +1,75 @@
diff --git deps/jemalloc/configure deps/jemalloc/configure
--- deps/jemalloc/configure
+++ deps/jemalloc/configure
@@ -7094 +7094 @@
-ARFLAGS='crus'
+ARFLAGS='crs'
diff --git deps/jemalloc/Makefile.in deps/jemalloc/Makefile.in
--- deps/jemalloc/Makefile.in
+++ deps/jemalloc/Makefile.in
@@ -370 +370 @@
- @if ! `cmp -s $< $@` ; then echo "cp $< $<"; cp $< $@ ; fi
+ @if ! `cmp -s $< $@` ; then cp $< $@ ; fi
diff --git deps/Makefile deps/Makefile
diff --git a/deps/Makefile b/deps/Makefile
index 8592e17..0c13eea 100644
--- deps/Makefile
+++ deps/Makefile
@@ -46,13 +46,13 @@ ifeq ($(BUILD_TLS),yes)
@@ -49,19 +49,19 @@ ifeq ($(BUILD_TLS),yes)
endif

hiredis: .make-prerequisites
- @printf '%b %b\n' $(MAKECOLOR)MAKE$(ENDCOLOR) $(BINCOLOR)$@$(ENDCOLOR)
+ #@printf '%b %b\n' $(MAKECOLOR)MAKE$(ENDCOLOR) $(BINCOLOR)$@$(ENDCOLOR)
cd hiredis && $(MAKE) static $(HIREDIS_MAKE_FLAGS)

.PHONY: hiredis

linenoise: .make-prerequisites
- @printf '%b %b\n' $(MAKECOLOR)MAKE$(ENDCOLOR) $(BINCOLOR)$@$(ENDCOLOR)
+ #@printf '%b %b\n' $(MAKECOLOR)MAKE$(ENDCOLOR) $(BINCOLOR)$@$(ENDCOLOR)
cd linenoise && $(MAKE)

.PHONY: linenoise
@@ -62,7 +62,7 @@ ifeq ($(uname_S),SunOS)
LUA_CFLAGS= -D__C99FEATURES__=1
endif

-LUA_CFLAGS+= -O2 -Wall -DLUA_ANSI -DENABLE_CJSON_GLOBAL -DREDIS_STATIC='' $(CFLAGS)
+LUA_CFLAGS+= -O2 -DLUA_ANSI -DENABLE_CJSON_GLOBAL -DREDIS_STATIC='' $(CFLAGS)
LUA_LDFLAGS+= $(LDFLAGS)
# lua's Makefile defines AR="ar rcu", which is unusual, and makes it more
# challenging to cross-compile lua (and redis). These defines make it easier
@@ -71,17 +71,17 @@ AR=ar
ARFLAGS=rcu


hdr_histogram: .make-prerequisites
- @printf '%b %b\n' $(MAKECOLOR)MAKE$(ENDCOLOR) $(BINCOLOR)$@$(ENDCOLOR)
+ #@printf '%b %b\n' $(MAKECOLOR)MAKE$(ENDCOLOR) $(BINCOLOR)$@$(ENDCOLOR)
cd hdr_histogram && $(MAKE)

.PHONY: hdr_histogram
@@ -85,7 +85,7 @@ AR=ar
ARFLAGS=rc

lua: .make-prerequisites
- @printf '%b %b\n' $(MAKECOLOR)MAKE$(ENDCOLOR) $(BINCOLOR)$@$(ENDCOLOR)
+ #@printf '%b %b\n' $(MAKECOLOR)MAKE$(ENDCOLOR) $(BINCOLOR)$@$(ENDCOLOR)
cd lua/src && $(MAKE) all CFLAGS="$(LUA_CFLAGS)" MYLDFLAGS="$(LUA_LDFLAGS)" AR="$(AR) $(ARFLAGS)"

.PHONY: lua

-JEMALLOC_CFLAGS= -std=gnu99 -Wall -pipe -g3 -O3 -funroll-loops $(CFLAGS)
+JEMALLOC_CFLAGS= -std=gnu99 -pipe -g3 -O3 -funroll-loops $(CFLAGS)
JEMALLOC_LDFLAGS= $(LDFLAGS)

@@ -98,7 +98,7 @@ JEMALLOC_CONFIGURE_OPTS += --host=$(DEB_HOST_GNU_TYPE)
endif

jemalloc: .make-prerequisites
- @printf '%b %b\n' $(MAKECOLOR)MAKE$(ENDCOLOR) $(BINCOLOR)$@$(ENDCOLOR)
- cd jemalloc && ./configure --with-version=5.1.0-0-g0 --with-lg-quantum=3 --with-jemalloc-prefix=je_ --enable-cc-silence CFLAGS="$(JEMALLOC_CFLAGS)" LDFLAGS="$(JEMALLOC_LDFLAGS)"
+ #@printf '%b %b\n' $(MAKECOLOR)MAKE$(ENDCOLOR) $(BINCOLOR)$@$(ENDCOLOR)
+ cd jemalloc && ./configure --with-version=5.1.0-0-g0 --with-lg-quantum=3 --with-jemalloc-prefix=je_ --silent CFLAGS="$(JEMALLOC_CFLAGS)" LDFLAGS="$(JEMALLOC_LDFLAGS)"
cd jemalloc && ./configure --with-version=5.2.1-0-g0 --with-lg-quantum=3 --with-jemalloc-prefix=je_ CFLAGS="$(JEMALLOC_CFLAGS)" LDFLAGS="$(JEMALLOC_LDFLAGS)" $(JEMALLOC_CONFIGURE_OPTS)
cd jemalloc && $(MAKE) CFLAGS="$(JEMALLOC_CFLAGS)" LDFLAGS="$(JEMALLOC_LDFLAGS)" lib/libjemalloc.a

.PHONY: jemalloc
diff --git src/Makefile src/Makefile

diff --git a/deps/jemalloc/Makefile.in b/deps/jemalloc/Makefile.in
index 7128b00..da8e429 100644
--- deps/jemalloc/Makefile.in
+++ deps/jemalloc/Makefile.in
@@ -406,7 +406,7 @@ $(objroot)include/jemalloc/internal/private_namespace_jet.gen.h: $(C_JET_SYMS)
$(SHELL) $(srcroot)include/jemalloc/internal/private_namespace.sh $^ > $@

%.h: %.gen.h
- @if ! `cmp -s $< $@` ; then echo "cp $< $<"; cp $< $@ ; fi
+ @if ! `cmp -s $< $@` ; then cp $< $@ ; fi

$(CPP_OBJS) $(CPP_PIC_OBJS) $(TESTS_CPP_OBJS): %.$(O):
@mkdir -p $(@D)
diff --git a/src/Makefile b/src/Makefile
index e4f7d90..218543f 100644
--- src/Makefile
+++ src/Makefile
@@ -176,3 +176,3 @@
@@ -326,9 +326,9 @@ REDIS_CHECK_AOF_NAME=redis-check-aof$(PROG_SUFFIX)
ALL_SOURCES=$(sort $(patsubst %.o,%.c,$(REDIS_SERVER_OBJ) $(REDIS_CLI_OBJ) $(REDIS_BENCHMARK_OBJ)))

all: $(REDIS_SERVER_NAME) $(REDIS_SENTINEL_NAME) $(REDIS_CLI_NAME) $(REDIS_BENCHMARK_NAME) $(REDIS_CHECK_RDB_NAME) $(REDIS_CHECK_AOF_NAME)
- @echo ""
+# @echo ""
- @echo "Hint: It's a good idea to run 'make test' ;)"
+# @echo "Hint: It's a good idea to run 'make test' ;)"
- @echo ""
+# @echo ""
--
+ #@echo ""
+ #@echo "Hint: It's a good idea to run 'make test' ;)"
+ #@echo ""

Makefile.dep:
-$(REDIS_CC) -MM $(ALL_SOURCES) > Makefile.dep 2> /dev/null || true

0 comments on commit 6d2faa3

Please sign in to comment.