nise bosh in action

23
Nise BOSH In Action Iwasaki Yudai @i_yudai NTT Software Innovation Center 2013-04-26

Upload: iyudai

Post on 08-May-2015

2.626 views

Category:

Technology


2 download

TRANSCRIPT

Page 1: Nise BOSH in Action

Nise BOSH In Action

Iwasaki Yudai @i_yudaiNTT Software Innovation Center2013-04-26

Page 2: Nise BOSH in Action

Installing cf-release jobs with Nise

BOSH–What’s cf-release?–What’s Nise BOSH?–How to use

DEA/NG and CCv1 compatibility–How to revert BuildPack support

Agenda

Page 3: Nise BOSH in Action

Installing cf-release jobs with Nise BOSH

Page 4: Nise BOSH in Action

Preconfigured CF source code set– For installation with BOSH– Well-tested by many users– Portable

• Minimum dependencies on apt packages• Including mysqlclient, imagemagick and so on...

What’s cf-release?

Page 5: Nise BOSH in Action

Tool chain for distributed systems–Release engineering– Lifecycle management–Works with IaaS layers (CPI)• AWS, vSphere, vCloud and OpenStack

What’s BOSH?

(c) EMC & VMwarehttp://docs.cloudfoundry.com/docs/running/bosh/

Page 6: Nise BOSH in Action

Photo by yeowatzup from http://www.flickr.com/photos/yeowatzup/173818958/

Heavybut worth trying

Page 7: Nise BOSH in Action

A lightweight BOSH (nearly)

emulator–Works on a local machine –Without any CPI

What’s Nise BOSH

https://github.com/nttlabs/nise_bosh

Page 8: Nise BOSH in Action

./bin/init– Stemcell-like environment builder

./bin/nise-bosh– Package installer

./bin/run-job– Job launcher

Main Three Scripts

VM

Stemcell

dea_next (Job template)

common(Package

)

dea_next(Package

)

ruby(Package

)

Agent

Page 9: Nise BOSH in Action

Sets up Stemcell-like environment– Installs apt packages, create users and so

on...

Ported from Stemcell Builder stages– https://github.com/cloudfoundry/bosh/tree/master/

stemcell_builder/

./bin/init

Stemcell ≈ OS + bosh_agent + α

= Basic VM imageVM

Stemcell

dea_next (Job template)

common(Package

)

dea_next(Package

)

ruby(Package

)

Agent

Page 10: Nise BOSH in Action

Installs packages and job

templates– Automatically resolving

dependencies–Running packaging scripts– Filling templates with deploy

manifest

./bin/nise-bosh

Packages:• References to source code• Packaging(installer) scripts

Job templates:• Package list• Configuration file/Control script/monitrc

templates VM

Stemcell

dea_next (Job template)

common(Package

)

dea_next(Package

)

ruby(Package

)

Agent

Page 11: Nise BOSH in Action

Job launcher–Reads monitrc file from job

templates• Resolving task dependencies

– start/stop/status

./bin/run-job

Page 12: Nise BOSH in Action

Entry on Cloud Foundry.com– http://blog.cloudfoundry.com/2013/04/15/ntt-contributes-nise-bosh-a-tool-to-speed-up-bosh-

development/

README.md

How To Use

Page 13: Nise BOSH in Action

Ubuntu 10.04 64bit–Recommended for cf-release

Example: Installing dea_next (1)sudo apt-get install git-core

# Clone Nise BOSH and initialize the environmentgit clone https://github.com/nttlabs/nise_bosh.gitcd nise_boshsudo ./bin/initsudo reboot

# Install ruby with rbenvcd ~git clone git://github.com/sstephenson/rbenv.git ~/.rbenvecho 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bash_profileecho 'eval "$(rbenv init -)"' >> ~/.bash_profileexec $SHELL –lgit clone https://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-buildrbenv install 1.9.3-p327rbenv global 1.9.3-p327

# Install required gemsgem install bundlergem install bosh_clirbenv rehash Ubuntu 10.04 64bit is recommended for cf-

release

Page 14: Nise BOSH in Action

Generating package archives– `bosh craete release` creates pre-

packaged tar files in .dev_builds

Example: Installing dea_next (2)

# Clone cf-releasegit clone https://github.com/cloudfoundry/cf-release.gitcd cf-release./update # check out submodules

# Create release packagesbosh create release –force # give ‘appcloud’ for the prompt

Page 15: Nise BOSH in Action

Deployment manifest–Compatible with BOSH

Example: Install dea_next (3)

vi ~/deploy.conf

---properties: domain: vcap.me

networks: apps: default management: default

nats: user: nats password: nats address: 127.0.0.1 port: 4222

dea_next: streaming_timeout: 60 memory_mb: 4096 memory_overcommit_factor: 1 disk_mb: 32000 disk_overcommit_factor: 1 num_instances: 30

Page 16: Nise BOSH in Action

Installing dea_next job template

Example: Installing dea_next (4)

cd ~/nise_bosh

sudo env PATH=$PATH bundle installsudo env PATH=$PATH bundle exec ./bin/nise-bosh ~/cf-release ~/deploy.conf dea_next

Page 17: Nise BOSH in Action

Launching processes

Example: Installing dea_next (5)

sudo env PATH=$PATH bundle exec ./bin/run-job start

Page 18: Nise BOSH in Action

./bin/nise-bosh has some options– See README.md

Page 19: Nise BOSH in Action

DEA/NG and CCv1 compatibility

Page 20: Nise BOSH in Action

2013-04-26Photo from http://pdphoto.org/PictureDetail.php?mat=pdef&pg=8344

CCv1

DEA/NG

Stager

Impact of Buildpack

Page 21: Nise BOSH in Action

The Commitment

https://github.com/cloudfoundry/dea_ng/commit/169f2c7b9137196f3f6e2dac291417395aeba310

Page 22: Nise BOSH in Action

Rest In Peace CCv1

Page 23: Nise BOSH in Action

Reverted and works– https://github.com/yudai/dea_ng/commit/

ccce77553deff7cfc9b5a6191e12046207a42ced

–Copy runtimes from CCv1•~/cloudfoundry/.deployments• Removed from cf-release• https://github.com/cloudfoundry/cf-release/commit/

82984735556f931caacf010cf7b52a59032c401f

–Disable integrated Stager– Add runtimes in config file

The Return of CCv1