Date post: | 08-May-2015 |
Category: |
Technology |
Upload: | iyudai |
View: | 2,624 times |
Download: | 2 times |
Nise BOSH In Action
Iwasaki Yudai @i_yudaiNTT Software Innovation Center2013-04-26
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
Installing cf-release jobs with Nise BOSH
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?
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/
Photo by yeowatzup from http://www.flickr.com/photos/yeowatzup/173818958/
Heavybut worth trying
A lightweight BOSH (nearly)
emulator–Works on a local machine –Without any CPI
What’s Nise BOSH
https://github.com/nttlabs/nise_bosh
./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
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
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
Job launcher–Reads monitrc file from job
templates• Resolving task dependencies
– start/stop/status
./bin/run-job
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
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
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
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
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
Launching processes
Example: Installing dea_next (5)
sudo env PATH=$PATH bundle exec ./bin/run-job start
./bin/nise-bosh has some options– See README.md
DEA/NG and CCv1 compatibility
2013-04-26Photo from http://pdphoto.org/PictureDetail.php?mat=pdef&pg=8344
CCv1
DEA/NG
Stager
Impact of Buildpack
The Commitment
https://github.com/cloudfoundry/dea_ng/commit/169f2c7b9137196f3f6e2dac291417395aeba310
Rest In Peace CCv1
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