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

Add opensearch cluster stdout and stderr logs to test results manifest #4352

Merged
merged 1 commit into from
Jan 25, 2024
Merged

Conversation

rishabh6788
Copy link
Collaborator

Description

This PR adds opensearch cluster stdout and stderr logs to test results manifest. Now the user will be able to see opensearch cluster logs for their component's integ test run. This will be helpful when the test results show as N/A and the users wants to know what went wrong.

Issues Resolved

#4335

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Copy link

codecov bot commented Jan 18, 2024

Codecov Report

Attention: 3 lines in your changes are missing coverage. Please review.

Comparison is base (ca0c930) 91.35% compared to head (b1b92fb) 91.34%.
Report is 12 commits behind head on main.

Files Patch % Lines
src/report_workflow/test_report_runner.py 84.21% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4352      +/-   ##
==========================================
- Coverage   91.35%   91.34%   -0.01%     
==========================================
  Files         190      190              
  Lines        6175     6193      +18     
==========================================
+ Hits         5641     5657      +16     
- Misses        534      536       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@zelinh zelinh left a comment

Choose a reason for hiding this comment

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

I'm thinking if the component yml file actually contains the local cluster logs if it's generated. (e.g. https://ci.opensearch.org/ci/dbc/integ-test/2.12.0/9207/linux/arm64/tar/test-results/7043/integ-test/alerting/without-security/alerting.yml)
Can we generate the component yml file in this case?

NVM, I think this might not be applicable. Component yml file not generated because the cluster goes wrong and we won't get to the stage to record component yml.

os_stdout = ''
os_stderr = ''
if base_path.startswith("https://"):
os_stdout = "/".join([base_path.strip("/"), "test-results", test_number, test_type, component_name, config, "local-cluster-logs/id-0/stdout.txt"])
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 this might not be id-0 all the time. CCR team added this id for the cases that there are multiple clusters so we may need to iterate through all of them. #4097
This would also applied to some dashboards integ tests I believe.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Just verified with past runs and here is the structure, for all the plugins except CCR the cluster id for with-security runs is id-0 and without-security is id-1. I have updated the code for the same.
For CCR, 4 node cluster is spun up, with-security has id-0, id-1, id-2, id-3 and without has 4 - 7. I think it is fine for now wrt CCR as the logs would definitely come handy, even though it comes from one configuration run, in cases where OS process fails to come up.

Copy link
Member

Choose a reason for hiding this comment

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

But this structure will also be used for dashboards plugins. From what I'm seeing, with-security will have id-0 and id-1; without-security will have id-2 & id-3. We might still want to have some approaches to accommodate for dashboards test.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Fixed it. @zelinh

def get_os_cluster_logs(base_path: str, test_number: str, test_type: str, component_name: str, config: str) -> List[str]:
os_stdout: str = ''
os_stderr: str = ''
cluster_id: str = 'id-0' if config == 'with-security' else 'id-1'
Copy link
Member

Choose a reason for hiding this comment

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

This hard code id will not work for the dashboards cases since dashboards will include two local cluster logs; it uses 0&1 for with-security and 2&3 for without-security.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Fixed this. The stdout and stderr fields in the test report yaml will now be a list showing appropriate cluster-ids for OS and OSD.

Signed-off-by: Rishabh Singh <sngri@amazon.com>
Copy link
Member

@zelinh zelinh left a comment

Choose a reason for hiding this comment

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

LGTM so far though I think we should have a more comprehensive approach for multi-cluster test components instead of hardcoding cluster id. This fix should be helpful enough at this time and I'm approving to unblock. Thanks!

@rishabh6788 rishabh6788 merged commit a7f0228 into opensearch-project:main Jan 25, 2024
11 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants