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

fix arm64 ami build #1621

Merged
merged 2 commits into from
Feb 5, 2024
Merged

fix arm64 ami build #1621

merged 2 commits into from
Feb 5, 2024

Conversation

Issacwww
Copy link
Member

@Issacwww Issacwww commented Feb 2, 2024

Issue #, if available:

Description of changes:
run into the following issue when testing arm64 ami build

> make 1.28 os_distro=al2023 arch=arm64 
---
The architecture 'x86_64' of the specified instance type does not match the architecture 'arm64' of the specified AMI. Specify an instance type and an AMI that have matching architectures, and try again. You can use 'describe-instance-types' or 'describe-images' to discover the architecture of the instance type or AMI.

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
build arm64 ami succeed ami-000353e26e1f56762

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.

Makefile Outdated
@@ -22,7 +22,7 @@ ifeq ($(os_distro), al2023)
AMI_VARIANT := $(AMI_VARIANT)-al2023
endif
ifeq ($(arch), arm64)
instance_type ?= m6g.large
instance_type = m6g.large
Copy link
Member

Choose a reason for hiding this comment

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

What's the reason for this change?

Copy link
Member Author

Choose a reason for hiding this comment

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

instance_type will only been updated if it is not already set when using ?=

thus run into the following error initially

 make 1.28 os_distro=al2023 arch=arm64         

PACKER_ARGS: -var-file templates/al2023/variables-default.json  **-var instance_type='m5.large'** -var arch='arm64'  -var kubernetes_version='1.28.5'

Copy link
Member

Choose a reason for hiding this comment

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

oh but we want to avoid locking in instance_type, any conflicts with this?

ifeq ($(arch), arm64)
	instance_type ?= m6g.large
	AMI_VARIANT := $(AMI_VARIANT)-arm64
else
	instance_type ?= m5.large
endif

Copy link
Member Author

Choose a reason for hiding this comment

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

ah, it would be better, although it has been defaulted to m5.large at line 19 already 😄
will update it in next rev shortly

@Issacwww Issacwww merged commit 4cb5d9e into awslabs:al2023 Feb 5, 2024
9 checks passed
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.

3 participants