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 shorthand alternatives for command line options in OSB #660

Merged
merged 4 commits into from
Oct 23, 2024
Merged
Changes from 2 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
23 changes: 23 additions & 0 deletions osbenchmark/benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ def add_workload_source(subparser):
)
workload_source_group.add_argument(
"--workload-path",
"-wlp",
help="Define the path to a workload.")
subparser.add_argument(
"--workload-revision",
Expand Down Expand Up @@ -157,24 +158,29 @@ def add_workload_source(subparser):
create_workload_parser = subparsers.add_parser("create-workload", help="Create a Benchmark workload from existing data")
create_workload_parser.add_argument(
"--workload",
"-w",
required=True,
help="Name of the generated workload")
create_workload_parser.add_argument(
"--indices",
"-i",
type=non_empty_list,
required=True,
help="Comma-separated list of indices to include in the workload")
create_workload_parser.add_argument(
"--target-hosts",
"-th",
OVI3D0 marked this conversation as resolved.
Show resolved Hide resolved
default="",
required=True,
help="Comma-separated list of host:port pairs which should be targeted")
create_workload_parser.add_argument(
"--client-options",
"-co",
default=opts.ClientOptions.DEFAULT_CLIENT_OPTIONS,
help=f"Comma-separated list of client options to use. (default: {opts.ClientOptions.DEFAULT_CLIENT_OPTIONS})")
create_workload_parser.add_argument(
"--output-path",
"-op",
default=os.path.join(os.getcwd(), "workloads"),
help="Workload output directory (default: workloads/)")
create_workload_parser.add_argument(
Expand All @@ -192,10 +198,12 @@ def add_workload_source(subparser):
compare_parser = subparsers.add_parser("compare", help="Compare two test_executions")
compare_parser.add_argument(
"--baseline",
"-b",
required=True,
help=f"TestExecution ID of the baseline (see {PROGRAM_NAME} list test_executions).")
compare_parser.add_argument(
"--contender",
"-c",
required=True,
help=f"TestExecution ID of the contender (see {PROGRAM_NAME} list test_executions).")
compare_parser.add_argument(
Expand All @@ -205,6 +213,7 @@ def add_workload_source(subparser):
default=metrics.GlobalStatsCalculator.DEFAULT_LATENCY_PERCENTILES)
compare_parser.add_argument(
"--results-format",
"-rfo",
OVI3D0 marked this conversation as resolved.
Show resolved Hide resolved
help="Define the output format for the command line results (default: markdown).",
choices=["markdown", "csv"],
default="markdown")
Expand All @@ -215,6 +224,7 @@ def add_workload_source(subparser):
default="right")
compare_parser.add_argument(
"--results-file",
"-rfi",
help="Write the command line results also to the provided file.",
default="")
compare_parser.add_argument(
Expand Down Expand Up @@ -418,6 +428,7 @@ def add_workload_source(subparser):
for p in [list_parser, test_execution_parser]:
p.add_argument(
"--distribution-version",
"-dv",
type=supported_os_version,
help="Define the version of the OpenSearch distribution to download. "
"Check https://opensearch.org/docs/version-history/ for released versions.",
Expand All @@ -436,10 +447,12 @@ def add_workload_source(subparser):

test_execution_parser.add_argument(
"--test-execution-id",
"-tid",
help="Define a unique id for this test_execution.",
default=str(uuid.uuid4()))
test_execution_parser.add_argument(
"--pipeline",
"-p",
help="Select the pipeline to run.",
# the default will be dynamically derived by
# test_execution_orchestrator based on the
Expand All @@ -455,15 +468,18 @@ def add_workload_source(subparser):
add_workload_source(test_execution_parser)
test_execution_parser.add_argument(
"--workload",
"-w",
help=f"Define the workload to use. List possible workloads with `{PROGRAM_NAME} list workloads`."
)
test_execution_parser.add_argument(
"--workload-params",
"-wp",
help="Define a comma-separated list of key:value pairs that are injected verbatim to the workload as variables.",
default=""
)
test_execution_parser.add_argument(
"--test-procedure",
"-tp",
help=f"Define the test_procedure to use. List possible test_procedures for workloads with `{PROGRAM_NAME} list workloads`.")
test_execution_parser.add_argument(
"--provision-config-instance",
Expand Down Expand Up @@ -492,6 +508,7 @@ def add_workload_source(subparser):
)
test_execution_parser.add_argument(
"--target-hosts",
"-th",
help="Define a comma-separated list of host:port pairs which should be targeted if using the pipeline 'benchmark-only' "
"(default: localhost:9200).",
default="") # actually the default is pipeline specific and it is set later
Expand All @@ -501,6 +518,7 @@ def add_workload_source(subparser):
default="localhost")
test_execution_parser.add_argument(
"--client-options",
"-co",
help=f"Define a comma-separated list of client options to use. The options will be passed to the OpenSearch "
f"Python client (default: {opts.ClientOptions.DEFAULT_CLIENT_OPTIONS}).",
default=opts.ClientOptions.DEFAULT_CLIENT_OPTIONS)
Expand All @@ -526,9 +544,11 @@ def add_workload_source(subparser):
task_filter_group = test_execution_parser.add_mutually_exclusive_group()
task_filter_group.add_argument(
"--include-tasks",
"-it",
help="Defines a comma-separated list of tasks to run. By default all tasks of a test_procedure are run.")
task_filter_group.add_argument(
"--exclude-tasks",
"-et",
help="Defines a comma-separated list of tasks not to run. By default all tasks of a test_procedure are run.")
test_execution_parser.add_argument(
"--user-tag",
Expand All @@ -537,6 +557,7 @@ def add_workload_source(subparser):
default="")
test_execution_parser.add_argument(
"--results-format",
"-rfo",
help="Define the output format for the command line results (default: markdown).",
choices=["markdown", "csv"],
default="markdown")
Expand All @@ -552,6 +573,7 @@ def add_workload_source(subparser):
default="available")
test_execution_parser.add_argument(
"--results-file",
"-rfi",
help="Write the command line results also to the provided file.",
default="")
test_execution_parser.add_argument(
Expand All @@ -576,6 +598,7 @@ def add_workload_source(subparser):
action="store_true")
test_execution_parser.add_argument(
"--kill-running-processes",
"-krp",
OVI3D0 marked this conversation as resolved.
Show resolved Hide resolved
action="store_true",
default=False,
help="If any processes is running, it is going to kill them and allow Benchmark to continue to run."
Expand Down
Loading