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

IGVF-1334-fix-conflicting-indexing-scalers #723

Merged
merged 4 commits into from
Dec 12, 2023
Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 2 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ repos:
- id: double-quote-string-fixer
- id: trailing-whitespace
- id: end-of-file-fixer
exclude: ^(cdk)/tests/unit/snapshots
- id: pretty-format-json
args: ['--autofix', '--no-sort-keys', '--indent=4', '--no-ensure-ascii']
exclude: ^(cdk)/tests/unit/snapshots
- id: check-yaml
20 changes: 20 additions & 0 deletions cdk/infrastructure/constructs/indexer.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,11 @@ def __init__(
self._define_opensearch()
self._define_docker_assets()
self._define_invalidation_service()
self._remove_cpu_scaling_from_invalidation_service()
self._allow_invalidation_service_to_write_to_invalidation_queue()
self._define_portal_credentials()
self._define_indexing_service()
self._remove_cpu_scaling_from_indexing_service()
self._allow_invalidation_service_to_connect_to_opensearch()
self._allow_indexing_service_to_connect_to_opensearch()
self._add_alarms_to_invalidation_service()
Expand Down Expand Up @@ -177,6 +179,15 @@ def _define_invalidation_service(self) -> None:
),
)

def _remove_cpu_scaling_from_invalidation_service(self) -> None:
self.invalidation_service.service.node.find_child(
'TaskCount'
).node.find_child(
'Target'
).node.try_remove_child(
'CpuScaling'
)

def _allow_invalidation_service_to_write_to_invalidation_queue(self) -> None:
self.props.invalidation_queue.queue.grant_send_messages(
self.invalidation_service.task_definition.task_role
Expand Down Expand Up @@ -226,6 +237,15 @@ def _define_indexing_service(self) -> None:
),
)

def _remove_cpu_scaling_from_indexing_service(self) -> None:
self.indexing_service.service.node.find_child(
'TaskCount'
).node.find_child(
'Target'
).node.try_remove_child(
'CpuScaling'
)

def _allow_invalidation_service_to_connect_to_opensearch(self) -> None:
self.invalidation_service.service.connections.allow_to(
self.opensearch.domain,
Expand Down
1 change: 1 addition & 0 deletions cdk/requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ pytest-instafail==0.4.2
pytest-mock==2.0.0
pytest-cov==2.8.1
mypy==0.950
pytest-snapshot==0.9.0
Loading