-
Notifications
You must be signed in to change notification settings - Fork 25
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
Support MacOS13 x64/arm64 Agents Packer Templates on EC2 #459
Merged
peterzhuamazon
merged 9 commits into
opensearch-project:main
from
peterzhuamazon:macos-arm64-host
Jul 15, 2024
Merged
Changes from 8 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
cfc5c8b
Add initial macos13 templates for x64 and arm64
peterzhuamazon cc9179d
Tweak macos server scripts with arm64 support
peterzhuamazon d9d76e2
Add more fixes
peterzhuamazon 7a98900
More changes to enable imdsv2
peterzhuamazon 75802cc
Add missing brewpath for arm64 macOS
peterzhuamazon d165f1b
Support macos arm64 java installation now
peterzhuamazon 4ea2562
Merge remote-tracking branch 'upstream/main' into macos-arm64-host
peterzhuamazon bc896af
Remove extra scripts
peterzhuamazon 73db05e
Merge remote-tracking branch 'upstream/main' into macos-arm64-host
peterzhuamazon File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
export PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:$PATH | ||
export PATH=/opt/local/bin:$PATH | ||
export PATH=/opt/homebrew/bin:/opt/local/bin:$PATH | ||
export PATH=/Users/ec2-user/Library/Python/3.9/bin:/opt/local/Library/Frameworks/Python.framework/Versions/3.9/bin:$PATH | ||
export PATH=/usr/local/opt/grep/libexec/gnubin:$PATH | ||
export PATH=/usr/local/opt/gnu-sed/libexec/gnubin:$PATH |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
{ | ||
"variables": { | ||
"ami_name": "Jenkins-Agent-MacOS13-ARM64-Mac2M2ProMetal", | ||
"os_version": "13.6.7", | ||
"os_architecture": "arm64_mac", | ||
"build-region": "us-east-1", | ||
"build-vpc": "vpc-<>", | ||
"build-subnet": "subnet-<>", | ||
"build-secgrp": "sg-<>", | ||
"build-time": "{{isotime \"2006-01-02T03-04-05Z\"}}", | ||
"aws_ami_region": "us-east-1", | ||
"root_volume_size_gb": "300" | ||
}, | ||
"builders": [ | ||
{ | ||
"name": "{{user `ami_name`}}-{{user `os_version`}}-{{user `build-time`}}", | ||
"ami_description": "{{user `ami_name`}}", | ||
"type": "amazon-ebs", | ||
"encrypt_boot": "false", | ||
"region": "{{user `build-region`}}", | ||
"ami_regions": "{{user `aws_ami_region`}}", | ||
"instance_type": "mac2-m2pro.metal", | ||
"ami_name": "{{user `ami_name`}}-{{user `os_version`}}-{{user `build-time`}}", | ||
"vpc_id": "{{user `build-vpc`}}", | ||
"subnet_id": "{{user `build-subnet`}}", | ||
"aws_polling": { | ||
"delay_seconds": 60, | ||
"max_attempts": 60 | ||
}, | ||
"security_group_ids": "{{user `build-secgrp`}}", | ||
"ssh_interface": "", | ||
"source_ami_filter": { | ||
"filters": { | ||
"virtualization-type": "hvm", | ||
"name": "amzn-ec2-macos-{{user `os_version`}}-*", | ||
"root-device-type": "ebs", | ||
"architecture": "{{user `os_architecture`}}" | ||
}, | ||
"owners": [ | ||
"amazon" | ||
], | ||
"most_recent": true | ||
}, | ||
"associate_public_ip_address": false, | ||
"metadata_options": { | ||
"http_endpoint": "enabled", | ||
"http_tokens": "required", | ||
"http_put_response_hop_limit": 1 | ||
}, | ||
"ssh_username": "ec2-user", | ||
"ssh_timeout": "3h", | ||
"tenancy": "host", | ||
"ebs_optimized": "true", | ||
"tags": { | ||
"Name": "{{user `ami_name`}}-{{user `os_version`}}-{{user `build-time`}}", | ||
"OS_Version": "{{user `os_version`}}", | ||
"User": "Packer", | ||
"Encrypted_AMI": "False", | ||
"Created": "{{user `build-time`}}" | ||
}, | ||
"launch_block_device_mappings": [ | ||
{ | ||
"device_name": "/dev/sda1", | ||
"volume_size": "{{user `root_volume_size_gb`}}", | ||
"delete_on_termination": true, | ||
"volume_type": "gp3" | ||
} | ||
] | ||
} | ||
], | ||
"provisioners": [ | ||
{ | ||
"type": "shell", | ||
"inline": [ | ||
"sudo /usr/local/bin/ec2-macos-init clean --all" | ||
], | ||
"max_retries": 3 | ||
}, | ||
{ | ||
"type": "shell", | ||
"inline": [ | ||
"sudo chsh -s /bin/bash $(whoami)" | ||
], | ||
"max_retries": 3 | ||
}, | ||
{ | ||
"type": "file", | ||
"source": "files/macos/bash_profile", | ||
"destination": "/Users/ec2-user/.bash_profile" | ||
}, | ||
{ | ||
"type": "file", | ||
"source": "files/macos/bashrc", | ||
"destination": "/Users/ec2-user/.bashrc" | ||
}, | ||
{ | ||
"type": "shell", | ||
"scripts": [ | ||
"scripts/macos/macos-agentsetup.sh" | ||
], | ||
"max_retries": 3 | ||
} | ||
] | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
{ | ||
"variables": { | ||
"ami_name": "Jenkins-Agent-MacOS13-X64-Mac1Metal-JDK21", | ||
"os_version": "13.6.7", | ||
"os_architecture": "x86_64_mac", | ||
"build-region": "us-east-1", | ||
"build-vpc": "vpc-<>", | ||
"build-subnet": "subnet-<>", | ||
"build-secgrp": "sg-<>", | ||
"build-time": "{{isotime \"2006-01-02T03-04-05Z\"}}", | ||
"aws_ami_region": "us-east-1", | ||
"root_volume_size_gb": "300" | ||
}, | ||
"builders": [ | ||
{ | ||
"name": "{{user `ami_name`}}-{{user `os_version`}}-{{user `build-time`}}", | ||
"ami_description": "{{user `ami_name`}}", | ||
"type": "amazon-ebs", | ||
"encrypt_boot": "false", | ||
"region": "{{user `build-region`}}", | ||
"ami_regions": "{{user `aws_ami_region`}}", | ||
"instance_type": "mac1.metal", | ||
"ami_name": "{{user `ami_name`}}-{{user `os_version`}}-{{user `build-time`}}", | ||
"vpc_id": "{{user `build-vpc`}}", | ||
"subnet_id": "{{user `build-subnet`}}", | ||
"aws_polling": { | ||
"delay_seconds": 60, | ||
"max_attempts": 60 | ||
}, | ||
"security_group_ids": "{{user `build-secgrp`}}", | ||
"ssh_interface": "", | ||
"source_ami_filter": { | ||
"filters": { | ||
"virtualization-type": "hvm", | ||
"name": "amzn-ec2-macos-{{user `os_version`}}-*", | ||
"root-device-type": "ebs", | ||
"architecture": "{{user `os_architecture`}}" | ||
}, | ||
"owners": [ | ||
"amazon" | ||
], | ||
"most_recent": true | ||
}, | ||
"associate_public_ip_address": false, | ||
"metadata_options": { | ||
"http_endpoint": "enabled", | ||
"http_tokens": "required", | ||
"http_put_response_hop_limit": 1 | ||
}, | ||
"ssh_username": "ec2-user", | ||
"ssh_timeout": "3h", | ||
"tenancy": "host", | ||
"ebs_optimized": "true", | ||
"tags": { | ||
"Name": "{{user `ami_name`}}-{{user `os_version`}}-{{user `build-time`}}", | ||
"OS_Version": "{{user `os_version`}}", | ||
"User": "Packer", | ||
"Encrypted_AMI": "False", | ||
"Created": "{{user `build-time`}}" | ||
}, | ||
"launch_block_device_mappings": [ | ||
{ | ||
"device_name": "/dev/sda1", | ||
"volume_size": "{{user `root_volume_size_gb`}}", | ||
"delete_on_termination": true, | ||
"volume_type": "gp3" | ||
} | ||
] | ||
} | ||
], | ||
"provisioners": [ | ||
{ | ||
"type": "shell", | ||
"inline": [ | ||
"sudo /usr/local/bin/ec2-macos-init clean --all" | ||
], | ||
"max_retries": 3 | ||
}, | ||
{ | ||
"type": "shell", | ||
"inline": [ | ||
"sudo chsh -s /bin/bash $(whoami)" | ||
], | ||
"max_retries": 3 | ||
}, | ||
{ | ||
"type": "file", | ||
"source": "files/macos/bash_profile", | ||
"destination": "/Users/ec2-user/.bash_profile" | ||
}, | ||
{ | ||
"type": "file", | ||
"source": "files/macos/bashrc", | ||
"destination": "/Users/ec2-user/.bashrc" | ||
}, | ||
{ | ||
"type": "shell", | ||
"scripts": [ | ||
"scripts/macos/macos-agentsetup.sh" | ||
], | ||
"max_retries": 3 | ||
} | ||
] | ||
} |
File renamed without changes.
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
Oops, something went wrong.
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.
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.
Since this
bashrc
works for legacyjenkins-agent-macos12-x64.json
, should we move this to legacy folder as well?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.
This also works for the new macos13 that is why I keep it here.
Thanks.