EC2Test/Image

Not logged in - Log In / Register

Revision 6 as of 2010-02-01 19:26:21

Clear message

This page is documentation for updaters of the EC2 test image.

The EC2Test utility uses a special AMI to run the tests on. This image has all the dependencies pre-installed that are needed to run the Launchpad test suite. From time to time this image may need to be updated.

Why update the ec2test image?

A common reason for updating the image is that the launchpad-dependencies have changed and are needed for new branches to successfully pass the test suite. Once the updated dependencies have been uploaded to the LaunchpadPpa, the image needs to be updated to include the latest version.

Other reasons?

How to update the ec2test image

Here are the notes about what I had to do to accomplish this.

Be or become the right person

The file lib/devscripts/ec2test/account.py contains a list VALID_AMI_OWNERS. You must either be one of those persons or add your account to the list. I am not sure if there should be some policy around who should be on that list. Only images from these account will be used by the ec2test script. By adding your account to a branch of yours, you can use your own private images, obviously, but nobody else can until this branch has been merged.

You also need to add the file ~/.ec2/aws_user which contains your account id. In addition, you need to create a private key and X.509 certificate on the AWS website and store both files in ~/.ec2.

EC2 API tools

Make sure you have the ec2-api-tools package installed. You will need the ec2-register command from that package (at least).

sudo apt-get install ec2-api-tools

Update the image

The image is created based on a blank Hardy image. The name that the script will be looking for is launchpad-ec2testXXX, where XXX is a revision counter that you need to increase when creating a new image. The current value is 114. The script will always use the image with the highest revision number it has access to.

Here is the command line which I ran in a current devel branch. Don't forget to increase the revision number. Also, the base image might change in the future. Please check if this page is up-to-date.

./utilities/ec2 update-image --public launchpad-ec2test114 -m based-on:ami-e6f6158f

The script will run for some time, somewhere between 30-60 minutes. It installs all the dependencies in the base image, creates a new image of the result and uploads and registers it with AWS. The image will be private at first and you will have to set it to public manually to be used by everybody:

ec2-modify-image-attribute $ami --launch-permission -a all

Remember that your account must be in VALID_AMI_OWNERS for the script to actually use it.

What else?

Update images for PQM and buldbot

No use having your branches pass with the updated image but fail in the buildbot run. When the ec2test image is being updated, request an update of the images for PQM, lpbuildbot, and production by filing an RT with the LOSAs. Tom Haddon says they like to do them all at the same time to have them synchronized.