From aaf659cb768621a24c16d9c44834515d027b8e0e Mon Sep 17 00:00:00 2001 From: Lingxuan Zuo Date: Fri, 25 Feb 2022 14:40:42 +0800 Subject: [PATCH 1/2] apply use ray internal namespace for stats reporting --- streaming/BUILD.bazel | 1 + streaming/WORKSPACE | 6 +++--- streaming/src/metrics/stats_reporter.cc | 5 +++-- streaming/src/test/streaming_perf_tests.cc | 2 +- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/streaming/BUILD.bazel b/streaming/BUILD.bazel index ed77c636..adaefc6c 100644 --- a/streaming/BUILD.bazel +++ b/streaming/BUILD.bazel @@ -132,6 +132,7 @@ cc_library( strip_include_prefix = "src", visibility = ["//visibility:public"], deps = [ + "exported_internal.so", "stats_lib.so", ":streaming_config", ":streaming_util", diff --git a/streaming/WORKSPACE b/streaming/WORKSPACE index fb6e2117..ef573042 100644 --- a/streaming/WORKSPACE +++ b/streaming/WORKSPACE @@ -2,12 +2,12 @@ workspace(name = "com_github_ray_streaming") # LOAD RAY WORKSPACE load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive", "http_file") -ray_version = "2cee219250ccd8900ec8a7c1858310a42a7ca3ed" +ray_version = "remove-exporting-symbols" http_archive( name="com_github_ray_project_ray", strip_prefix = "ray-{}".format(ray_version), - urls = ["https://github.com/ray-project/ray/archive/{}.zip".format(ray_version)], - sha256 = "f0d154b5bee2d17296560440983b89e7f110462ac26bdf00c4269111d4ed08d0", + urls = ["https://github.com/ray-project/ray/archive/refs/heads/{}.zip".format(ray_version)], + #sha256 = "ec96eb8a7c781d1b1e68ac4c8c2c39af18f1c6fa1057ff7e6e00f2ce4b880acf", ) diff --git a/streaming/src/metrics/stats_reporter.cc b/streaming/src/metrics/stats_reporter.cc index 286b8a38..2229c3e5 100644 --- a/streaming/src/metrics/stats_reporter.cc +++ b/streaming/src/metrics/stats_reporter.cc @@ -1,5 +1,6 @@ #include "metrics/stats_reporter.h" #include "util/streaming_logging.h" +#include "ray/internal/internal.h" namespace ray { namespace streaming { @@ -33,7 +34,7 @@ bool StatsReporter::Start(const StreamingMetricsConfig &conf) { << ", stats disabled : " << stats::StatsConfig::instance().IsStatsDisabled(); for (auto &tag : global_tags_) { - global_tag_key_list_.push_back(stats::TagKeyType::Register(tag.first)); + global_tag_key_list_.push_back(internal::TagRegister(tag.first)); } return true; } @@ -90,7 +91,7 @@ void StatsReporter::UpdateGauge(const std::string &metric_name, std::vector tag_key_list(global_tag_key_list_.begin(), global_tag_key_list_.end()); for (auto &tag : tags) { - tag_key_list.push_back(stats::TagKeyType::Register(tag.first)); + tag_key_list.push_back(internal::TagRegister(tag.first)); } metric = std::shared_ptr( new ray::stats::Gauge(merged_metric_name, "", "", tag_key_list)); diff --git a/streaming/src/test/streaming_perf_tests.cc b/streaming/src/test/streaming_perf_tests.cc index 3c4752b0..5c56d9a3 100644 --- a/streaming/src/test/streaming_perf_tests.cc +++ b/streaming/src/test/streaming_perf_tests.cc @@ -24,7 +24,7 @@ class StreamingReporterCounterTest : public ::testing::Test { absl::Duration harvest_interval = absl::Milliseconds(kReportFlushInterval / 2); ray::stats::StatsConfig::instance().SetReportInterval(report_interval); ray::stats::StatsConfig::instance().SetHarvestInterval(harvest_interval); - const stats::TagsType global_tags = {{stats::ResourceNameKey, "CPU"}}; + const stats::TagsType global_tags = {}; std::shared_ptr exporter( new stats::StdoutExporterClient()); ray::stats::Init(global_tags, 10054, exporter); From 14aa55fb1944cdeaa52e3e48d39391a46a5a6b1c Mon Sep 17 00:00:00 2001 From: Lingxuan Zuo Date: Mon, 28 Feb 2022 10:04:29 +0800 Subject: [PATCH 2/2] redefine import ray version commit --- streaming/WORKSPACE | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/streaming/WORKSPACE b/streaming/WORKSPACE index ef573042..cf130513 100644 --- a/streaming/WORKSPACE +++ b/streaming/WORKSPACE @@ -2,12 +2,12 @@ workspace(name = "com_github_ray_streaming") # LOAD RAY WORKSPACE load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive", "http_file") -ray_version = "remove-exporting-symbols" +ray_version = "94caac87222784a36b76f9ee2e607fd796217477" http_archive( name="com_github_ray_project_ray", strip_prefix = "ray-{}".format(ray_version), - urls = ["https://github.com/ray-project/ray/archive/refs/heads/{}.zip".format(ray_version)], - #sha256 = "ec96eb8a7c781d1b1e68ac4c8c2c39af18f1c6fa1057ff7e6e00f2ce4b880acf", + urls = ["https://github.com/ray-project/ray/archive/{}.zip".format(ray_version)], + sha256 = "69a2dc6e0d78e14758ef60ab2eb34b99c88f3e1c6292b1181dbf83e164272032", )