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

perf: Improve Windows packer examples #4258

Draft
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

iataylor
Copy link

@iataylor iataylor commented Nov 13, 2024

Changes made per the issue here #4248.

  • The SSH packer provisioner is much more reliable, and much quicker, than the WinRM provisioner originally used.
  • The disk size should be increased from 30 -> 100 gigs by default for Windows instances, as we fill most of that space just by creating the image with basic dependencies.
  • Adding AWS account variable for the ami_users parameter for amazon-ebs module.
  • Changing the way we install chocolatey and the cloudwatch-agent from Invoke-WebRequest to System.Net.WebClient due to slowness issues during builds with the former.
  • Removing InitializeInstance in Windows Server 2022. Not appropriate for Server 2022 (only 2016 and 2019), so I pulled it out. Not necessary either, as my runners run totally fine without it.

That should be most of it.

@iataylor iataylor changed the title Improve Windows packer examples perf: Improve Windows packer examples Nov 13, 2024
variable "instance_type" {
description = "The instance type Packer will use for the builder"
type = string
default = "t3a.medium"
default = "c7i-flex.xlarge"
Copy link
Author

Choose a reason for hiding this comment

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

I updated this to a larger instance for better build times. If we'd rather default to smaller in the example, I can replace it.


launch_block_device_mappings {
device_name = "/dev/sda1"
volume_size = 100
Copy link
Author

Choose a reason for hiding this comment

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

We could leave this parameterized. I've just set this to 100 gigs hardcoded.

@iataylor
Copy link
Author

All tests passed locally.

@iataylor iataylor marked this pull request as ready for review November 13, 2024 14:32
@npalm npalm self-requested a review November 15, 2024 15:17
@npalm
Copy link
Member

npalm commented Nov 15, 2024

The CI checks for packer are failing. I will mark the PR as draft. Please feel free to mark it ready for review when you are.

@npalm npalm marked this pull request as draft November 15, 2024 21:11
@stuartp44
Copy link
Collaborator

The CI checks are failing on formatting, just do a packer fmt and it should then actually test the changes @iataylor.

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.

4 participants