mr-baker

所属分类:快速开发平台
开发工具:Clojure
文件大小:0KB
下载次数:0
上传日期:2015-10-31 11:48:17
上 传 者sh-1993
说明:  贝克先生,AMI制造商。创建并运行打包器模板以构建amazon机器映像,
(Mr-Baker the AMI maker. Creates and runs packer templates to build amazon machine images,)

文件列表:
.midje.clj (44, 2015-02-04)
all (697, 2015-02-04)
project.clj (3850, 2015-02-04)
resources/ (0, 2015-02-04)
resources/logback.xml (2391, 2015-02-04)
scripts/ (0, 2015-02-04)
scripts/bin/ (0, 2015-02-04)
scripts/bin/start.sh (2283, 2015-02-04)
scripts/bin/stop.sh (184, 2015-02-04)
scripts/rpm/ (0, 2015-02-04)
scripts/rpm/postinstall.sh (301, 2015-02-04)
scripts/rpm/postremove.sh (193, 2015-02-04)
scripts/rpm/preinstall.sh (89, 2015-02-04)
scripts/rpm/preremove.sh (980, 2015-02-04)
scripts/service/ (0, 2015-02-04)
scripts/service/baker (1711, 2015-02-04)
src/ (0, 2015-02-04)
src/baker/ (0, 2015-02-04)
src/baker/amis.clj (2394, 2015-02-04)
src/baker/awsclient.clj (6896, 2015-02-04)
src/baker/bake_common.clj (1350, 2015-02-04)
src/baker/builders/ (0, 2015-02-04)
src/baker/builders/bake_example_template.clj (5110, 2015-02-04)
src/baker/builders/routes.clj (665, 2015-02-04)
src/baker/builders/scheduler.clj (638, 2015-02-04)
src/baker/common.clj (708, 2015-02-04)
src/baker/lock.clj (639, 2015-02-04)
src/baker/onix.clj (1628, 2015-02-04)
src/baker/packer.clj (7036, 2015-02-04)
src/baker/scheduler.clj (2847, 2015-02-04)
src/baker/setup.clj (1566, 2015-02-04)
src/baker/web.clj (3211, 2015-02-04)
test/ (0, 2015-02-04)
test/baker/ (0, 2015-02-04)
test/baker/unit/ (0, 2015-02-04)
test/baker/unit/amis.clj (588, 2015-02-04)
test/baker/unit/awsclient.clj (3149, 2015-02-04)
test/baker/unit/bake_common.clj (993, 2015-02-04)
... ...

# Baker - the baking service that cares ## Intro Baker is a clojure web service that acts as a wrapper around [packer](https://github.com/whostolebenfrog/mr-baker/blob/master/packer.io) and allows you to create virtual machine images. In particular baker is aimed at creating AMIs or Amazon Machine Images for use in AWS. Wrapping packer gives us two advantages. Firstly it means that we can generate the templates and perform the bakes (generation of the images) via http calls. Secondly it means that we can control and generate the templates programatically using Clojure code. ## An overview of how we deploy at MixRadio Baker forms part of our deployment infrastructure. For more information see this [blog post](https://github.com/whostolebenfrog/mr-baker/blob/master/http://dev.mixrad.io/blog/2014/10/31/How-we-deploy-at-MixRadio/) ## How to use Baker At MixRadio we use Baker to generate our deployable artifacts. That is we take a base machine image, deploy our services onto them via RPMs and create a machine image. We then deploy these machine images using autoscaling grounds via our deployment service [Maestro](https://github.com/whostolebenfrog/mr-baker/blob/master/github.com/mixradio/maestro). We actually generate our service images in two passes. First we create a base image with common components installed (e.g. puppet, common linux tools etc). Secondly we deploy our services onto this base image. Doing this in two parts saves quite a lot of time as installing everything onto the base image takes a few minutes and only needs to be done once a week. Your actual service templates will be fairly unique to you, as such our actual MixRadio templates aren't listed here. Instead we have two examples of installing an RPM via a packer template. The first uses an amazon-ebs builder which creates a new instance in AWS, and executes commands via SSH to fulfil our template. This is probably the simplest builder. The second uses the chroot-builder which builds the image directly on the box that Baker is running on. This is faster and cheaper but means that Baker must be running in AWS. At MixRadio we use chroot-builders. ## Creating your own templates As you will need to alter code to create templates a namespace has been provided for this purpose, anything in `baker.builders` is safe for you to edit. Templates are registered against http resources in `baker.builders.routes`. The example templates exist in `baker.builders.bake-example-template`. ## Amazon authentication There are two options for authing against AWS, using a key and secret pair or via IAM. If you are running packer in AWS then simply create an IAM profile for the instance Baker is running on and don't set the key and secret. Alternatively create a new pair and add these to the config on the project.clj. ## How to run The simplest way to run is via `lein run` ## More info Look out for a new blog post on [dev.mixrad.io/blog](https://github.com/whostolebenfrog/mr-baker/blob/master/dev.mixrad.io/blog) in the next few weeks with an example of creating a new template. ## Resources ``` GET /healthcheck Performs a healthcheck. 200 OK json response 500 Healthcheck failed json response. GET /ping 200 pong GET /status 200 OK json response 500 Healthcheck failed json response. GET /amis 200 Returns a list of the latest base and public amis. GET /amis/:service-name 200 Returns a list of the 10 latest amis baked for the supplied service name POST /bake/chroot-example/simple-service/1.0.4/hvm 200 Streaming response of packer output, bakes using an example rpm ```

近期下载者

相关文件


收藏者