~patviafore/ubuntu-on-ec2/ec2-publishing-scripts-hirsute

Viewing all changes in revision 367.

  • Committer: Scott Moser
  • Date: 2011-11-17 22:02:30 UTC
  • Revision ID: smoser@ubuntu.com-20111117220230-vqqshsjiad026dnv
utilize 'xc2 ximages' to avoid expensive 'xc2 describe-images'

The describe-images call is heavy both in terms of time and cpu.
As there are more and more images in each EC2 region, the network
bandwidth and returned XML get larger and larger.  This is in addition 
to the fact that the ec2-describe-images java command is already quite 
slow to start.

This change makes use of the 'xc2 ximages' command.
That command fronts 'describe-images', 'register' and 'deregister'
allowing you to basically function on a cache with those commands.

Each script basically does
  export XC2_XIMAGES_CACHE_D=${XC2_XIMAGES_CACHE_D:-"$TMPD/ximgcache"}
and then replaces the 'xc2 describe-images' calls with
'xc2 ximages describe-images' and the caching is then transparent.

This should not cause any issues because the tools largely operate
on only their build-id/name when publishing.

For the cleaning scripts, this could potentially cause problems if
multiple were run concurrently, but we're only generally running 
those once a day.

This should make the 'checking for existing' function take almost
no time at all, as the local cache will be consulted after a single
describe-images in that region is done.

expand all expand all

Show diffs side-by-side

added added

removed removed

Lines of Context: