Skip to content

[DevSetting] Replace cinc_version/cinc_installer_url with CliAttributeOverrides which is similar to ExtraChefAttributes#7447

Open
himani2411 wants to merge 2 commits into
aws:developfrom
himani2411:cli-devsetting
Open

[DevSetting] Replace cinc_version/cinc_installer_url with CliAttributeOverrides which is similar to ExtraChefAttributes#7447
himani2411 wants to merge 2 commits into
aws:developfrom
himani2411:cli-devsetting

Conversation

@himani2411

Copy link
Copy Markdown
Contributor

Description of changes

Replace cinc_version/cinc_installer_url with CliAttributeOverrides

  • Model the CLI-side CINC overrides as a single freeform JSON DevSetting (CliAttributeOverrides), mirroring Cookbook.ExtraChefAttributes, instead of two scalar settings. The config exposes cinc_version/cinc_installer_url as read-only accessors that unfurl the blob, so imagebuilder_stack.py and parallelcluster.yaml keep populating CfnParamCincVersion/CfnParamCincInstaller unchanged.

  • Add CliAttributeOverridesValidator for JSON well-formedness (object), with a KNOWN_CLI_ATTRIBUTE_OVERRIDES hook for optional future strict key validation.

  • Add tests which cover CliAttributeOverridesValidator (valid object, empty/None, malformed JSON, non-object array/scalar) and the ImagebuilderDevSettings cinc_version/ cinc_installer_url accessors that unfurl the JSON blob (full, empty, partial, unknown-keys).

  • CincVersion was added [DevSetting] Add CincVersion override to version during imagebuilder #7420

Tests

  • Build Image

References

  • Link to impacted open issues.
  • Link to related PRs in other packages (i.e. cookbook, node).
  • Link to documentation useful to understand the changes.

Checklist

  • Make sure you are pointing to the right branch.
  • If you're creating a patch for a branch other than develop add the branch name as prefix in the PR title (e.g. [release-3.6]).
  • Check all commits' messages are clear, describing what and why vs how.
  • Make sure to have added unit tests or integration tests to cover the new/modified code.
  • Check if documentation is impacted by this change.

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.

@himani2411 himani2411 requested review from a team as code owners June 12, 2026 16:37
@himani2411 himani2411 added skip-changelog-update Disables the check that enforces changelog updates in PRs 3.x labels Jun 12, 2026
# ---------------------- Dev Settings Schema ---------------------- #


class ImagebuilderDevSettingsSchema(BaseDevSettingsSchema):

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NOTE FOR REVIEWER: The cli_attribute_overrides can later be moved to BaseDevSettingsSchema when we add more overrides; since the 2 paramters are related to only Build Image I am keeping it in ImagebuilderDevSettingsSchema

f"Invalid value in {CLI_ATTRIBUTE_OVERRIDES_PATH}: must be a JSON object.",
FailureLevel.ERROR,
)
# TODO: optionally validate keys against KNOWN_CLI_ATTRIBUTE_OVERRIDES here.

@himani2411 himani2411 Jun 12, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NOTE FOR REVIEWER: Keeping this as a future improvement since we do not validate all JSON content for ExtraChefAttributes as of today and the cinc attributes that I am replacing also do no have any validators. Any un-related attribute apart from the cinc* one's in the JSON will be a no-op.

Comment thread cli/src/pcluster/validators/dev_settings_validators.py Outdated
self.distribution_configuration = distribution_configuration
self.terminate_instance_on_failure = Resource.init_param(terminate_instance_on_failure, default=True)
self.disable_validate_and_test = Resource.init_param(disable_validate_and_test, default=True)
self.cinc_installer_url = Resource.init_param(cinc_installer_url, default="")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing this parameter from DevSettings schema is ok because we do not guarantee backward compatibility for DevSettings by definition. However, I suggest to document the removal in the changelog. the fact that we do not guarantee backward compatibility means it is ok to make this change, but does not mean we should not surface it.

@himani2411 himani2411 Jun 12, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IF we never surface the addition of DevSettings in chnagelog; why should we surface their removal?

I propose we do not add this as part of changelog since we never document its existence.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The point of a changelog entry is to introduce opportunities and anticipate problems.
Even if we have never advertised the param in our changelog, nothing prevents a user from using it.
Such user will face an error. Such error cannot be considered a breaking of a contract because it is an unofficial param, but still the entry will allow the user to avoid/motivate the failure.

If you disagree with that I understand because we are on a gray area.
In this case I suggest to let our PM have a call on this.

Himani Anil Deshpande added 2 commits June 17, 2026 09:27
…eOverrides JSON

* Model the CLI-side CINC overrides as a single freeform JSON DevSetting
(CliAttributeOverrides), mirroring Cookbook.ExtraChefAttributes, instead of two
scalar settings. The config exposes cinc_version/cinc_installer_url as read-only
accessors that unfurl the blob, so imagebuilder_stack.py and parallelcluster.yaml
keep populating CfnParamCincVersion/CfnParamCincInstaller unchanged.

* Add CliAttributeOverridesValidator for JSON well-formedness (object), with a
KNOWN_CLI_ATTRIBUTE_OVERRIDES hook for optional future strict key validation.

* Add tests which cover CliAttributeOverridesValidator (valid object, empty/None, malformed JSON,
non-object array/scalar) and the ImagebuilderDevSettings cinc_version/
cinc_installer_url accessors that unfurl the JSON blob (full, empty, partial,
unknown-keys).
… cluster all-validators check

test_slurm_all_validators_are_called asserts every dev_settings validator
fires during cluster validation. CliAttributeOverridesValidator is registered
only on the image-builder config, so skip it like the other non-cluster validators.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3.x skip-changelog-update Disables the check that enforces changelog updates in PRs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants