Virtual Hardware  Version 1.3.0 - beta
Infrastructure Service and Tool Integration
Run AMI with Jenkins

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.

Note
Refer to Infrastructure for others ways to use the Arm Virtual Hardware.

Using AVH AMI as a Jenkins node

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.

Implementation example

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.

Dependencies

AWS Account

Following resources are required on the AWS side:

  • Subscription to Arm Virtual Hardware AMI.
  • IAM User with Access Keys for the AWS Account. IAM setup can be found at plugins.jenkins.io/ec2/#plugin-content-iam-setup.
  • EC2 Security Group with Ingress SSH port allowed.
  • SSH Keys to communicate with the EC2 instance as Jenkins Node.
  • Subnet Id needs to be informed with EC2 instance.

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.

Jenkins plugins

Following Jenkins plugins are used by the example implementation:

Jenkins credentials

Following Jenkins credentials need to be configured:

  • AWS Credential for IAM User (AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY)
  • AWS SSH Private Key to be associated with the EC2 instance.

Using AVH Client

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.

Implementation example

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.

Dependencies

AWS Account

Following resources are required on the AWS side:

  • Subscription to Arm Virtual Hardware AMI.
  • IAM User with Access Keys for the AWS Account.
  • IAM Instance Profile to be associated with the AVH EC2 instances.
  • S3 Bucket to store temporary files.
  • EC2 Security Group with Ingress SSH port allowed.
  • [Optional] SSH Key if you would like to debug on EC2.
  • Subnet Id needs to be informed with EC2 instance.

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.

Jenkins plugins

Following Jenkins plugins are used by the example implementation:

Jenkins credentials

Following Jenkins credentials need to be configured:

  • AWS Credential for IAM User (AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY)
  • [Optional] AWS SSH Private Key to be associated with the EC2 instance.