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

Support multinode cluster logging #4097

Merged
merged 3 commits into from
Oct 16, 2023
Merged
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
4 changes: 3 additions & 1 deletion src/test_workflow/test_recorder/test_recorder.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,12 @@ class LocalClusterLogs(LogRecorder):

def __init__(self, parent_class: TestRecorder) -> None:
self.parent_class = parent_class
self.number_of_nodes = 0

def save_test_result_data(self, test_result_data: TestResultData) -> None:
base = self.parent_class._create_base_folder_structure(test_result_data.component_name, test_result_data.component_test_config)
dest_directory = os.path.join(base, "local-cluster-logs")
dest_directory = os.path.join(base, "local-cluster-logs/id-" + str(self.number_of_nodes))
self.number_of_nodes += 1
Comment on lines +102 to +103
Copy link
Member

Choose a reason for hiding this comment

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

The problem with this design as per your log, is that once with-security test complete, the id will not reset and result in id-2/id-3 in without-security dir.

Would suggest reset the number after each run. So it will results in this:

with-security/id-0 id-1
without-security/id-0 id-1

instead of:

with-security/id-0 id-1
without-security/id-2 id-3

Copy link
Member

Choose a reason for hiding this comment

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

Tests are triggered separately for with and without security so we should be good I believe.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The current behavior continues to increase the id throughout different components.

Copy link
Member

Choose a reason for hiding this comment

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

This seems to be a generic change. Can you make sure that this doesn't impact other plugins? CC: @peterzhuamazon @gaiksaya

Copy link
Member

Choose a reason for hiding this comment

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

I think it might impact the resports workflows that @zelinh was working on.

Need confirmation on how he retrieve the logs.

Thanks.

Copy link
Member

Choose a reason for hiding this comment

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

I don't think so. The test report just dumps grabs and dumps everything in integ-test folder to manifest. It does not parse each folder for logs I believe. @zelinh can confirm.

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, I was worried this might impact the logs path for component yml file we generated during test record; but i just checked and confirmed that we are walking through the test folder here. The inside file/directory structure should also be recorded properly.
I also checked that we aren't hardcorded anywhere local-cluster-logs so I think this should be fine.

os.makedirs(dest_directory, exist_ok=True)
logging.info(
f"Recording local cluster logs for {test_result_data.component_name} with test configuration as "
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ def test(self) -> None:

mock_test_result_data = MagicMock()

dest_directory = os.path.join("test_base", "local-cluster-logs")
dest_directory = os.path.join("test_base", "local-cluster-logs/id-0")

source_file_1 = os.path.join("dir", "opensearch_index_indexing_slowlog.log")
source_file_2 = os.path.join("dir", "opensearch_deprecation.json")
Expand Down
Loading