-
Notifications
You must be signed in to change notification settings - Fork 272
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
Fix Windows AMI build failed #1239
Merged
triarius
merged 19 commits into
main
from
pdp-1831-packer-builds-on-windows-fail-bc-docker-requires-a-restart
Oct 17, 2023
Merged
Fix Windows AMI build failed #1239
triarius
merged 19 commits into
main
from
pdp-1831-packer-builds-on-windows-fail-bc-docker-requires-a-restart
Oct 17, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Docker will be tested in the tests
This version was released under the Mozilla Public License 2.0: https://github.com/hashicorp/packer/blob/v1.9.4/LICENSE
The filter was previously selecting Windows Server 2019 w/ MSSQL Enterprise, which costs customers more: $1.876/hr vs $0.376/hr for m6i.xlarge in us-east-1. Furthermore, it is not supported on all instance types, for example m6.large.
It's just enabling containers that needs the restart.
moskyb
approved these changes
Oct 17, 2023
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.
fuck yes, this is so good 👏
triarius
commented
Oct 17, 2023
@@ -26,8 +26,6 @@ steps: | |||
name: ":go: fixperms build" | |||
agents: | |||
queue: "${BUILDKITE_AGENT_META_DATA_QUEUE}" | |||
depends_on: | |||
- "fixperms-tests" |
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.
It's faster if you build and test at the same time
triarius
deleted the
pdp-1831-packer-builds-on-windows-fail-bc-docker-requires-a-restart
branch
October 17, 2023 05:14
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The base AMI seems to have shifted a bit, it was failing to build. After debugging, it was found that the docker installation step required a restart, and the next part of the script (
docker --version
) errored out because of that. Even, then, the installation would not work until the restart was made. Eventually, we found this was because the docker install script check is checking if the windows feature called "Containers" is enabled and otherwise runningAdd-WindowsFeature Containers
This necessitates a restart, and the install script would not install docker until that happened.
So, in this PR, we use the windows-restart provisioner in packer to restart the builder instance after enabling containers and before installing docker. This did not seem to correctly wait for the previous provisioner, so I also added a 10s pause. The image building job takes ~21 min, so a 10s pause should not have a significant impact. The greater concern is if
Add-WindowsFeature Containers
takes longer than 10s. I think this is unlikely, as it just toggles some windows configuration. If it starts becoming a source of build flake, we can look into debugging why the
windows-restart
provisioner is not waiting correctly.Also, I: