Skip to content

Commit

Permalink
Add MacOS Arm64 Agents Setup and AMI IDs
Browse files Browse the repository at this point in the history
Signed-off-by: Peter Zhu <zhujiaxi@amazon.com>
  • Loading branch information
peterzhuamazon committed Jul 17, 2024
1 parent ec91fda commit ed215b6
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 11 deletions.
3 changes: 2 additions & 1 deletion lib/ci-stack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,8 @@ export class CIStack extends Stack {
agentNode.AL2023_X64_BENCHMARK_TEST,
agentNode.UBUNTU2004_X64_GRADLE_CHECK,
agentNode.UBUNTU2004_X64_DOCKER_BUILDER,
agentNode.MACOS12_X64_MULTI_HOST,
agentNode.MACOS13_X64_MULTI_HOST,
agentNode.MACOS13_ARM64_MULTI_HOST,
agentNode.WINDOWS2019_X64_DOCKER_HOST,
agentNode.WINDOWS2019_X64_DOCKER_BUILDER,
agentNode.WINDOWS2019_X64_GRADLE_CHECK,
Expand Down
25 changes: 20 additions & 5 deletions lib/compute/agent-nodes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ export class AgentNodes {

readonly UBUNTU2004_X64_DOCKER_BUILDER: AgentNodeProps;

readonly MACOS12_X64_MULTI_HOST: AgentNodeProps;
readonly MACOS13_X64_MULTI_HOST: AgentNodeProps;

readonly MACOS13_ARM64_MULTI_HOST: AgentNodeProps;

readonly WINDOWS2019_X64_DOCKER_HOST: AgentNodeProps;

Expand Down Expand Up @@ -201,16 +203,29 @@ export class AgentNodes {
+ ' sudo apt-get update -y && (sudo killall -9 apt-get apt 2>&1 || echo) && sudo env "DEBIAN_FRONTEND=noninteractive" apt-get upgrade -y',
remoteFs: '/var/jenkins',
};
this.MACOS12_X64_MULTI_HOST = {
this.MACOS13_X64_MULTI_HOST = {
agentType: 'mac',
customDeviceMapping: '/dev/sda1=:300:true:gp3::encrypted',
workerLabelString: 'Jenkins-Agent-MacOS12-X64-Mac1Metal-Multi-Host',
workerLabelString: 'Jenkins-Agent-MacOS13-X64-Mac1Metal-Multi-Host',
instanceType: 'Mac1Metal',
remoteUser: 'ec2-user',
maxTotalUses: -1,
minimumNumberOfSpareInstances: 1,
numExecutors: 6,
amiId: 'ami-011470caf4b068ba5',
numExecutors: 4,
amiId: 'ami-05a9221f96f21bfb6',
initScript: 'echo',
remoteFs: '/var/jenkins',
};
this.MACOS13_ARM64_MULTI_HOST = {
agentType: 'mac',
customDeviceMapping: '/dev/sda1=:300:true:gp3::encrypted',
workerLabelString: 'Jenkins-Agent-MacOS13-ARM64-Mac2M2proMetal-Multi-Host1',
instanceType: 'Mac2M2proMetal',
remoteUser: 'ec2-user',
maxTotalUses: -1,
minimumNumberOfSpareInstances: 1,
numExecutors: 4,
amiId: 'ami-0931ef2039744bef9',
initScript: 'echo',
remoteFs: '/var/jenkins',
};
Expand Down
4 changes: 2 additions & 2 deletions lib/compute/jenkins-main-node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -239,18 +239,18 @@ export class JenkinsMainNode {
InitPackage.yum('openssl'),
InitPackage.yum('mod_ssl'),
InitPackage.yum('amazon-efs-utils'),
InitCommand.shellCommand('amazon-linux-extras install java-openjdk11 -y'),
InitPackage.yum('docker'),
InitPackage.yum('python3'),
InitPackage.yum('python3-pip.noarch'),
InitPackage.yum('java-11-amazon-corretto'),
InitCommand.shellCommand('pip3 install botocore'),
InitCommand.shellCommand('systemctl enable crond.service'),
InitCommand.shellCommand('systemctl start crond.service'),
// eslint-disable-next-line max-len
InitCommand.shellCommand('sudo wget -nv https://github.com/mikefarah/yq/releases/download/v4.22.1/yq_linux_amd64 -O /usr/bin/yq && sudo chmod +x /usr/bin/yq'),
// eslint-disable-next-line max-len
InitCommand.shellCommand('sudo curl -L https://github.com/docker/compose/releases/download/v2.9.0/docker-compose-$(uname -s)-$(uname -m) -o /usr/bin/docker-compose && sudo chmod +x /usr/bin/docker-compose'),
InitCommand.shellCommand('python3 -m pip install --upgrade pip && python3 -m pip install cryptography boto3 requests-aws4auth'),
InitCommand.shellCommand('pip3 install cryptography boto3 requests-aws4auth'),

InitCommand.shellCommand(httpConfigProps.useSsl
// eslint-disable-next-line max-len
Expand Down
2 changes: 1 addition & 1 deletion packer/jenkins-agent-macos13-arm64.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"variables": {
"ami_name": "Jenkins-Agent-MacOS13-ARM64-Mac2M2ProMetal",
"ami_name": "Jenkins-Agent-MacOS13-ARM64-Mac2M2proMetal",
"os_version": "13.6.7",
"os_architecture": "arm64_mac",
"build-region": "us-east-1",
Expand Down
4 changes: 2 additions & 2 deletions test/compute/jenkins-main-node.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ describe('JenkinsMainNode Config Elements', () => {

// THEN
test('Config elements expected counts', async () => {
expect(configElements.filter((e) => e.elementType === 'COMMAND')).toHaveLength(24);
expect(configElements.filter((e) => e.elementType === 'PACKAGE')).toHaveLength(10);
expect(configElements.filter((e) => e.elementType === 'COMMAND')).toHaveLength(23);
expect(configElements.filter((e) => e.elementType === 'PACKAGE')).toHaveLength(11);
expect(configElements.filter((e) => e.elementType === 'FILE')).toHaveLength(4);
});

Expand Down

0 comments on commit ed215b6

Please sign in to comment.