Use of Arm Virtual Hardware (AVH) AMI can be integrated into Jenkins pipelines for automating software builds and tests.
Two approaches can be followed to create and control instances of the AVH AMIs with Jenkins:
Example implementations of both approaches are provided in GetStarted example and explained in this chapter.
This is a common way to implement Jenkins pipelines on AWS.
A Jenkins Controller uses Amazon EC2 plugin to create an EC2 instance as a Jenkins node from an AVH AMI. Then the Jenkins node gets connected by SSH to the Jenkins Controller and the Jenkins commands are executed directly on the EC2 instance.
The example implementation is available in .jenkins/AVH-as-Jenkins-Node/ and consists of the following items:
configuration-as-code/
provides an example of Amazon EC2 plugin code.jobDSL/
contains Jenkins configuration as code to create the AVH Jenkins Job.pipeline/
implements an example pipeline for running AVH AMI as Jenkins Node.Following resources are required on the AWS side:
An AWS Cloudformation template file can be used to create most of the required AWS Resources for AVH AMI, please refer to ./infrastructure/cloudformation/ folder in the GetStarted example.
Following Jenkins plugins are used by the example implementation:
Following Jenkins credentials need to be configured:
AWS_ACCESS_KEY_ID
and AWS_SECRET_ACCESS_KEY
)In this approach, a python module avhclient drives the communication with the AVH AMI. The Jenkins pipeline is just a light-weight front end that uses the AVH Client module, and the actual work is done by an EC2 instance created and controlled with the commands from the avhclient built on top of AWS SDK.
This approach is simpler to implement but the capabilities are limited by the functionality of the avhclient.
The example implementation using Jenkins with avhclient is available in .jenkins/Using-AVH-Module/ and consists of the following items:
jobDSL/
contains Jenkins configuration as code to create the AVH Jenkins Job.pipeline/
implements an example pipeline for running AVH AMI using avhclient Python Module.Following resources are required on the AWS side:
An AWS CloudFormation template file can be used to create the required AWS resources for AVH AMI. Refer to ./infrastructure/cloudformation/ folder in the GetStarted example.
Following Jenkins plugins are used by the example implementation:
Following Jenkins credentials need to be configured:
AWS_ACCESS_KEY_ID
and AWS_SECRET_ACCESS_KEY
)