• Stars
    star
    166
  • Rank 222,380 (Top 5 %)
  • Language
    Ruby
  • Created over 13 years ago
  • Updated over 10 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Use the same chef to provision Vagrant VMs and EC2 instances

Vagrant-EC2

Deprecated

Everything these scripts do is done much better by the vagrant-aws plugin (which happens to be written by Vagrant's author).

This repository shows how to use the same chef-solo-based provisioning scheme for Vagrant virtual machines and Amazon's EC2. This is useful because you'll be able to test the deployment procedures as you develop within a clean Vagrant machine. Running continuous deployment locally also saves tons of partial instance-hours, which can run into the hundreds of cents (I'm not made of money, people).

These scripts have been tested only on Ubuntu Linux.

Development (local)

Just use Vagrant as you normally would:

cd a_vagrant_machine/
vagrant up
vagrant ssh

Production (EC2)

Start up a new EC2 instance (ami-af7e2eea is a US west coast Ubuntu 10.10 64-bit server)

ec2-run-instances ami-af7e2eea                 \
  --instance-type t1.micro                     \
  --key yournamehere                           \
  --user-data-file bootstrap.sh

find its IP with

ec2-describe-instances

and provision it using the same recipes as the demo Vagrant machine machine by running

./setup.sh <ip address> a_vagrant_machine/

DONE!

Don't forget to turn off your instances when you're finished:

ec2-terminate-instances <i-instance_id>

Converting existing Vagrantfiles

Just add three lines in the provisioning section of your Vagrantfile so it looks like this: Note: fixed problem (tar command does not have --transform option) on MacOS X

config.vm.provision :chef_solo do |chef|

  <your provisioning here>

  require 'json'
  open('dna.json', 'w') do |f|
    chef.json[:run_list] = chef.run_list
    f.write chef.json.to_json
  end
    open('.cookbooks_path.json', 'w') do |f|
    f.puts JSON.generate([chef.cookbooks_path]
                           .flatten
                           .map{|x| x})
  end
end

Setup local machine

On your local machine, you will need the following

  • ec2-api-tools Ubuntu multiverse package (this is not currently in Debian's apt repositories; you'll need to download the Ubuntu .deb package and use dpkg --install)
  • VirtualBox 4
  • Vagrant rubygem; gem install vagrant
  • The lucid32 Vagrant base box; vagrant box add lucid32 http://files.vagrantup.com/lucid32.box. Take a look at the vagrant-ubuntu repository for scripts to make custom Ubuntu-based Vagrant base boxes.

Add to your .bashrc

EC2_PRIVATE_KEY=/path/to/pk-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.pem
EC2_CERT=/path/to/cert-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.pem
EC2_SSH_PRIVATE_KEY=/path/to/pk-yournamehere.pem
JAVA_HOME=/usr/lib/jvm/java-6-sun/
EC2_URL=https://ec2.us-west-1.amazonaws.com

Thanks

This project is sponsored by Keming Labs, a technical design studio specializing in data visualization.

More Repositories

1

c2

Declarative data visualization in Clojure(Script).
JavaScript
643
star
2

cljx

Write a portable codebase targeting Clojure/ClojureScript
Clojure
400
star
3

subform-layout

Embeddable layout engine. Like flexbox, but with fewer concepts, applied uniformly.
190
star
4

reflex

Automatic state propogation in ClojureScript
Clojure
186
star
5

zmq-async

Threadsafe Clojure core.async interface to ZeroMQ
Clojure
167
star
6

sandboxtron

Shell
120
star
7

jetty7-websockets-async

Clojure core.async interface to Jetty7's websockets.
Clojure
107
star
8

cljs-d3

A ClojureScript faรงade for the D3 JavaScript DOM-manipulation library
Clojure
86
star
9

todoFRP

Functional reactive todo lists
JavaScript
81
star
10

singult

JavaScript Hiccup compiler
CoffeeScript
51
star
11

cljs-react-perf

Performance experiments w/ CLJS React libraries and techniques.
Clojure
40
star
12

json-tagged-literals

More palatable JSON serialization
CoffeeScript
40
star
13

c2-demos

Example C2 visualizations and applications
Clojure
37
star
14

svd2zig

Generate Zig API from SVD register definitions.
Zig
33
star
15

clj-liblinear

A Clojure wrapper for LIBLINEAR, a linear support vector machine library
Clojure
28
star
16

cassowary-coffee

CoffeeScript port of the Cassowary linear constraint solver
CoffeeScript
24
star
17

hicada

A cljs hiccup compiler that helps you be deliberate about runtime interpretation.
Clojure
20
star
18

touchtron

Rust touchpad / usb experiments
Rust
16
star
19

clojurescript-compiler-proposal

Request for comments on ClojureScript compiler interface updates
Clojure
14
star
20

cljs-chosen

ClojureScript interface to Harvest's Chosen <select> library
JavaScript
12
star
21

tidy-codebase-starter-kit

Shell
9
star
22

vomnibus

Assortment of useful geographic data, color schemes, &c.
Clojure
8
star
23

vcf

Genetic variant analysis tool.
JavaScript
8
star
24

YALL1

All your sparse bases are belong to us.
Objective-C
8
star
25

lorax

Provably efficient deep learning
Clojure
5
star
26

prote.cs

Compressed sensing based protein fold search
JavaScript
4
star
27

denizen-demo-compojure

Demo Clojure web app using Denizen for user management
Clojure
4
star
28

question-rust-inlining

A question about inlining and match vs lookup tables in Rust.
LLVM
4
star
29

Rliblinear

R interface to LIBLINEAR, a linear support vector machine library
C++
3
star
30

cljs-hiccup-inference

Minimal example repo of a CLJS Hiccup->React compiler w/ type inference
Clojure
3
star
31

question-rust-websocket

Rust
2
star
32

profile-cljs

Wherein I examine ClojureScript performance.
Clojure
2
star
33

splot

Rust
1
star
34

datomic-fuse-AOT

A hellscape of Clojure+Datomic lazy loading errors.
Clojure
1
star
35

eui

Rust
1
star