The following section describes how to setup the AWS infrastructure for using the Arm Virtual Hardware Amazon Machine Image (AMI). Using a template file creates the setup that is for example required to run Arm Virtual Hardware with a GitHub-hosted Runner.
- Use your AWS account
- Subscribe Arm Virtual Hardware
The Arm-AVH-CloudFormation-Template.yaml
is an AWS CloudFormation template that creates the following AWS infrastructure items:
- One S3 Bucket (to store temporary files)
- One EC2 Security Group (to be associated with the EC2 instances)
- One IAM User and Access Keys (to limit access rights in the AWS)
- One IAM Role (to be associated with the EC2 Instances)
- S3BucketName that identifies the S3 Bucket.
- VpcId to be associated with the EC2 Security Group.
Resources to be used with Arm AVH AMI (see below in step 12).
-
Download the file
Arm-AVH-CloudFormation-Template.yaml
to your computer. -
Sign in with your AWS account on aws.amazon.com to open the AWS Management Console page.
-
Type
Cloudformation
in the search and proceed to the corresponding AWS service page. -
Click the Create stack button.
-
Select Template is ready option, and then Upload a template file.
-
With the Choose file button select the file
Arm-AVH-CloudFormation-Template.yaml
downloaded in step 1. -
Click Next.
- Specify stack details as follows:
- Stack name: use any name, for example
Arm-AVH-Stack
. - S3BucketName: shall have only small letters and numbers and be unique across AWS, as otherwise stack creation will fail later.
- Vpcid: provide VPC ID for your target region. This can be found in VPC AWS service.
- Stack name: use any name, for example
-
On Configure stack options page keep default values and press Next.
-
On Review page:
- Acknowledge that a new AWS IAM User and AWS IAM AccessKey will be created.
- Press Create stack.
- The infrastructure described in the template file will be provisioned. In Events tab you can follow the creation process. Use refresh button if the page does not get updated automatically. After a few minutes, the stack creation should be successfully completed.
- Go to the created stack and in the Output tab, find the values for the parameters needed for using an Arm Virtual Hardware AMI:
AVHEC2SecurityGroupId
: the name of created EC2 security group.AVHS3BucketName
: the name of created S3 bucket. It has the same value as provided in step 8.AVHIAMProfile
: the name of created IAM Instance Profile.AVHAccessKeyId
: the access key id for the IAM User created in the stack.AVHSecretAccessKey
: the secret access key value for theAVHAccessKeyId
. See access key pair for details.
Note that when the cloud stack is not needed anymore CloudFormation service can be also used to easily delete the stack including all the provisioned resources. In this case, it needs to be ensured that the EC2 instance associated with the created EC2 Security Group is terminated before stack delete is started.
The Cloudformation file Arm-AVH-EFS-Setup.yaml
creates a NFS-like EFS Share. It can be mounted to AVH Instances to share content (e.g. Packs).
- Use your AWS account
- Subscribe Arm Virtual Hardware
It requires:
- VpcId
- SubnetId
- VpcId to be associated with the EFS MountPoint
- SubnetId to be associated with the EFS MountPoint
- FileSystem
- MountPoint for each VpcId and SubnetId (single for this template)
- MountTargetSecurityGroup to allow NFS inbound communication
When a new EFS is created and packs need to be stored, then runs a helper script to setup a user pack folder into.
See misc/efs folder (mainly setup_avh_efs_for_packs.sh
file).
The Cloudformation code assumes a single MountTarget SubnetId associated with the EFS. If more than one Subnet mount points is necessary:
- Add more SubnetId inputs as Parameters
- Add more MountPoints as Resources
Or ideally, use Parameter Lists. See Parameters doc
In case of problem installing packs on-demand, there is an option to install packs manually into the EFS packs share.
- It is assumed that you have the pack file(s) locally in your workspace
- AWS CLI is installed
- You have configured a key pair in AWS and you have the private key locally for SSH/SCP connection
- The AWS Keys are exposed (exported) in your local environment
You can use the helper file on misc/efs
folder called install_manual_packs_into_efs.sh
. This is just a template, so it needs some information.
You would need to change some variables before running it, please see the code.
This script basically:
- Creates a new AVH EC2 Instance with the proper EFS configuration (Security Groups, EFS mount, SSH and etc)
- Deletes any local Pack folder
- Mounts EFS packs folder into
~/packs
- Copies your local pack file into EC2's
/tmp
- Installs your local pack into EFS packs by using
cpackget
- Terminates the instance
You can use part of the script just to create a new EC2 instance and then copy and install manually the packs by using SSH and SCP. Feel free to use as it pleases you.