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

Added an optional kernel parameter test to Packer Build #1929

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

trm109
Copy link

@trm109 trm109 commented Aug 19, 2024

Issue #, if available:
N/A
Description of changes:
In the past, a few users have experienced major issues caused by changing kernel parameters from Amazon Linux upstream that were not caught by amazon-eks-ami maintainers. This PR aims at reducing the risk of releasing breaking changes by comparing the built kernel parameters against the set of 'known good' kernel parameters (in templates/shared/resources/).

  • By default, if there are any changes it will continue the build but issue a warning in the build log. This can be overwritten via make sysctl_test_throw_err=true, causing any differences in the kernel parameters to fail the build.
  • For debugging purposes, this test will also generate and populate the sysctl_logs folder.
  • In order to update the known good kernel parameters, simply cp ./sysctl_logs/* ./templates/shared/resources/
    • The known good logs are 1:1 with the generated results of sysctl_logs, so no further conversion is needed.

There also exists a blacklist (templates/shared/resources/sysctl_blacklist) for kernel parameters that are highly volatile and shouldn't be compared (ex; kernel.random.uuid). This blacklist uses regex and the diff -I flag to ignore certain parameters.

Added functionality to the existing validate.sh to compare the kernel parameters (via a sysctl -a -e output) against the set of 'known good' kernel parameters.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Testing Done

  • Built on every AMI (46/46) including GPU instances.
  • Verified that sysctl_blacklist works as intended and accepts changes.
  • Verified that sysctl_test_throw_err flag works as intended.

See this guide for recommended testing for PRs. Some tests may not apply. Completing tests and providing additional validation steps are not required, but it is recommended and may reduce review time and time to merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants