-
Notifications
You must be signed in to change notification settings - Fork 315
[Validators] Add validator ExtraChefAttributesValidator to validate format of ExtraChefAttributes and notify the user about downsides of in_place_update_on_fleet_enabled=False
#7071
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
[Validators] Add validator ExtraChefAttributesValidator to validate format of ExtraChefAttributes and notify the user about downsides of in_place_update_on_fleet_enabled=False
#7071
Conversation
44c9bac to
ca1e0be
Compare
b626d80 to
e2eddd0
Compare
ef8d27a to
65c2979
Compare
ExtraChefAttributesValidator to validate format of ExtraChefAttributes and notify the user about downsides of cfnhup_on_fleet_enabled=FalseExtraChefAttributesValidator to validate format of ExtraChefAttributes and notify the user about downsides of in_place_update_on_fleet_enabled=False
ExtraChefAttributesValidator to validate format of ExtraChefAttributes and notify the user about downsides of in_place_update_on_fleet_enabled=FalseExtraChefAttributesValidator to validate format of ExtraChefAttributes and notify the user about downsides of in_place_update_on_fleet_enabled=False
… DevSettings/Cookbook/ExtraChefAttributes. It fails with an error if the attribute `cluster.in_place_update_on_fleet_enabled` is not a boolean value. It fails with a warning if the attribute `cluster.in_place_update_on_fleet_enabled` is false, notifying the user about the consequences of disabling in-place updates.
65c2979 to
8960cc4
Compare
|
Have we tested this use-case? where we create a cluster with in_place_update_on_fleet_enabled as false and then try to update the cluster to use in_place_update_on_fleet_enabled as true? |
Updates to Added to Q&A section. |
| Returns: | ||
| True if value is "true" or "false" (case-insensitive), False otherwise. | ||
| """ | ||
| return str(value).lower() in BOOLEAN_VALUES |
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.
[Non-blocking] Seems redundant to convert a string to a string
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.
that is to protect against None values.
If you remove the string conversion and pass None as input, the function would throw the error AttributeError: 'NoneType' object has no attribute 'lower'
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.
LGTM!
Description of changes
This PR mitigates the performance degradation reported in #6449
Add validator
ExtraChefAttributesValidatorto warn the user against the consequences of disabling in-place updates through DevSettings, i.e. when the chef attributein_place_update_on_fleet_enabledis set to False.We introduced such new attribute in aws/aws-parallelcluster-cookbook#3040
See that PR for details about what the cookbook does when cfnhup is disabled.
Such attribute takes effect at config time (cluster creation/update, not at build image).
The validator does what follows:
cluster.in_place_update_on_fleet_enabledis a boolean value.cluster.in_place_update_on_fleet_enabledis false, returns a warning to notify the user that disabling cfn-hup has consequences on the cluster update behavior.User Experience
[UseCase 1] in-place updates enabled (implicitly)
By omitting the chef attribute
in_place_update_on_fleet_enabled, cfn-hup is enabled. No warning are returned by the CLI[UseCase 2] in-place updates enabled (explicitly)
By setting
in_place_update_on_fleet_enabledto True, cfn-hup is enabled. No warning are returned by the CLI.Config:
[UseCase 3] in-place updates disabled
When the cluster is created with the following attribute, cluster creation/update succeeds with a warning:
Config:
Warning:
[UseCase 4]: invalid value for the attribute
When the user provides an invalid value for
in_place_update_on_fleet_enabled(i.e.: not boolean), cluster creation/update fails with error.Config:
Error:
[UseCase 5]: invalid value for ExtraChefAttributes
When the user provides an invalid JSON for
ExtraChefAttributes, cluster creation/update fails with a schema validation error (existing logic, mentioning for completeness).Config:
Tests
Q&A
Updates to
ExtraChefAttributeshave never been supported as per update policy hereBy submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.