Giter Club home page Giter Club logo

etcd-service-buildpack's Introduction

Buildpack to run Etcd Server

This project is primarily a buildpack to run a Etcd Server; but also includes an internal asset-buildpack for compiling Etcd source into executables.

Currently the buildpack includes etcd 0.3.0.

Demo Usage

Create a new project with a etcd-version file containing either 0.3.0:

mkdir -p /tmp/`whoami`-etcd-service
cd /tmp/`whoami`-etcd-service
echo "0.3.0" > etcd-version

Now deploy to your favourite buildpack-supporting PaaS.

For Cloud Foundry:

cf push `whoami`-etcd-service -b https://github.com/drnic/etcd-service-buildpack.git

And later delete with:

cf delete `whoami`-etcd-service

For Heroku:

git init
git add .
git commit -m "v0.3.0 etcd service"
heroku create `whoami`-etcd-service -b https://github.com/drnic/etcd-service-buildpack.git
git push heroku master

And later destroy with:

heroku apps:destroy `whoami`-etcd-service --confirm `whoami`-etcd-service

Development

There are two stages of development:

  • Adding & compiling new versions of Etcd
  • Developing the buildpack (bin/compile, bin/detect, bin/release)

For each new version of Etcd supported, the config/slugs file is updated with the accessible URL of the pre-compiled version of etcd.

Adding & compiling new versions of Etcd

Extend the bin/fetch_assets script to fetch the new etcd src asset. Then run it to fetch it (and all other etcd versions):

./bin/fetch_assets

Now modify etcd-compiler/bin/compile for the new version Etcd (in future this will be beautifully automated) in the blobs folder.

To create the pre-compiled slugs:

gem install anvil-cli
anvil build . -b etcd-compiler -p

The last line is the published slug URL.

Now add this into config/slugs so buildpack users will have access to the pre-compiled version of Etcd.

Developing the buildpack

You can also use anvil to do some basic development/test of the buildpack itself (the files bin/compile, bin/detect, bin/release).

anvil build testapp -b . -p
...
https://api.anvilworks.org/slugs/93f4b978-6187-4ce4-affa-64ffea110c14.tgz

The last line will be the slug URL. If you download and unpack it, you will see something like:

$ tree
.
├── Procfile
├── bin
│   ├── configure-and-run
│   ├── fetch_blobs
│   ├── etcd-benchmark
│   ├── etcd-check-aof
│   ├── etcd-check-dump
│   ├── etcd-cli
│   └── etcd-server
├── etc
│   └── etcd.conf
├── etcd-compiler
│   └── bin
│       ├── compile
│       └── detect
└── etcd-version

The etcd-version file comes from the built-in testapp used above. Everything else is included from the buildpack. bin/etcd-server contains the compiled Etcd server.

Run locally

If you're not in Ubuntu 10.04, the use Vagrant:

vagrant box add lucid64 http://files.vagrantup.com/lucid64.box
vagrant init lucid64
vagrant up
vagrant ssh

Inside vagrant:

mkdir /tmp/app
cd /tmp/app
wget https://api.anvilworks.org/slugs/93f4b978-6187-4ce4-affa-64ffea110c14.tgz
tar xfz 93f4b978-6187-4ce4-affa-64ffea110c14.tgz
cat Procfile

Either run the process with foreman/goreman or try manually:

export PORT=5656
bin/etcd -name etcd-test -addr 0.0.0.0:$PORT -peer-addr 0.0.0.0:7001 -data-dir data -snapshot true

Credits

The buildpack portion was based on Based on https://github.com/dpiddy/heroku-buildpack-etcd

etcd-service-buildpack's People

Contributors

drnic avatar

Watchers

James Cloos avatar Fritz G. Batroni avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.