Skip to content

Commit

Permalink
Added step to update the index thread qty
Browse files Browse the repository at this point in the history
Signed-off-by: AWS ParallelCluster user <[email protected]>
  • Loading branch information
AWS ParallelCluster user committed Nov 16, 2023
1 parent 9b313de commit 8b32525
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 17 deletions.
4 changes: 3 additions & 1 deletion benchmarks/perf-tool/okpt/test/steps/factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

from okpt.test.steps.steps import CreateIndexStep, DisableRefreshStep, RefreshIndexStep, DeleteIndexStep, \
TrainModelStep, DeleteModelStep, ForceMergeStep, ClearCacheStep, IngestStep, IngestMultiFieldStep, \
QueryStep, QueryWithFilterStep, GetStatsStep, WarmupStep, MultiProcessQueryStep
QueryStep, QueryWithFilterStep, GetStatsStep, WarmupStep, MultiProcessQueryStep, UpdateIndexThreadQty


def create_step(step_config: StepConfig) -> Step:
Expand Down Expand Up @@ -44,5 +44,7 @@ def create_step(step_config: StepConfig) -> Step:
return WarmupStep(step_config)
elif step_config.step_name == MultiProcessQueryStep.label:
return MultiProcessQueryStep(step_config)
elif step_config.step_name == UpdateIndexThreadQty.label:
return UpdateIndexThreadQty(step_config)

raise ConfigurationError(f'Invalid step {step_config.step_name}')
37 changes: 21 additions & 16 deletions benchmarks/perf-tool/okpt/test/steps/steps.py
Original file line number Diff line number Diff line change
Expand Up @@ -309,28 +309,33 @@ def _get_measures(self) -> List[str]:
return ['took']


# class UpdateIndexThreadQty(OpenSearchStep):
# """See base class."""
class UpdateIndexThreadQty(OpenSearchStep):
"""See base class."""

# label = 'update_index_thread_qty'
label = 'update_index_thread_qty'

# def __init__(self, step_config: StepConfig):
# super().__init__(step_config)
def __init__(self, step_config: StepConfig):
super().__init__(step_config)

# self.thread_qty = parse_int_param('thread_qty', step_config.config,
# {}, None)
self.thread_qty = parse_int_param('thread_qty', step_config.config,
{}, None)

# def _action(self):
# """update the index thread qty
def _action(self):
"""update the index thread qty
# Returns:
# An empty dict
# """
# #self.opensearch
# return {}
Returns:
An empty dict
"""
body = {
"persistent" : {
"knn.algo_param.index_thread_qty" : self.thread_qty
}
}
self.opensearch.cluster.put_settings(body)
return {}

# def _get_measures(self) -> List[str]:
# return ['took']
def _get_measures(self) -> List[str]:
return []


class BaseIngestStep(OpenSearchStep):
Expand Down

0 comments on commit 8b32525

Please sign in to comment.