Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move export events to separate folder #47747

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion python/ray/tests/test_runtime_env_2.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ def job_failed(job_id):
with pytest.raises(AssertionError):
assert_no_user_info_in_logs(USER_SECRET)

assert_no_user_info_in_logs(USER_SECRET, file_whitelist=["runtime_env*.log"])
assert_no_user_info_in_logs(USER_SECRET, file_whitelist=["runtime_env*.log", "event_EXPORT*.log"])
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updating so TestNoUserInfoInLogs::test_basic passes regardless of value of FF



if __name__ == "__main__":
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,9 @@ TEST_F(TaskEventTestWriteExport, TestWriteTaskExportEvents) {
std::vector<std::string> vc;
for (int i = 0; i * batch_size < max_export_events_on_buffer; i++) {
task_event_buffer_->FlushEvents(true);
ReadContentFromFile(
vc, log_dir_ + "/events/event_EXPORT_TASK_" + std::to_string(getpid()) + ".log");
ReadContentFromFile(vc,
log_dir_ + "/export_events/event_EXPORT_TASK_" +
std::to_string(getpid()) + ".log");
EXPECT_EQ((int)vc.size(), (i + 1) * batch_size);
vc.clear();
}
Expand All @@ -178,7 +179,8 @@ TEST_F(TaskEventTestWriteExport, TestWriteTaskExportEvents) {
// max_export_events_on_buffer > task_events_max_num_status_events_buffer_on_worker
vc.clear();
ReadContentFromFile(
vc, log_dir_ + "/events/event_EXPORT_TASK_" + std::to_string(getpid()) + ".log");
vc,
log_dir_ + "/export_events/event_EXPORT_TASK_" + std::to_string(getpid()) + ".log");
EXPECT_EQ((int)vc.size(), max_export_events_on_buffer);
for (size_t i = 0; i < max_export_events_on_buffer; i++) {
json export_event_as_json = json::parse(vc[i]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ TEST_F(GcsActorManagerTest, TestBasic) {
"DEPENDENCIES_UNREADY", "PENDING_CREATION", "ALIVE", "DEAD"};
std::vector<std::string> vc;
for (int i = 0; i < num_retry; i++) {
Mocker::ReadContentFromFile(vc, log_dir_ + "/events/event_EXPORT_ACTOR.log");
Mocker::ReadContentFromFile(vc, log_dir_ + "/export_events/event_EXPORT_ACTOR.log");
if ((int)vc.size() == num_export_events) {
for (int event_idx = 0; event_idx < num_export_events; event_idx++) {
json export_event_as_json = json::parse(vc[event_idx]);
Expand All @@ -319,7 +319,7 @@ TEST_F(GcsActorManagerTest, TestBasic) {
vc.clear();
}
}
Mocker::ReadContentFromFile(vc, log_dir_ + "/events/event_EXPORT_ACTOR.log");
Mocker::ReadContentFromFile(vc, log_dir_ + "/export_events/event_EXPORT_ACTOR.log");
std::ostringstream lines;
for (auto line : vc) {
lines << line << "\n";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,8 @@ TEST_F(GcsJobManagerTest, TestExportDriverJobEvents) {
promise.get_future().get();

std::vector<std::string> vc;
Mocker::ReadContentFromFile(vc, log_dir_ + "/events/event_EXPORT_DRIVER_JOB.log");
Mocker::ReadContentFromFile(vc,
log_dir_ + "/export_events/event_EXPORT_DRIVER_JOB.log");
ASSERT_EQ((int)vc.size(), 1);
json event_data = json::parse(vc[0])["event_data"].get<json>();
ASSERT_EQ(event_data["is_dead"], false);
Expand All @@ -149,7 +150,8 @@ TEST_F(GcsJobManagerTest, TestExportDriverJobEvents) {
job_finished_promise.get_future().get();

vc.clear();
Mocker::ReadContentFromFile(vc, log_dir_ + "/events/event_EXPORT_DRIVER_JOB.log");
Mocker::ReadContentFromFile(vc,
log_dir_ + "/export_events/event_EXPORT_DRIVER_JOB.log");
ASSERT_EQ((int)vc.size(), 2);
event_data = json::parse(vc[1])["event_data"].get<json>();
ASSERT_EQ(event_data["is_dead"], true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ TEST_F(GcsNodeManagerExportAPITest, TestExportEventRegisterNode) {
io_service_.poll();

std::vector<std::string> vc;
Mocker::ReadContentFromFile(vc, log_dir_ + "/events/event_EXPORT_NODE.log");
Mocker::ReadContentFromFile(vc, log_dir_ + "/export_events/event_EXPORT_NODE.log");
ASSERT_EQ((int)vc.size(), 1);
json event_data = json::parse(vc[0])["event_data"].get<json>();
ASSERT_EQ(event_data["state"], "ALIVE");
Expand Down Expand Up @@ -120,7 +120,7 @@ TEST_F(GcsNodeManagerExportAPITest, TestExportEventUnregisterNode) {
io_service_.poll();

std::vector<std::string> vc;
Mocker::ReadContentFromFile(vc, log_dir_ + "/events/event_EXPORT_NODE.log");
Mocker::ReadContentFromFile(vc, log_dir_ + "/export_events/event_EXPORT_NODE.log");
ASSERT_EQ((int)vc.size(), 1);
json event_data = json::parse(vc[0])["event_data"].get<json>();
ASSERT_EQ(event_data["state"], "DEAD");
Expand Down
1 change: 1 addition & 0 deletions src/ray/util/event.cc
Original file line number Diff line number Diff line change
Expand Up @@ -482,6 +482,7 @@ void RayEventInit_(const std::vector<SourceTypeVariant> source_types,
} else if (auto export_event_source_type_ptr =
std::get_if<rpc::ExportEvent_SourceType>(&source_type)) {
// For export events
event_dir = std::filesystem::path(log_dir) / std::filesystem::path("export_events");
source_type_name = ExportEvent_SourceType_Name(*export_event_source_type_ptr);
ray::EventManager::Instance().AddExportReporter(
*export_event_source_type_ptr,
Expand Down