bosh-gen is a tool for rapidly developing bosh releases - I have been using it to create bosh releases for rails/ruby, php, python, and several DB backends over the last few months. The new release includes a few new niceities, but the main feature is a recreated 'job' generator. The full change log is at the end.

The new job generator creates jobs in a style that deviates from cf-release & bosh-release. It represents the style of job that I like at the moment - scripts do not have ERb in them, templates are inside subfolders of templates/ rather than a flat file structure, and instead of a "common" package of helper scripts these helpers are generated into the job which allows them to be iterated without requiring package compilation.

Quick tutorial so you can see what it creates for you:

$ bosh-gen new cassandra --s3
$ cd cassandra
$ bosh-gen extract-pkg ../cf-release/packages/dea_jvm7
create packages/dea_jvm7
create packages/dea_jvm7/packaging
create packages/dea_jvm7/spec
create blobs/java/jre-7u4-linux-i586.tar.gz
create blobs/java/jre-7u4-linux-x64.tar.gz
readme Upload blobs with 'bosh upload blobs'

$ mv packages/dea_jvm7 packages/java7
now rename spec packages/java7/spec

$ bosh-gen package cassandra -d java7 -f ~/Downloads/apache-cassandra-1.0.11-bin.tar.gz
create packages/cassandra/packaging
create packages/cassandra/pre_packaging
create blobs/cassandra/apache-cassandra-1.0.11-bin.tar.gz
create packages/cassandra/spec


change packages/cassandra/packaging to:
tar xfv cassandra/apache-cassandra-1.0.11-bin.tar.gz
cp -a apache-cassandra-1.0.11/* $BOSH_INSTALL_TARGET


And now for the new job generator!

$ bosh-gen job cassandra -d java7 cassandra
create jobs/cassandra
create jobs/cassandra/monit
create jobs/cassandra/templates/bin/cassandra_ctl
create jobs/cassandra/templates/bin/monit_debugger
create jobs/cassandra/templates/data/properties.sh.erb
create jobs/cassandra/templates/helpers/ctl_setup.sh
create jobs/cassandra/templates/helpers/ctl_utils.sh
create jobs/cassandra/spec
create examples/cassandra_simple
create examples/cassandra_simple/default.yml


Look at all that goodness!


The monit script uses the bin/monit_debugger to help you debug any glitches in starting/stopping processes.
ctl_setup.sh setups up lots of common folders and env vars.
ctl_utils.sh comes from cf-release's common/utils.sh with some extra helper functions
data/properties.sh.erb is where you extract any <%= properties.cassandra… %> values from the deployment manifest.
bin/cassandra_ctl no longer needs to be an unreadable ERb template! Use the env variables you create in data/properties.sh.erb and normal bash if statements instead of ERb <% if … %> templates.
examples/... is a folder for documenting example, valid deployment manifest properties for the release.



I like this layout of a job's templates, so its nice to now share it via bosh-gen.

PS. You now change "TODO" to "cassandra" in bin/cassandra_ctl and the rest of the tutorial is left to you, dear cassandra lover.


ChangeLog:

## v0.9.0

Major news

* `job` - more powerful initial scripts; templates nested in folders; scripts are much cleaner to read; scripts in bin/ & helpers/ do not have ERb; only data/properties.sh.erb & config/ are for ERb.

Other changes:

* `package` - detects .zip files (in addition to .tar.gz) and includes useful default unpacking script in `packaging`; describe available env vars in `packaging` script
* `manifest` - auto-detects current BOSH UUID
* `extract-pkg` - now a single argument - the path of the source package folder
* `extract-job` - now a single argument - the path of the source job folder





Dr Nic Williams - VP Developer Evangelism
Engine Yard
The Leading Platform as a Service
Mobile: +1 415 860 2185
Skype: nicwilliams
Twitter: @drnic

Search Discussions

  • Dr Nic Williams at Aug 11, 2012 at 4:11 am
    Bonus:

    $ bosh create release --force

    You have some blobs that need to be uploaded:
    new cassandra/apache-cassandra-1.0.11-bin.tar.gz 10.8M
    new java/jre-7u4-linux-i586.tar.gz 32.7M
    new java/jre-7u4-linux-x64.tar.gz 31.3M


    Release version: 0.1-dev
    Release manifest: .../cassandra/dev_releases/cassandra-0.1-dev.yml


    All the specs are setup, ready to build, test, deploy!

    Dr Nic Williams - VP Developer Evangelism
    Engine Yard
    The Leading Platform as a Service
    Mobile: +1 415 860 2185
    Skype: nicwilliams
    Twitter: @drnic

    On Friday, August 10, 2012 at 10:09 PM, Dr Nic Williams wrote:

    bosh-gen is a tool for rapidly developing bosh releases - I have been using it to create bosh releases for rails/ruby, php, python, and several DB backends over the last few months. The new release includes a few new niceities, but the main feature is a recreated 'job' generator. The full change log is at the end.

    The new job generator creates jobs in a style that deviates from cf-release & bosh-release. It represents the style of job that I like at the moment - scripts do not have ERb in them, templates are inside subfolders of templates/ rather than a flat file structure, and instead of a "common" package of helper scripts these helpers are generated into the job which allows them to be iterated without requiring package compilation.

    Quick tutorial so you can see what it creates for you:

    $ bosh-gen new cassandra --s3
    $ cd cassandra
    $ bosh-gen extract-pkg ../cf-release/packages/dea_jvm7
    create packages/dea_jvm7
    create packages/dea_jvm7/packaging
    create packages/dea_jvm7/spec
    create blobs/java/jre-7u4-linux-i586.tar.gz
    create blobs/java/jre-7u4-linux-x64.tar.gz
    readme Upload blobs with 'bosh upload blobs'

    $ mv packages/dea_jvm7 packages/java7
    now rename spec packages/java7/spec

    $ bosh-gen package cassandra -d java7 -f ~/Downloads/apache-cassandra-1.0.11-bin.tar.gz
    create packages/cassandra/packaging
    create packages/cassandra/pre_packaging
    create blobs/cassandra/apache-cassandra-1.0.11-bin.tar.gz
    create packages/cassandra/spec


    change packages/cassandra/packaging to:
    tar xfv cassandra/apache-cassandra-1.0.11-bin.tar.gz
    cp -a apache-cassandra-1.0.11/* $BOSH_INSTALL_TARGET


    And now for the new job generator!

    $ bosh-gen job cassandra -d java7 cassandra
    create jobs/cassandra
    create jobs/cassandra/monit
    create jobs/cassandra/templates/bin/cassandra_ctl
    create jobs/cassandra/templates/bin/monit_debugger
    create jobs/cassandra/templates/data/properties.sh.erb
    create jobs/cassandra/templates/helpers/ctl_setup.sh (http://ctl_setup.sh)
    create jobs/cassandra/templates/helpers/ctl_utils.sh (http://ctl_utils.sh)
    create jobs/cassandra/spec
    create examples/cassandra_simple
    create examples/cassandra_simple/default.yml


    Look at all that goodness!


    The monit script uses the bin/monit_debugger to help you debug any glitches in starting/stopping processes.
    ctl_setup.sh (http://ctl_setup.sh) setups up lots of common folders and env vars.
    ctl_utils.sh (http://ctl_utils.sh) comes from cf-release's common/utils.sh (http://utils.sh) with some extra helper functions
    data/properties.sh.erb is where you extract any <%= properties.cassandra… %> values from the deployment manifest.
    bin/cassandra_ctl no longer needs to be an unreadable ERb template! Use the env variables you create in data/properties.sh.erb and normal bash if statements instead of ERb <% if … %> templates.
    examples/... is a folder for documenting example, valid deployment manifest properties for the release.



    I like this layout of a job's templates, so its nice to now share it via bosh-gen.

    PS. You now change "TODO" to "cassandra" in bin/cassandra_ctl and the rest of the tutorial is left to you, dear cassandra lover.


    ChangeLog:

    ## v0.9.0

    Major news

    * `job` - more powerful initial scripts; templates nested in folders; scripts are much cleaner to read; scripts in bin/ & helpers/ do not have ERb; only data/properties.sh.erb & config/ are for ERb.

    Other changes:

    * `package` - detects .zip files (in addition to .tar.gz) and includes useful default unpacking script in `packaging`; describe available env vars in `packaging` script
    * `manifest` - auto-detects current BOSH UUID
    * `extract-pkg` - now a single argument - the path of the source package folder
    * `extract-job` - now a single argument - the path of the source job folder





    Dr Nic Williams - VP Developer Evangelism
    Engine Yard
    The Leading Platform as a Service
    Mobile: +1 415 860 2185
    Skype: nicwilliams
    Twitter: @drnic

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupbosh-users @
postedAug 11, '12 at 4:09a
activeAug 11, '12 at 4:11a
posts2
users1

1 user in discussion

Dr Nic Williams: 2 posts

People

Translate

site design / logo © 2021 Grokbase