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

Added groovy script for running benchmark tests #205

Merged
merged 1 commit into from
May 22, 2023
Merged

Added groovy script for running benchmark tests #205

merged 1 commit into from
May 22, 2023

Conversation

rishabh6788
Copy link
Collaborator

Description

This PR adds groovy script to run benchmark tests using opensearch-benchmark.

Issues Resolved

opensearch-project/opensearch-build#3496

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.

@codecov
Copy link

codecov bot commented May 16, 2023

Codecov Report

Merging #205 (5a22a0a) into main (35f6aa9) will increase coverage by 1.14%.
The diff coverage is 100.00%.

@@             Coverage Diff              @@
##               main     #205      +/-   ##
============================================
+ Coverage     85.42%   86.56%   +1.14%     
- Complexity       25       27       +2     
============================================
  Files            74       76       +2     
  Lines           199      201       +2     
  Branches         11       11              
============================================
+ Hits            170      174       +4     
+ Misses           21       19       -2     
  Partials          8        8              
Impacted Files Coverage Δ
...ts/jenkins/jobs/BenchmarkTestMultinode_Jenkinsfile 100.00% <100.00%> (ø)
tests/jenkins/jobs/BenchmarkTest_Jenkinsfile 100.00% <100.00%> (ø)

... and 1 file with indirect coverage changes

Comment on lines 13 to 18
* @param args.insecure <required> - Force the security of the cluster to be disabled, default is false.
* @param args.workload <required> - Name of the workload that OpenSearch Benchmark should run, default is nyc_taxis.
* @param args.singleNode <required> - Create single node OS cluster, default is true.
* @param args.minDistribution <required> - Use min distribution of OpenSearch for cluster, default is false.
* @param args.useFiftyPercentHeap <required> - Use 50 percent of physical memory as heap, default is false.
* @param args.captureNodeStat <required> - Make opensearch-benchmark to capture node stats during run, default is false
Copy link
Member

Choose a reason for hiding this comment

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

All these values have defaults so they cannot be required. I believe they should be ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Makes sense, will make them optional.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

workload is a required field in the context of the groovy script, made others optional.

vars/runBenchmarkTestScript.groovy Outdated Show resolved Hide resolved
vars/runBenchmarkTestScript.groovy Outdated Show resolved Hide resolved
vars/runBenchmarkTestScript.groovy Outdated Show resolved Hide resolved
vars/runBenchmarkTestScript.groovy Outdated Show resolved Hide resolved
lib = library(identifier: 'jenkins@main', retriever: legacySCM(scm))
def buildManifest = lib.jenkins.BuildManifest.new(readYaml(file: args.bundleManifest))

config_name = isNullOrEmpty(args.config) ? "config.yml" : args.config
Copy link
Member

Choose a reason for hiding this comment

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

I dont see config in args above. Was that missed?

Copy link
Collaborator Author

@rishabh6788 rishabh6788 May 19, 2023

Choose a reason for hiding this comment

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

Added.

vars/runBenchmarkTestScript.groovy Outdated Show resolved Hide resolved
vars/runBenchmarkTestScript.groovy Show resolved Hide resolved
}

String getMetadataTags(tags, buildManifest) {
def metadataTags = "jenkins-build-id:${buildManifest.getArtifactBuildId()},arch:${buildManifest.getArtifactArchitecture()}," +
Copy link
Member

Choose a reason for hiding this comment

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

jenkins-build-id indicates the build number of the jenkins workflow where this will be run. Usually it means that.
How about distribution-build-id or dist-build-id?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

makes sense, updated.

@rishabh6788 rishabh6788 requested a review from gaiksaya May 19, 2023 16:58
@rishabh6788 rishabh6788 merged commit 762ba18 into opensearch-project:main May 22, 2023
opensearch-trigger-bot bot pushed a commit that referenced this pull request May 22, 2023
Signed-off-by: Rishabh Singh <[email protected]>
(cherry picked from commit 762ba18)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
rishabh6788 pushed a commit that referenced this pull request May 22, 2023
Signed-off-by: Rishabh Singh <[email protected]>
(cherry picked from commit 762ba18)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
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.

3 participants