Image Builder ============= *Purpose:* * Create a new image by: * Downloading and mounting the base image * Adding the requested PPAs and packages * Repacking the image Deployment ---------- * Can run as a Juju service. * Needs relationship to the Lander and the Data Store. * Operations are transient, no need to save state. * Will need to have some configuration data though, in particular, for Glance credentials * No public access needed. Interactions ------------- * Lander - Get the PPA to use, list of packages, and URL to the base image. Send back the location of the rebuilt image. * PPA - Pull previously built packages to add to the image. * Data Store - Push rebuilt image. For cloud images, this will go to Glance rather than Swift. REST API -------- status ~~~~~~ Return the current status of the image builder and the state of currently running jobs. *Example* :: curl --dump-header - http://localhost:8000/api/v1/imagebuilder/status build_image ~~~~~~~~~~~ Build an image including the requested PPAs and packages. parameters: * ticket_id : STRING * Ticket ID from the ticket system * cancel_url(can be null): a link to json url return {'building': true|false} * base_image : {"image_type": IMAGE_TYPE, "url_list": [...], "series": SERIES} * A json object containing the image_type (cloud for now), list of URLs pointing to the image artifact(s), and the Ubuntu series name. * ppa_list : [...] * A list of PPAs to add to the image. * package_list : [...] * A list of additional packages to install in the image. * progress_trigger : STRING * The amqp exchange to use for sending progress events. *Example* :: curl --dump-header - -H "Content-Type: application/json" -X POST --data '{"base_image": {"image_type": "cloud", "url_list": ["http://cloud-images.ubuntu.com/trusty/current/trusty-server-cloudimg-amd64-disk1.img"], "series": "trusty"}, "ppa_list": ["ppa:project/ppaname"], "package_list": ["libfoo", "baz-utils"], "progress_trigger": "testbuild-1-imagebuilder", "ticket_id": "1", "cancel_url": null}' http://localhost:8000/api/v1/build_image/ Development Plan ---------------- * Define APIs. * Prototype the process. * Rebuild cloud images. * Push to glance. * Support monitoring and progress requests. * Juju deployment support. * Rebuild touch images. * Rebuild cd images.