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

upload-to-gs implementation #726

Open
wants to merge 7 commits into
base: dev
Choose a base branch
from
Open
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
12 changes: 6 additions & 6 deletions cdk/infrastructure/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,8 +240,8 @@
'max_scaling_capacity': 2,
},
'indexing_service': {
'cpu': 512,
'memory_limit_mib': 1024,
'cpu': 256,
'memory_limit_mib': 512,
'min_scaling_capacity': 1,
'max_scaling_capacity': 2,
},
Expand Down Expand Up @@ -305,8 +305,8 @@
'max_scaling_capacity': 2,
},
'indexing_service': {
'cpu': 512,
'memory_limit_mib': 1024,
'cpu': 256,
'memory_limit_mib': 512,
'min_scaling_capacity': 1,
'max_scaling_capacity': 2,
},
Expand Down Expand Up @@ -369,8 +369,8 @@
'max_scaling_capacity': 2,
},
'indexing_service': {
'cpu': 512,
'memory_limit_mib': 1024,
'cpu': 256,
'memory_limit_mib': 512,
'min_scaling_capacity': 1,
'max_scaling_capacity': 2,
},
Expand Down
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