Skip to content

Commit 3475c06

Browse files
authored
Enhance & Refactor SDG (#895)
Signed-off-by: Ian Hoang <[email protected]>
1 parent 40b512b commit 3475c06

18 files changed

+2187
-1092
lines changed

osbenchmark/benchmark.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
test_execution_orchestrator, results_publisher, \
3939
metrics, workload, exceptions, log
4040
from osbenchmark.builder import provision_config, builder
41-
from osbenchmark.synthetic_data_generator import synthetic_data_generator
41+
from osbenchmark.synthetic_data_generator import synthetic_data_generator_orchestrator
4242
from osbenchmark.workload_generator import workload_generator
4343
from osbenchmark.utils import io, convert, process, console, net, opts, versions
4444
from osbenchmark import aggregator
@@ -174,7 +174,7 @@ def add_workload_source(subparser):
174174
help="Custom Python module that defines how to generate documents. " +
175175
"It can contain function definitions and even class definitions. " +
176176
"This gives users more granular control over how data is generated. " +
177-
"This module must contain generate_fake_document() definition."
177+
"This module must contain generate_synthetic_document() definition."
178178
)
179179

180180
exclusive_params = synthetic_data_generator_parser.add_mutually_exclusive_group(required=True)
@@ -1185,7 +1185,7 @@ def dispatch_sub_command(arg_parser, args, cfg):
11851185
cfg.add(config.Scope.applicationOverride, "synthetic_data_generator", "total_size", args.total_size)
11861186
cfg.add(config.Scope.applicationOverride, "synthetic_data_generator", "test_document", args.test_document)
11871187

1188-
synthetic_data_generator.orchestrate_data_generation(cfg)
1188+
synthetic_data_generator_orchestrator.orchestrate_data_generation(cfg)
11891189

11901190
elif sub_command == "create-workload":
11911191
cfg.add(config.Scope.applicationOverride, "generator", "indices", args.indices)
@@ -1215,13 +1215,13 @@ def dispatch_sub_command(arg_parser, args, cfg):
12151215
else:
12161216
msg += "\n%s%s" % ("\t" * nesting, str(e))
12171217

1218-
console.error("Cannot %s. %s" % (sub_command, msg))
1218+
console.error(f"❌ Cannot {sub_command}. {msg}")
12191219
console.println("")
12201220
print_help_on_errors()
12211221
return False
12221222
except BaseException as e:
12231223
logging.getLogger(__name__).exception("A fatal error occurred while running subcommand [%s].", sub_command)
1224-
console.error("Cannot %s. %s." % (sub_command, e))
1224+
console.error(f"❌ Cannot {sub_command}. {e}.")
12251225
console.println("")
12261226
print_help_on_errors()
12271227
return False
@@ -1272,10 +1272,10 @@ def main():
12721272
end = time.time()
12731273
if success:
12741274
console.println("")
1275-
console.info("SUCCESS (took %d seconds)" % (end - start), overline="-", underline="-")
1275+
console.info("SUCCESS (took %d seconds)" % (end - start), overline="-", underline="-")
12761276
else:
12771277
console.println("")
1278-
console.info("FAILURE (took %d seconds)" % (end - start), overline="-", underline="-")
1278+
console.info("FAILURE (took %d seconds)" % (end - start), overline="-", underline="-")
12791279
sys.exit(64)
12801280

12811281

osbenchmark/resources/sdg-config.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ settings:
33
max_file_size_gb: 40
44
docs_per_chunk: 10000
55

6-
CustomSyntheticDataGenerator:
6+
CustomGenerationValues:
77
# For users who want to generate data via a custom Python module
88
custom_lists:
99
# Custom lists for users who are using a custom Python module and want to consolidate all values in this YAML file
@@ -15,7 +15,7 @@ CustomSyntheticDataGenerator:
1515
- NumericString
1616
- MultipleChoices
1717

18-
MappingSyntheticDataGenerator:
18+
MappingGenerationValues:
1919
# For users who want more granular control over how data is generated when providing an OpenSearch mapping
2020
generator_overrides:
2121
# Overrides all instances of generators with these settings. Specify type and params

osbenchmark/synthetic_data_generator/custom_synthetic_data_generator.py

Lines changed: 0 additions & 251 deletions
This file was deleted.

0 commit comments

Comments
 (0)