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

Create-Workload Improvements: Write Test Procedures and Operations into Separate Directories and Files #397

Closed
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -115,3 +115,6 @@ recipes/ccr/ccr-target-hosts.json

# Tracker tracks
tracks/

# Visual Studio Code for Contributors
.vscode/
37 changes: 6 additions & 31 deletions osbenchmark/resources/base-workload.json.j2
Original file line number Diff line number Diff line change
Expand Up @@ -22,35 +22,10 @@
]
}{% endfor %}
],
"schedule": [
{
"operation": "delete-index"
},{% raw %}
{
"operation": {
"operation-type": "create-index",
"settings": {{index_settings | default({}) | tojson}}
}
},{% endraw %}
{
"operation": {
"operation-type": "cluster-health",
"index": {{ indices | map(attribute='name') | list | join(',') | tojson }},{% raw %}
"request-params": {
"wait_for_status": "{{cluster_health | default('green')}}",
"wait_for_no_relocating_shards": "true"
},
"retry-until-success": true
}
},
{
"operation": {
"operation-type": "bulk",
"bulk-size": {{bulk_size | default(5000)}},
"ingest-percentage": {{ingest_percentage | default(100)}}
},
"clients": {{bulk_indexing_clients | default(8)}}
},{% endraw -%}
{% block queries %}{% endblock %}
"operations": [
{% raw %}{{ benchmark.collect(parts="operations/*.json") }}{% endraw %}
],
"test_procedures": [
{% raw %}{{ benchmark.collect(parts="test_procedures/*.json") }}{% endraw %}
]
}
}
16 changes: 16 additions & 0 deletions osbenchmark/resources/custom-operations.json.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"name": "index-append",
"operation-type": "bulk",
"bulk-size": {{bulk_size}},
"ingest-percentage": {{ingest_percentage}}
Comment on lines +4 to +5
Copy link
Collaborator

Choose a reason for hiding this comment

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

We should still include the same Jinja defaults as the default-operations.json.j2 file.

},
{
"name": "search",
"operation-type": "search",
"index": {{ indices | map(attribute='name') | list | join(',') | tojson }},
"body": {
"query": {
"match_all": {}
}
}
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

We need to include a way to add custom queries. Some users might use the --custom-queries parameter in OSB and attach a JSON file containing queries they plan to run. We need to add those here dynamically

14 changes: 0 additions & 14 deletions osbenchmark/resources/custom-query-workload.json.j2

This file was deleted.

58 changes: 58 additions & 0 deletions osbenchmark/resources/custom-test-procedures.json.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
{
"name": "append-no-conflicts",
"schedule": [
{
"operation": "delete-index"
},{% raw %}
{
"operation": {
"operation-type": "create-index",
"settings": {{index_settings | tojson}}
}
},{% endraw %}
{
"operation": {
"operation-type": "cluster-health",
"index": {{ indices | map(attribute='name') | list | join(',') | tojson }},{% raw %}
"request-params": {
"wait_for_status": "{{cluster_health}}",
"wait_for_no_relocating_shards": "true"
},
"retry-until-success": true
}
},
{
"operation": "index-append",
{% raw -%}"clients": {{bulk_indexing_clients}},
"ignore-response-error-level": "{{error_level}}"{% endraw -%}
},
{
"name": "refresh-after-index",
"operation": "refresh"
},
{
"name": "search-after-index",
"operation": "search"
},
{% endraw -%}
{%- block queries -%}
{% for query in custom_queries %}
{
"operation":"{{query.name}}",
"warmup-iterations": {{query.warmup_iterations}}}},
"iterations": {{query.iterations}},
{%- if query.target_throughput %}
"target-throughput": {{ query.target_throughput}}
{%- else %}
"target-throughput": {{ query.target_throughput | tojson }}
{%- endif %}
{%-if search_clients is defined and search_clients %}
,"clients": {{ search_clients | tojson}}
{%- endif %}
},{% if not loop.last %},{% endif -%}
{% endfor %}
IanHoang marked this conversation as resolved.
Show resolved Hide resolved
{%- endblock %}
}
]
}

16 changes: 16 additions & 0 deletions osbenchmark/resources/default-operations.json.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"name": "index-append",
"operation-type": "bulk",
IanHoang marked this conversation as resolved.
Show resolved Hide resolved
"bulk-size": {{bulk_size | default(5000)}},
"ingest-percentage": {{ingest_percentage | default(100)}}
},
{
"name": "search",
"operation-type": "search",
"index": {{ indices | map(attribute='name') | list | join(',') | tojson }},
"body": {
"query": {
"match_all": {}
}
}
}
16 changes: 0 additions & 16 deletions osbenchmark/resources/default-query-workload.json.j2

This file was deleted.

41 changes: 41 additions & 0 deletions osbenchmark/resources/default-test-procedures.json.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"name": "append-no-conflicts",
"description": "Indexes the whole document corpus using OpenSearch default settings. We only adjust the number of replicas as we benchmark a single node cluster and Benchmark will only start the benchmark if the cluster turns green. Document ids are unique so all index operations are append only.",
"default": true,
"schedule": [
{
"operation": "delete-index"
},{% raw %}
{
"operation": {
"operation-type": "create-index",
"settings": {{index_settings | default({}) | tojson}}
}
},{% endraw %}
{
"operation": {
"operation-type": "cluster-health",
"index": {{ indices | map(attribute='name') | list | join(',') | tojson }},{% raw %}
"request-params": {
"wait_for_status": "{{cluster_health | default('green')}}",
"wait_for_no_relocating_shards": "true"
},
"retry-until-success": true
}
},{% endraw -%}
{
"operation": "index-append",
{% raw -%} "clients": {{bulk_indexing_clients | default(8)}},{% endraw -%}
{% raw -%}"ignore-response-error-level": "{{error_level | default('non-fatal')}}"{% endraw -%}
},
{
"name": "refresh-after-index",
"operation": "refresh"
},
{
"name": "search-after-index",
Copy link
Collaborator

Choose a reason for hiding this comment

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

We should still include basic workload parameters such as warmup-iterations, iterations, target-throughput, and `clients. See https://github.com/rishabh6788/opensearch-benchmark-workloads/blob/main/http_logs/test_procedures/default.json#L60-L71 for reference. Doesn't have to be identical to this since we're trying to consolidate this format, as seen in this issue opensearch-project/opensearch-benchmark-workloads#120

"operation": "search"
}
]
}

Loading
Loading