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

Updating Test Benchmark to Sysbench #1476

Merged
merged 8 commits into from
Mar 17, 2025
Merged

Conversation

shekhar316
Copy link
Contributor

Description

This PR replaces TFB benchmark to sysbench for local monitoring use case.

How has this been tested?

Openshift Cluster

Test Configuration

  • Kubernetes clusters tested on: Openshift

Checklist 🎯

  • Followed coding guidelines
  • Comments added
  • Dependent changes merged
  • Documentation updated
  • Tests added or updated

Additional information

Include any additional information such as links, test results, screenshots here

@chandrams
Copy link
Contributor

@shekhar316 - Can you rebase the PR and update the status on this one please

@chandrams chandrams assigned chandrams and shekhar316 and unassigned chandrams Feb 18, 2025
@chandrams chandrams added this to the Kruize 0.5 Release milestone Feb 18, 2025
Signed-off-by: Shekhar Saxena <[email protected]>
Signed-off-by: Shekhar Saxena <[email protected]>
Signed-off-by: Shekhar Saxena <[email protected]>
Signed-off-by: Shekhar Saxena <[email protected]>
@shekhar316 shekhar316 marked this pull request as ready for review February 18, 2025 09:41
@shekhar316 shekhar316 changed the title Updating Test Benchmark to Sysbench [wip] Updating Test Benchmark to Sysbench Feb 18, 2025
@shreyabiradar07
Copy link
Contributor

@shekhar316 please fix the syntax error

<frozen importlib._bootstrap>:671: in _load_unlocked
    ???
/home/runner/.local/lib/python3.8/site-packages/_pytest/assertion/rewrite.py:175: in exec_module
    source_stat, co = _rewrite_test(fn, self.config)
/home/runner/.local/lib/python3.8/site-packages/_pytest/assertion/rewrite.py:355: in _rewrite_test
    tree = ast.parse(source, filename=strfn)
/usr/lib/python3.8/ast.py:47: in parse
    return compile(source, filename, mode, flags,
E     File "/home/runner/work/autotune/autotune/tests/scripts/local_monitoring_tests/rest_apis/test_local_monitoring_e2e_workflow.py", line 165
E       <<<<<<< HEAD
E       ^
E   SyntaxError: invalid syntax

Signed-off-by: Shekhar Saxena <[email protected]>
@shekhar316
Copy link
Contributor Author

@shekhar316 please fix the syntax error

<frozen importlib._bootstrap>:671: in _load_unlocked
    ???
/home/runner/.local/lib/python3.8/site-packages/_pytest/assertion/rewrite.py:175: in exec_module
    source_stat, co = _rewrite_test(fn, self.config)
/home/runner/.local/lib/python3.8/site-packages/_pytest/assertion/rewrite.py:355: in _rewrite_test
    tree = ast.parse(source, filename=strfn)
/usr/lib/python3.8/ast.py:47: in parse
    return compile(source, filename, mode, flags,
E     File "/home/runner/work/autotune/autotune/tests/scripts/local_monitoring_tests/rest_apis/test_local_monitoring_e2e_workflow.py", line 165
E       <<<<<<< HEAD
E       ^
E   SyntaxError: invalid syntax

Missed this conflict. Resolved now.
I'll add the test results also.

@shreyabiradar07
Copy link
Contributor

@shekhar316 looks like test_crc_manifest_local_monitoring PR check is failing during recommendation validation check due to "There is not enough data available to generate a recommendation."

Is 4 mins threshold enough for short_term recommendation generation or should the measurement_duration be reduced?

Signed-off-by: Shekhar Saxena <[email protected]>
# Wait for the container to complete
wait_for_container_to_complete(container_id)
# Wait for the threshold for short term recommendations
time.sleep(180)
Copy link
Contributor

Choose a reason for hiding this comment

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

Please ensure the test behavior is consistent

wait_for_container_to_complete(container_id3)

# Wait for the threshold for short term recommendations
time.sleep(180)
Copy link
Contributor

Choose a reason for hiding this comment

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

Please ensure the test behavior is consistent and short recommendations are generated after this

Copy link
Contributor

Choose a reason for hiding this comment

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

@shekhar316 - Any updates on this?

@shekhar316
Copy link
Contributor Author

Test Results

Local Monitoring e2e Test:
e2e_lm_report.html.pdf

~/redhat/codebase/testKruize/autotune/tests/scripts/local_monitoring_tests/rest_apis git:[newTests]
pytest -vv --html=tmp/report.html --cluster_type openshift test_local_monitoring_e2e_workflow.py
================================================================================== test session starts ==================================================================================
platform linux -- Python 3.12.4, pytest-8.0.0, pluggy-1.4.0 -- /usr/bin/python3
cachedir: .pytest_cache
metadata: {'Python': '3.12.4', 'Platform': 'Linux-6.10.3-200.fc40.x86_64-x86_64-with-glibc2.39', 'Packages': {'pytest': '8.0.0', 'pluggy': '1.4.0'}, 'Plugins': {'metadata': '3.1.0', 'html': '3.2.0'}, 'JAVA_HOME': '/opt/jdk-21.0.1+12'}
rootdir: /home/shesaxen/redhat/codebase/testKruize/autotune/tests/scripts/local_monitoring_tests
configfile: pytest.ini
plugins: metadata-3.1.0, html-3.2.0
collected 1 item                                                                                                                                                                        

test_local_monitoring_e2e_workflow.py::test_list_recommendations_multiple_exps_for_datasource_workloads PASSED                                                                    [100%]

--------------------- generated html file: file:///home/shesaxen/redhat/codebase/testKruize/autotune/tests/scripts/local_monitoring_tests/rest_apis/tmp/report.html ---------------------
============================================================================= 1 passed in 311.69s (0:05:11) =============================================================================

Namespace e2e Test:
e2e_ns_report.html.pdf

~/redhat/codebase/testKruize/autotune/tests/scripts/local_monitoring_tests/rest_apis git:[newTests]
pytest -vv --html=tmp/report.html --cluster_type openshift test_namespace_reco_e2e_workflow.py
================================================================================== test session starts ==================================================================================
platform linux -- Python 3.12.4, pytest-8.0.0, pluggy-1.4.0 -- /usr/bin/python3
cachedir: .pytest_cache
metadata: {'Python': '3.12.4', 'Platform': 'Linux-6.10.3-200.fc40.x86_64-x86_64-with-glibc2.39', 'Packages': {'pytest': '8.0.0', 'pluggy': '1.4.0'}, 'Plugins': {'metadata': '3.1.0', 'html': '3.2.0'}, 'JAVA_HOME': '/opt/jdk-21.0.1+12'}
rootdir: /home/shesaxen/redhat/codebase/testKruize/autotune/tests/scripts/local_monitoring_tests
configfile: pytest.ini
plugins: metadata-3.1.0, html-3.2.0
collected 1 item                                                                                                                                                                        

test_namespace_reco_e2e_workflow.py::test_list_recommendations_namespace_exps PASSED                                                                                              [100%]

=================================================================================== warnings summary ====================================================================================
rest_apis/test_namespace_reco_e2e_workflow.py::test_list_recommendations_namespace_exps
  /usr/lib/python3.12/site-packages/urllib3/connectionpool.py:1063: InsecureRequestWarning: Unverified HTTPS request is being made to host 'api.shekhar.lab.psi.pnq2.redhat.com'. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/1.26.x/advanced-usage.html#ssl-warnings
    warnings.warn(

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
--------------------- generated html file: file:///home/shesaxen/redhat/codebase/testKruize/autotune/tests/scripts/local_monitoring_tests/rest_apis/tmp/report.html ---------------------
======================================================================= 1 passed, 1 warning in 317.60s (0:05:17) ========================================================================

e2e_ns_report.html.pdf

Signed-off-by: Shekhar Saxena <[email protected]>
Copy link
Contributor

@shreyabiradar07 shreyabiradar07 left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@chandrams chandrams left a comment

Choose a reason for hiding this comment

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

LGTM

@dinogun
Copy link
Contributor

dinogun commented Mar 11, 2025

@shekhar316 I see a couple of sleep(300), are we planning to use this in PR checks?

@dinogun
Copy link
Contributor

dinogun commented Mar 17, 2025

Adding this to PR check will happen in a separate PR. This is ready for merge

@dinogun dinogun merged commit 96bc66e into kruize:mvp_demo Mar 17, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants