-
Notifications
You must be signed in to change notification settings - Fork 90
[Subnet Prioritization] Support capacity-optimized-prioritized and prioritized Allocation Strategy #671
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
Conversation
…leet call Signed-off-by: Hanxuan Zhang <[email protected]>
Signed-off-by: Hanxuan Zhang <[email protected]>
…rams launching with EnableSingleAvailabilityZone and prioritized|capacity-optimized-prioritized AllocationStrategy Signed-off-by: Hanxuan Zhang <[email protected]>
Signed-off-by: Hanxuan Zhang <[email protected]>
…ity-optimized-prioritized when using EnableSingleAvailabilityZone Signed-off-by: Hanxuan Zhang <[email protected]>
Signed-off-by: Hanxuan Zhang <[email protected]>
Signed-off-by: Hanxuan Zhang <[email protected]>
Signed-off-by: Hanxuan Zhang <[email protected]>
…zed' is used with On-Demand Capacity and 'capacity-optimized-prioritized' is used with Spot Capacity type. Signed-off-by: Hanxuan Zhang <[email protected]>
Signed-off-by: Hanxuan Zhang <[email protected]>
Update the PR description to mention what is no longer relevant |
...estEc2CreateFleetManager/test_evaluate_launch_params/prioritized/expected_launch_params.json
Show resolved
Hide resolved
…rrectly set with prioritized|capacity-optimized-prioritized AllocationStrategy and all_or_nothing ScalingStrategy Signed-off-by: Hanxuan Zhang <[email protected]>
…rrectly set with prioritized|capacity-optimized-prioritized AllocationStrategy and all_or_nothing ScalingStrategy Signed-off-by: Hanxuan Zhang <[email protected]>
Signed-off-by: Hanxuan Zhang <[email protected]>
for subnet_id in subnet_ids: | ||
overrides.update({"InstanceType": instance_type["InstanceType"], "SubnetId": subnet_id}) | ||
if self._uses_subnet_prioritization(): | ||
overrides.update( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[CodeStyle] We could reduce code duplication by defining the common part of the dictionary just once, then add the priority to it if subnet prioritization is enabled.
------ | ||
|
||
**CHANGES** | ||
- Support prioritized and capacity-optimized-prioritized Allocation Strategy |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The change log entry should be more focus on the user experience. Could even simply be "Support new allocation strategies prioritized
and capacity-optimized-prioritized
to take into account the subnet prioritization on scale out."
|
||
def _uses_subnet_prioritization(self): | ||
return ( | ||
self._compute_resource_config.get("AllocationStrategy") == "prioritized" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[CodeStyle] "prioritized", "on-demand", "spot", "capacity-optimized-prioritized" should be defined as constants in an Enum within a common script (see how we did it in cli package: https://github.com/aws/aws-parallelcluster/blob/develop/cli/src/pcluster/config/common.py#L31-L36).
This is a good way to use the code as a way to document supported values, prevent constants to be redefined and potential errors caused by typos.
subnet_ids = self._compute_resource_config.get("Networking", {}).get("SubnetIds", []) | ||
return len(subnet_ids) == 1 | ||
|
||
def _uses_subnet_prioritization(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Tests] We are introducing a new function. We are testing it as part of the unit tests for the upper level function _evaluate_template_overrides
. However, we should always add a specific unit test for every new function and mock its behavior in unit tests for the upper level one. In this way it's easier to decouple behavior and address defects in case of failures.
Description of changes
Tests
References
Checklist
develop
add the branch name as prefix in the PR title (e.g.[release-3.6]
).Please review the guidelines for contributing and Pull Request Instructions.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.