Diff for "EC2Test/Image"

Not logged in - Log In / Register

Differences between revisions 17 and 18
Revision 17 as of 2011-02-02 11:48:44
Size: 4442
Comment: clarify ec2 certificate generation
Revision 18 as of 2011-02-02 13:40:22
Size: 4661
Comment:
Deletions are marked like this. Additions are marked like this.
Line 52: Line 52:
 * '''The image will be private at first''' and you will have to set it to public manually to be used by everybody:  * '''The image will be private at first''' and you will have to set it to public manually to be used by everybody.

Run `bin/ec2 images` and look for the ami-XXXXXX for your image in the second column of the output. Replace $ami in the command below with the ID
:
Line 55: Line 57:
ec2-modify-image-attribute $ami --launch-permission -a all ec2-modify-image-attribute $ami --launch-permission -a all -C ~/.ec2/<your certificate file> -K ~/.ec2/<your private key file>

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 bin/ec2. 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 create a file named ~/.ec2/aws_user and put your account ID in there. In addition, you need to create a private key and X.509 certificate on the AWS website - do this by clicking on the "X.509 Certificates" tab, then click "Create a new Certificate". It will give you the opportunity to download the private key and the certificate files, you need to 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 Lucid 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 can be found by running bin/ec2 images. 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.

bin/ec2 update-image --machine based-on:ami-da0cf8b3 --public launchpad-ec2test501

The AMI ID (the bits after based-on:) above is for the official Ubuntu 10.04 LTS (Lucid Lynx) Server 64-bit AMI (found from http://uec-images.ubuntu.com/releases). If you want to build an AMI using a different release, just use its ID there.

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.

A couple of notes:

  • For some reason, you get asked whether you want to continue without installing GRUB when setting up the image. Just say "Yes" and everything should proceed normally.
  • The image will be private at first and you will have to set it to public manually to be used by everybody.

Run bin/ec2 images and look for the ami-XXXXXX for your image in the second column of the output. Replace $ami in the command below with the ID:

ec2-modify-image-attribute $ami --launch-permission -a all -C ~/.ec2/<your certificate file> -K ~/.ec2/<your private key file>

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. Eventually this will not be necessary.

Misc

Some people have experienced problems when the AMI was being setup (bzr timeouts); if that happens, just retry.

EC2Test/Image (last edited 2012-01-06 20:56:41 by gary)