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

Build both ARM64 and x86-64 AMIs #355

Merged
merged 14 commits into from
Aug 12, 2024

Conversation

jsf9k
Copy link
Member

@jsf9k jsf9k commented Jul 8, 2024

🗣 Description

This pull request modifies the Terraform code to

  • Specify the AMI architecture(s) in a separate filter.
  • Build both an ARM64 and an x86-64 version of the AMI.

💭 Motivation and context

  • Specifying the AMI architecture(s) in a separate filter is a bit more efficient and flexible than relying just on the architecture specified in the AMI name.
  • Building an AMI for each architecture when possible allows us to support AWS Graviton instances.

🧪 Testing

All automated tests pass. I also built staging AMIs with these changes and verified that they functioned as expected.

✅ Pre-approval checklist

  • This PR has an informative and human-readable title.
  • Changes are limited to a single goal - eschew scope creep!
  • All relevant type-of-change labels have been added.
  • I have read the CONTRIBUTING document.
  • These code changes follow cisagov code standards.
  • All new and existing tests pass.
  • Build a staging AMI with these changes.
  • Test the staging AMI by deploying it to our COOL staging environment and verifying that it functions as expected.

✅ Pre-merge checklist

  • Finalize version.
  • Adjust this repo's list of GitHub Actions checks now that two AMIs are being built via a matrix.

✅ Post-merge checklist

  • Create a release.

@jsf9k jsf9k added improvement This issue or pull request will add or improve functionality, maintainability, or ease of use terraform Pull requests that update Terraform code labels Jul 8, 2024
@jsf9k jsf9k self-assigned this Jul 8, 2024
@jsf9k jsf9k marked this pull request as ready for review July 8, 2024 18:46
@jsf9k jsf9k requested a review from a team July 8, 2024 18:46
Copy link
Member

@dav3r dav3r left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@jsf9k jsf9k changed the title Specify architecture(s) as separate filter Specify architecture(s) as separate filters Jul 8, 2024
Copy link
Member

@mcdonnnj mcdonnnj left a comment

Choose a reason for hiding this comment

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

LGTM ✔

@mcdonnnj mcdonnnj added the kraken 🐙 This pull request is ready to merge during the next Lineage Kraken release label Jul 9, 2024
@jsf9k jsf9k force-pushed the improvement/specify-architectures-as-separate-filter branch from be83a8e to 9a35c4f Compare July 10, 2024 04:55
Copy link
Member

@dav3r dav3r left a comment

Choose a reason for hiding this comment

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

Two AMIs for the price of one- that's some 🌶️ 💩 !

@jsf9k jsf9k changed the title Specify architecture(s) as separate filters Build both ARM64 and x86-64 AMIs Jul 10, 2024
@jsf9k jsf9k requested review from mcdonnnj and dv4harr10 July 10, 2024 14:11
@jsf9k
Copy link
Member Author

jsf9k commented Jul 10, 2024

@mcdonnnj - Please re-review this PR, as I believe it addresses the concerns you mentioned in cisagov/debian-packer#63.

@jsf9k jsf9k added version bump This issue or pull request increments the version number github-actions Pull requests that update GitHub Actions code packer Pull requests that update Packer code labels Jul 10, 2024
Copy link
Member

@mcdonnnj mcdonnnj left a comment

Choose a reason for hiding this comment

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

This looks pretty solid to me. Strong work 💪💪💪 I have two small items of feedback for your consideration.

src/packer.pkr.hcl Outdated Show resolved Hide resolved
terraform-post-packer/variables.tf Outdated Show resolved Hide resolved
@jsf9k jsf9k force-pushed the improvement/specify-architectures-as-separate-filter branch from 89421b1 to e0412e7 Compare July 11, 2024 18:57
@jsf9k jsf9k requested a review from mcdonnnj July 11, 2024 19:25
Copy link
Member

@dav3r dav3r left a comment

Choose a reason for hiding this comment

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

Agreed, splitting the historical AMIs is a better solution. 👍

Copy link
Member

@mcdonnnj mcdonnnj left a comment

Choose a reason for hiding this comment

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

Looking even better! I have one item of feedback (in two places) for your consideration, but otherwise this LGTM ✔ Thanks again for separating the historical AMI configuration.

Note

Please add a PR pre-merge item to adjust the required tests since the build job now uses a matrix.

terraform-post-packer/main.tf Show resolved Hide resolved
terraform-post-packer/main.tf Show resolved Hide resolved
terraform-post-packer/main.tf Outdated Show resolved Hide resolved
jsf9k and others added 13 commits August 12, 2024 10:10
This is more flexible than filtering the architecture just based on
the name, particularly since the name filter does not support
full-fledged regexes.
This should make the search more efficient.
This will allow us to build both x86-64 and ARM64 versions of our AMI.
In order that the builds should complete as soon as possible, the
different architectures are built in parallel.
We want to be able to offer both wherever possible.
Also reference issue #369 to consider removing
the moved blocks when they are no longer necessary.
Co-authored-by: David Redmin <[email protected]>
@jsf9k jsf9k force-pushed the improvement/specify-architectures-as-separate-filter branch from e6e6549 to 88528fe Compare August 12, 2024 14:11
@jsf9k jsf9k added this pull request to the merge queue Aug 12, 2024
Merged via the queue into develop with commit d44181d Aug 12, 2024
10 checks passed
@jsf9k jsf9k deleted the improvement/specify-architectures-as-separate-filter branch August 12, 2024 14:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
github-actions Pull requests that update GitHub Actions code improvement This issue or pull request will add or improve functionality, maintainability, or ease of use kraken 🐙 This pull request is ready to merge during the next Lineage Kraken release packer Pull requests that update Packer code terraform Pull requests that update Terraform code version bump This issue or pull request increments the version number
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants