On Github hugoduncan / pallet-prj-cw-2013
From day one.
One source, many clouds, virtualisation environments.
One source, many deployment environments.
One of the principles in pallet is that you should automate your infrastructure from day 1. Wherever your infrastructure is - local vm, cloud, datacenter. Should allow you to build dev, test, staging and production. Define once, use it everywhere.README.md pallet.clj project.clj src target test
Sits next to your project.clj file.
Checked in with your project
Checkout your project and build a dev environment
Easy to get going
Scales to complex scenarios
pallet.clj gives you a simple way of adding pallet to an application, in a way that scales.
In the project.clj file:
:plugins [[com.palletops/pallet-lein "0.6.0-beta.7"]]
Create a pallet.clj file:
(defproject myproject :phases {:configure (plan-fn (package "postgresql-9.1"))})
$ lein pallet up
lein pallet add-service ec2 aws-ec2 xxxx xxxx
lein pallet --service ec2 up
Use the exact same code.
Can specific cloud specific images.
Split out code into functions
Split out code into re-usable modules
Modules are code artifacts
Modules are crates Crates are source and versionable in source and releases.(defproject myproject :providers {:vmfest {:variants [{:node-spec {:image {:os-family :ubuntu}} :selectors #{:default :ubuntu} ...]} :groups [...])
lein pallet up --selectors ubuntu
lein pallet up --groups db
lein pallet up --phases configure,test
Also explain-plan, better logging, better error reporting, etc.
(require '[my.ns :refer [group1 group2]]) (defproject myproject :groups [group1 group])
pallet/src is on the classpath
(def group1 (group-spec "group1" :phases {:configure (plan-fn (remote-file "f" :content "hello"))} :roles #{:db}))
(def group1 (group-spec...)) (def group1 (group-spec...)) (defproject myproject :groups [group1 group])
lein pallet up --roles db
Will start/stop a node for each group