Giter Site home page Giter Site logo

bosh-gen's Introduction

Rapid generation of BOSH releases

Generators for creating, updating, and sharing BOSH releases.

The https://bosh.io documentation includes a long guide to explaining BOSH releases and how to create them. The bosh-gen project boosts your speed and guides you towards some newer best practises (e.g. BPM for jobs).

Install

bosh-gen is distributed as a RubyGem:

gem install bosh-gen

Requirements

When you run bosh-gen new to create a new BOSH release it will attempt to create an AWS S3 bucket to store your blobs, vendored packages (language packs), and final releases. You will need a AWS account and appropriate AWS keys.

If you'd like, contact Dr Nic for credentials to the CF Community AWS account.

Creating a new BOSH release

The bosh-gen new [name] subcommand is where you get started. It will create a name-boshrelease folder in your local directory filled with everything to make a working BOSH release (that doesn't do anything):

bosh-gen new my-system

You will be prompted for your AWS credentials. If you have a ~/.fog file, then it will allow you to pick on of those credential pairs. Yes, I should add support for ~/.aws/credentials too. Yes, I should add support for GCP bucket stores too.

A new AWS S3 bucket will be created for you called my-system-boshrelease, and am S3 policy will be attached to make its contents publicly readable to your BOSH release users.

An initial BOSH deployment manifest will be provided that "just works". Try it out:

export BOSH_DEPLOYMENT=my-system
bosh deploy manifests/my-system.yml

This will create/package your BOSH release, upload it to your BOSH environment, and deploy an VM that does nothing.

Task 4525 | 10:56:28 | Creating missing vms: mything/27f862a1-a51b-468d-b3c5-35750eac483a (0) (00:00:15)

You're up and running and can now iterate towards your final BOSH release.

Your initial BOSH release scaffold includes:

  • An initial README.md for your users (please keep this updated with any instructions specific to your release and deployment manifests)
  • 0 packages
  • 1 job called my-system with an empty monit file
  • 1 deployment manifest manifests/my-system.yml with version: create set so that every bosh deploy will always create/upload a new version of your release during initial development
  • Some sample operator files that you or your users might use to deploy your BOSH release
  • config/final.yml describes your public S3 bucket
  • config/private.yml is your local-only private AWS API credentials
  • config/blobs.yml will be updated when you run bosh add-blob to add 3rd-party blobs into your project

BPM

It is assumed that you will be using BOSH Process Manager (BPM) to describe your BOSH jobs, so it has already been included in your deployment manifest. You will have seen it compiled during your initial bosh deploy above:

Task 4525 | 10:55:33 | Compiling packages: bpm-runc/c0b41921c5063378870a7c8867c6dc1aa84e7d85
Task 4525 | 10:55:33 | Compiling packages: golang/65c792cb5cb0ba6526742b1a36e57d1b195fe8be
Task 4525 | 10:55:51 | Compiling packages: bpm-runc/c0b41921c5063378870a7c8867c6dc1aa84e7d85 (00:00:18)
Task 4525 | 10:56:16 | Compiling packages: golang/65c792cb5cb0ba6526742b1a36e57d1b195fe8be (00:00:43)
Task 4525 | 10:56:16 | Compiling packages: bpm/b5e1678ac76dd5653bfa65cb237c0282e083894a (00:00:11)

You can see it included within your manifest's addons: section:

addons:
- name: bpm
  jobs: [{name: bpm, release: bpm}]

It is possible that BPM will become a first-class built-in feature of BOSH environments in the future, and then this addons section can be removed. For now, it is an addon for your deployment manifest. BPM will make your life as a BOSH release developer easier.

Jobs and packages

When you're finished and have a working BOSH release, base deployment manifest (manifests/my-system.yml), and optional operator files (manifests/operators) your BOSH release will include one or more jobs, and one or more packages.

I personally tend to iterate by writing packages first, getting them to compile, and then writing jobs to configure and run the packaged software. So I'll suggest this approach to you.

Writing a package

Helpful commands from bosh-gen:

  • bosh-gen package name - create a packages/name folder with initial spec and packaging file
  • bosh-gen extract-pkg /path/to/release/packages/name - import a package folder from other BOSH release on your local machine, and its blobs and src files.

The bosh CLI also has helpful commands to create/borrow packages:

  • bosh generate-package name - create a packages/name folder with initial spec and packaging file
  • bosh vendor-package name /path/to/release - import the final release of a package from other BOSH release (see blog post), not the source of the package and its blobs.

The bosh CLI also has commands for adding/removing blobs:

  • bosh add-blob
  • bosh remove-blob

Let's create a redis package a few different ways to see the differences.

Vendoring a package from another release

If there is another BOSH release that has a package that you want, consider vendoring it.

There is already a redis-boshrelease with a redis-4 package.

mkdir ~/workspace
git clone https://github.com/cloudfoundry-community/redis-boshrelease ~/workspace/redis-boshrelease

bosh vendor-package redis-4 ~/workspace/redis-boshrelease

This command will download the final release version of the redis-4 package from the redis-boshrelease S3 bucket, and then upload it to your own BOSH release's S3 bucket:

-- Finished downloading 'redis-4/5c3e41...'
Adding package 'redis-4/5c3e41...'...
-- Started uploading 'redis-4/5c3e41...'
2018/04/18 08:18:25 Successfully uploaded file to https://s3.amazonaws.com/my-system-boshrelease/108682c9...
-- Finished uploading 'redis-4/5c3e41...'
Added package 'redis-4/5c3e41...'

It will then reference this uploaded blob with the packages/redis-4/spec.lock file in your BOSH release project folder.

To include the redis-4 package in your deployment, it needs to be referenced by a job.

Change jobs/my-system/spec YAML file's packages section to reference your redis-4 package:

---
name: my-system
packages: [redis-4]
templates:
  ignoreme: ignoreme
properties: {}

Now re-deploy to see your redis-4 package compiled:

bosh deploy manifests/my-system.yml

The output will include:

Task 4550 | 12:24:46 | Compiling packages: redis-4/5c3e41... (00:00:57)

We can bosh ssh into our running my-system instance to confirm that redis-server and redis-cli binaries are available to us:

bosh ssh

Inside the VM, list the binaries that have been installed with our package:

$ ls /var/vcap/packages/redis-4/bin
redis-benchmark  redis-check-aof  redis-check-rdb  redis-cli  redis-sentinel  redis-server

A note in advance for writing our BOSH job, these binaries are not in the normal $PATH location. They are in /var/vcap/packages/redis-4 folder.

Upgrading a vendored package

If you're vendoring another release's package, you will need to keep an eye on updates and to re-vendor them into your release.

Essentially, you will re-clone or update the upstream release locally, and re-run bosh vendor-package:

mkdir ~/workspace
git clone https://github.com/cloudfoundry-community/redis-boshrelease ~/workspace/redis-boshrelease

bosh vendor-package redis-4 ~/workspace/redis-boshrelease

Hard-forking another package

You might like to start with other BOSH release's package and make changes (for example, change the upstream blobs or modify the compilation flags).

The bosh-gen extract-pkg command is very helpful here. It will copy not just the packaging script, but also any blobs or source files from the target BOSH release.

Let's replace our vendored package with a hard fork using bosh-gen extract-pkg:

pushd ~/workspace/redis-boshrelease
bosh sync-blobs
popd

rm -rf packages/redis-4/spec.lock
bosh-gen extract-pkg ~/workspace/redis-boshrelease/packages/redis-4

The output will show that your BOSH release now has its own redis.tgz blob:

       exist  packages/redis-4
      create  packages/redis-4/packaging
       chmod  packages/redis-4/packaging
      create  packages/redis-4/spec
       chmod  packages/redis-4/spec
    add-blob  redis/redis-4.0.9.tar.gz
      readme  Upload blobs with 'bosh upload-blobs'

Your BOSH release now has a packages/redis-4/packaging script to describe how to convert the redis/redis-4.0.9.tar.gz file into the compiled redis-server, redis-cli binaries we saw earlier.

You can now edit packages/redis-4/packaging to modify the make install flags etc if you want.

The redis/redis-4.0.9.tar.gz blob has been copied into the blobs folder:

$ tree blobs
blobs
└── redis
    └── redis-4.0.9.tar.gz

Or you can change the redis/redis-4.0.9.tar.gz blob. Visit http://download.redis.io/releases/ and find a newer release (or older release) and download it.

First, remove the current blob:

bosh remove-blob redis/redis-4.0.9.tar.gz

Next, add the new blob:

bosh add-blob ~/Downloads/redis-4.0.8.tar.gz redis/redis-4.0.8.tar.gz

As early, to create/upload/deploy your new package:

bosh deploy manifests/my-system.yml

So that other developers can access your BOSH releases you need to upload your blobs to your S3 bucket:

bosh upload-blobs

Your uploaded blobs are referenced in config/blobs.yml:

redis/redis-4.0.8.tar.gz:
  size: 1729973
  object_id: 9c954728-d998-459f-7be5-27b8de003b29
  sha: f723b327022cef981b4e1d69c37a8db2faeb0622

Create package from scratch

There is something unique and special about your BOSH release. Probably you have some bespoke software you want to deploy.

There are some core components to a bespoke package:

  • blobs - yet-to-be-compiled or precompiled assets that are cached within your S3 blobstore, rather than inside your BOSH release
  • src - git submodules to your bespoke code repositories
  • packages/name/packaging - bash script to compile and prepare the package for runtime environments; this script is run within a BOSH compilation VM during bosh deploy

If your bespoke software is already being compiled from an internal team, then you can use the bosh remove-blob and bosh add-blob combo discussed in the preceding section.

More commonly, you will include your bespoke project via a git submodule in the src folder, and then delegate the compilation and preparation to your BOSH package's packaging script.

I've written up a blob article/tutorial for submoduling bespoke projects, using language packs (bosh vendor-package), and packaging your bespoke app at https://www.starkandwayne.com/blog/build-bosh-releases-faster-with-language-packs/.

Running things with Jobs

The ultimate goal of your deployment manifest is to describe a set of VMs that have installed software that is configured and running.

A deployment manifest describes a common groups of VMs as an "instance group", which includes one or more jobs from BOSH releases. When you ran bosh-gen new an initial deployment manifest was generated that references a single job:

instance_groups:
- name: my-system
  instances: 1
  jobs:
  - name: my-system
    release: my-system
    properties: {}
  ...

The release: my-system references an uploaded BOSH release that is described at the bottom of the manifest:

releases:
- name: bpm
  version: 1.1.8
  url: git+https://github.com/cloudfoundry/bpm-release
- name: my-system
  version: create
  url: file://.

Later, when you've created your first final BOSH release, you will update this releases: section from version: create to version: 1.0.0 to reference your final release version.

The jobs: [{name: my-system, release: my-system}] reference in the manifest describes the jobs/my-system folder in our BOSH release.

In the initial bosh-gen new scaffold, a relatively empty jobs/my-system folder was provided so that bosh deploy initially works.

The jobs/my-system/monit file describes all running processes for a job. In the initial scaffold generated this file is empty.

We want to add a redis process to our VM, so let's create a redis job.

bosh-gen job redis -d redis-4

The output shows that a config/bpm.yml file is created.

The monit file is now updated to create/monitor a Linux process using BPM:

check process my-system
  with pidfile /var/vcap/sys/run/bpm/my-system/my-system.pid
  start program "/var/vcap/jobs/bpm/bin/bpm start my-system"
  stop program "/var/vcap/jobs/bpm/bin/bpm stop my-system"
  group vcap

bosh-gen's People

Contributors

7hunderbird avatar aristotelesneto avatar cweibel avatar cyrille-leclerc avatar dennisjbell avatar drnic avatar factorypreset avatar frodenas avatar geofffranks avatar jhunt avatar lnguyen avatar qanx avatar quintessence avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bosh-gen's Issues

Tutorial outdated?

I am trying to follow the steps on the tutorial provided in README for setting up a cassandra release however I get stuck at the following step:

bosh-gen extract-pkg ../cf-release/packages/dea_jvm7

There is not directory called dea_jvm7. Could it be called something else?

Trying to install bosh-gen get missing fog-aws 0.1.1, can't gem install it.

fog-aws (0.12.0)

$ gem install bosh-gen
ERROR:  While executing gem ... (Gem::DependencyError)
    Unable to resolve dependencies: bosh-gen requires fog-aws (= 0.1.1)

$ sudo gem install fog-aws 0.1.1
Successfully installed fog-aws-0.12.0
ERROR:  Could not find a valid gem '0.1.1' (>= 0) in any repository

bosh upload blobs

The README does not specify how to configure 'bosh upload release', so it crashes.

.blobs/ looks like it should be in default .gitignore

When following the example in the README, the process fails when trying to create a release after moving Ruby to the blob store. This looks to be because the .blobs directory that is created as the release starts then appears as an uncommitted change. Adding .blobs to the .gitignore file makes this go away, and given the files in it appear to be large binaries, I assume it is meant to be ignored?

$ rm -rf .blobs
$ bosh create release
Syncing blobs...
ruby/ruby-1.9.3-p194.tar.gz downloaded                                          

# On branch master
# Untracked files:
#   (use "git add <file>..." to include in what will be committed)
#
#   .blobs/
nothing added to commit but untracked files present (use "git add" to track)

Your current directory has some local modifications, please discard or commit them first

Cannot install latest bosh-gen

I tried to install latest bosh-gen but it failed.

gem install bosh-gen -v 0.21.1 --no-ri --no-rdoc
ERROR:  While executing gem ... (Gem::DependencyResolutionError)
    conflicting dependencies fog (~> 1.34.0) and fog (~> 1.11)
  Activated fog-1.11.0
  which does not match conflicting dependency (~> 1.34.0)

  Conflicting dependency chains:
    bosh-gen (= 0.21.1), 0.21.1 activated, depends on
    fog (~> 1.11), 1.11.0 activated

  versus:
    bosh-gen (= 0.21.1), 0.21.1 activated, depends on
    bosh_cli (>= 0), 1.3104.0 activated, depends on
    blobstore_client (~> 1.3104.0), 1.3104.0 activated, depends on
    fog (~> 1.34.0)

It seems current version of blobstore_client requires fog '>1.34.0' but bosh-gen requires '> 1.11'
https://github.com/cloudfoundry/bosh/blob/master/blobstore_client/blobstore_client.gemspec#L24

As a workaround, install a bit older version of bosh_cli(1.3094.0) at first and it successfully installed.

$ gem install bosh_cli -v 1.3094.0 --no-ri --no-rdoc
$ gem install bosh-gen -v 0.21.1 --no-ri --no-rdoc

Add "package <name> -f path/to/blob-1.2.3.tgz -v 1.2.3"

Packages don't need to have explicit versions in files. The above example should produce:

  • packages/name/spec
---
name: softhsm
dependencies: []
files:
- softhsm/SoftHSMv2-*.tar.gz
  • packages/name/packaging
...
tar xfv softhsm/SoftHSMv2-*.tar.gz
cd SoftHSMv2-*
./configure --prefix=${BOSH_INSTALL_TARGET}
make -j${CPUS} && make install
# Alternatively, to copy archive contents:
# cp -a SoftHSMv2-*/* $BOSH_INSTALL_TARGET

Set s3 bucket policy on creation

policy:

{
    "Version": "2008-10-17",
    "Statement": [
        {
            "Sid": "AddPerm",
            "Effect": "Allow",
            "Principal": {
                "AWS": "*"
            },
            "Action": "s3:GetObject",
            "Resource": "arn:aws:s3:::NAME-boshrelease/*"
        }
    ]
}

Feedback: packages created from "apt" are hard to use

I use a "GitHub issue" to share this experience: we were very interested in the "apt" approach for packages but it tends to be very hard to use when the installed package define configuration file under /etc/...

For example, we wanted to use the apt approach to install 'fontconfig' and 'ttf-dejavu' for OpenJDK8 and we switched back to the approach based on source code and compilation.

For example, the fc-cache tool of 'fontconfig' did not want to work under /var/vcap/packages/fontconfig/apt/...:

  • couldn't find the required '.so', we had to play with LD_LIBRARY_PATH
  • couldn't find a config file expected under '/etc/...', the param sysroot did not help so I gave up and switched back from apt to src+compilation

As a conclusion, I am convinced that installing native packages with apt is the right way to go but these packages should be installed under their default folder tree and I guess we will have to wait for a docker style approach to do it.

Setting LD_LIBRARY_PATH makes jobs fail on DEA nodes.

Aloha!

Im using bosh-gen to generate a release/job for a check_mk agent for monitoring purposes of our CF installation. The release works like a charm on all the jobs except the DEAs.

In ctl_setup.sh

export LD_LIBRARY_PATH=${LD_LIBRARY_PATH:-''} # default to empty
for package_bin_dir in $(ls -d /var/vcap/packages/*/lib)
do
  export LD_LIBRARY_PATH=${package_bin_dir}:$LD_LIBRARY_PATH
done

On a DEA jobs this will cause issues since the VMs have the rootfs_lucid64 package installed.
On a DEA machine LD_LIBRARY_PATH will end up being /var/vcap/packages/ruby/lib:/var/vcap/packages/rootfs_lucid64/lib:/var/vcap/packages/dea_next/lib

Right after we set the LD_LIBRARY_PATH we continue in the ctl_setup script;

export RUN_DIR=/var/vcap/sys/run/$JOB_NAME
export LOG_DIR=/var/vcap/sys/log/$JOB_NAME
export TMP_DIR=/var/vcap/sys/tmp/$JOB_NAME
export STORE_DIR=/var/vcap/store/$JOB_NAME
for dir in $RUN_DIR $LOG_DIR $TMP_DIR $STORE_DIR
do
  mkdir -p ${dir}
  chown vcap:vcap ${dir}
  chmod 775 ${dir}
done
export TMPDIR=$TMP_DIR

At this point mkdir will fail with a segmentation fault, and thus the bin/JOB_NAME_ctl script used by monit to start the job.

Here are some steps to reproduce the issue (on a DEA node);

$ ldd /bin/mkdir
    linux-vdso.so.1 =>  (0x00007fff4f6df000)
    libselinux.so.1 => /lib/x86_64-linux-gnu/libselinux.so.1 (0x00007fc64eff0000)
    libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fc64ec2a000)
    libpcre.so.3 => /lib/x86_64-linux-gnu/libpcre.so.3 (0x00007fc64e9eb000)
    libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fc64e7e7000)
    /lib64/ld-linux-x86-64.so.2 (0x00007fc64f21c000)

$ export LD_LIBRARY_PATH=/var/vcap/packages/ruby/lib:/var/vcap/packages/rootfs_lucid64/lib:/var/vcap/packages/dea_next/lib

$ mkdir
mkdir: /var/vcap/packages/rootfs_lucid64/lib/libc.so.6: version `GLIBC_2.14' not found (required by mkdir)

# To fix
$ export LD_LIBRARY_PATH=/lib/x86_64-linux-gnu:/var/vcap/packages/ruby/lib:/var/vcap/packages/rootfs_lucid64/lib:/var/vcap/packages/dea_next/lib

$ mkdir
mkdir: missing operand
Try 'mkdir --help' for more information.

Why are we setting the LD_LIBRARY_PATH?

Dependency conflict in 0.18.4

Error message:
$ gem install bosh-gen
ERROR: While executing gem ... (Gem::DependencyResolutionError)
conflicting dependencies net-scp (> 1.0.4) and net-scp (> 1.1)
Activated net-scp-1.1.0 via:
net-scp-1.1.0 (> 1.1), fog-1.11.0 (> 1.11), bosh-gen-0.18.4 (= 0.18.4)
instead of (~> 1.0.4) via:
bosh_cli-0.16 (>= 0), bosh-gen-0.18.4 (= 0.18.4)

It seems that version 0.18.4 has a versioning conflict in regard to net-scp.

BTW: Version 0.16.2 is still working.

Cheers,
Julian W

[new] Random 10.244.X.0 for warden templates

Currently the generated warden templates are guaranteed to conflict with another deployment - they are all 10.244.2.0/30 upwards. Perhaps pick a random 10.244.X.0 starting IP.

make_manifest incorrectly detects CPI on bosh-lite

Hi,

I'm working on a release that requires a CentoOS stemcell. When I set STEMCELL_OS=centos make_manifest fails because it can't find an appropriate stemcell. If I'm not wrong the root cause of this issue is here:

DIRECTOR_CPI=$(echo "$BOSH_STATUS" | grep CPI | awk '{print $2}')

It expects 'bosh status' to return CPI=warden while at least on my environment there is 'cpi' there:
Director
Name Bosh Lite Director
URL https://192.168.50.4:25555
Version 1.3074.0 (00000000)
User admin
UUID 9bca5701-66c0-43ee-a4d0-64813b4b5ece
CPI cpi
dns disabled
compiled_package_cache enabled (provider: local)
snapshots disabled

When I manually set DIRECTOR_CPI=warden everything works well and the right stemcell is uploaded.

Thanks,

Can't create repo

I want to create simple release consisted of apache job + apache package. But see this when I try to init release:

$ bosh-gen new apache                                                            
      create
Auto-detected infrastructure API credentials at ~/.fog (override with $FOG)
/Users/lexsys/.rvm/gems/ruby-2.1.5/gems/cyoi-0.11.2/lib/cyoi/cli/auto_detection/auto_detection_fog.rb:56:in `auto_detection_choices': undefined method `inject' for false:FalseClass (NoMethodError)
    from /Users/lexsys/.rvm/gems/ruby-2.1.5/gems/cyoi-0.11.2/lib/cyoi/cli/auto_detection.rb:41:in `block in aggregated_detector_choices'
    from /Users/lexsys/.rvm/gems/ruby-2.1.5/gems/cyoi-0.11.2/lib/cyoi/cli/auto_detection.rb:39:in `each'
    from /Users/lexsys/.rvm/gems/ruby-2.1.5/gems/cyoi-0.11.2/lib/cyoi/cli/auto_detection.rb:39:in `inject'
    from /Users/lexsys/.rvm/gems/ruby-2.1.5/gems/cyoi-0.11.2/lib/cyoi/cli/auto_detection.rb:39:in `aggregated_detector_choices'
    from /Users/lexsys/.rvm/gems/ruby-2.1.5/gems/cyoi-0.11.2/lib/cyoi/cli/auto_detection.rb:18:in `perform'
    from /Users/lexsys/.rvm/gems/ruby-2.1.5/gems/cyoi-0.11.2/lib/cyoi/cli/provider.rb:57:in `auto_detection'
    from /Users/lexsys/.rvm/gems/ruby-2.1.5/gems/cyoi-0.11.2/lib/cyoi/cli/provider.rb:16:in `execute!'
    from /Users/lexsys/.rvm/gems/ruby-2.1.5/gems/bosh-gen-0.18.4/lib/bosh/gen/generators/new_release_generator.rb:28:in `select_provider'
    from /Users/lexsys/.rvm/gems/ruby-2.1.5/gems/thor-0.19.1/lib/thor/command.rb:27:in `run'
    from /Users/lexsys/.rvm/gems/ruby-2.1.5/gems/thor-0.19.1/lib/thor/invocation.rb:126:in `invoke_command'
    from /Users/lexsys/.rvm/gems/ruby-2.1.5/gems/thor-0.19.1/lib/thor/invocation.rb:133:in `block in invoke_all'
    from /Users/lexsys/.rvm/gems/ruby-2.1.5/gems/thor-0.19.1/lib/thor/invocation.rb:133:in `each'
    from /Users/lexsys/.rvm/gems/ruby-2.1.5/gems/thor-0.19.1/lib/thor/invocation.rb:133:in `map'
    from /Users/lexsys/.rvm/gems/ruby-2.1.5/gems/thor-0.19.1/lib/thor/invocation.rb:133:in `invoke_all'
    from /Users/lexsys/.rvm/gems/ruby-2.1.5/gems/thor-0.19.1/lib/thor/group.rb:232:in `dispatch'
    from /Users/lexsys/.rvm/gems/ruby-2.1.5/gems/thor-0.19.1/lib/thor/base.rb:440:in `start'
    from /Users/lexsys/.rvm/gems/ruby-2.1.5/gems/bosh-gen-0.18.4/lib/bosh/gen/cli.rb:18:in `new'
    from /Users/lexsys/.rvm/gems/ruby-2.1.5/gems/thor-0.19.1/lib/thor/command.rb:27:in `run'
    from /Users/lexsys/.rvm/gems/ruby-2.1.5/gems/thor-0.19.1/lib/thor/invocation.rb:126:in `invoke_command'
    from /Users/lexsys/.rvm/gems/ruby-2.1.5/gems/thor-0.19.1/lib/thor.rb:359:in `dispatch'
    from /Users/lexsys/.rvm/gems/ruby-2.1.5/gems/thor-0.19.1/lib/thor/base.rb:440:in `start'
    from /Users/lexsys/.rvm/gems/ruby-2.1.5/gems/bosh-gen-0.18.4/bin/bosh-gen:7:in `<top (required)>'
    from /Users/lexsys/.rvm/gems/ruby-2.1.5/bin/bosh-gen:23:in `load'
    from /Users/lexsys/.rvm/gems/ruby-2.1.5/bin/bosh-gen:23:in `<main>'
    from /Users/lexsys/.rvm/gems/ruby-2.1.5/bin/ruby_executable_hooks:15:in `eval'
    from /Users/lexsys/.rvm/gems/ruby-2.1.5/bin/ruby_executable_hooks:15:in `<main>'

wait_pid() kills just to root process not its childs as well

Hello,

the wait_pid() function in the ctl_utils.sh is killing just to root process and not the processes started by it. In case the starting script start another script with on its turn starts another and so on, stopping of the root process would not stop all the child processes.

It would be nice if this is extended so the whole tree is killed.

Regards,
Milko

bosh-gem new error

Error when new, the same of AWS or OpenStack or vSphere:
vagrant@bosh-lite:~$ bosh-gen new test
create

  1. AWS
  2. OpenStack
  3. vSphere
    Choose your infrastructure: 3

Using provider vSphere

Username: 1
Password: 1
Server: 1
/var/lib/gems/1.9.1/gems/cyoi-0.11.3/lib/cyoi/cli/providers/provider_cli_vsphere.rb:22:in setup_credentials': undefined local variable or methodh1' for #Cyoi::Cli::Providers::ProviderCliVsphere:0x0000000182ce58 (NameError)
from /var/lib/gems/1.9.1/gems/cyoi-0.11.3/lib/cyoi/cli/providers/provider_cli_vsphere.rb:6:in perform_and_return_attributes' from /var/lib/gems/1.9.1/gems/cyoi-0.11.3/lib/cyoi/cli/provider.rb:18:inexecute!'
from /var/lib/gems/1.9.1/gems/bosh-gen-0.20.1/lib/bosh/gen/generators/new_release_generator.rb:28:in select_provider' from /usr/lib/ruby/vendor_ruby/thor/command.rb:27:inrun'
from /usr/lib/ruby/vendor_ruby/thor/invocation.rb:121:in invoke_command' from /usr/lib/ruby/vendor_ruby/thor/invocation.rb:128:inblock in invoke_all'
from /usr/lib/ruby/vendor_ruby/thor/invocation.rb:128:in each' from /usr/lib/ruby/vendor_ruby/thor/invocation.rb:128:inmap'
from /usr/lib/ruby/vendor_ruby/thor/invocation.rb:128:in invoke_all' from /usr/lib/ruby/vendor_ruby/thor/group.rb:232:indispatch'
from /usr/lib/ruby/vendor_ruby/thor/base.rb:440:in start' from /var/lib/gems/1.9.1/gems/bosh-gen-0.20.1/lib/bosh/gen/cli.rb:18:innew'
from /usr/lib/ruby/vendor_ruby/thor/command.rb:27:in run' from /usr/lib/ruby/vendor_ruby/thor/invocation.rb:121:ininvoke_command'
from /usr/lib/ruby/vendor_ruby/thor.rb:363:in dispatch' from /usr/lib/ruby/vendor_ruby/thor/base.rb:440:instart'
from /var/lib/gems/1.9.1/gems/bosh-gen-0.20.1/bin/bosh-gen:7:in <top (required)>' from /usr/local/bin/bosh-gen:23:inload'
from /usr/local/bin/bosh-gen:23:in `

'

ruby version: ruby 1.9.3p484 (2013-11-22 revision 43786) [x86_64-linux]

ruby gem list:
gem list

*** LOCAL GEMS ***

activesupport (4.2.1)
aws-sdk (1.60.2)
aws-sdk-v1 (1.60.2)
blobstore_client (1.2983.0, 1.2820.0)
bosh-gen (0.20.1)
bosh-template (1.2983.0, 1.2820.0)
bosh_cli (1.2820.0)
bosh_common (1.2983.0, 1.2820.0)
builder (3.2.2)
bundler (1.3.5)
cf-message-bus (0.3.1)
cf-registrar (1.0.3)
cf-uaa-lib (3.2.1)
CFPropertyList (2.3.1)
cyoi (0.11.3)
daemons (1.1.9)
eventmachine (1.0.3)
excon (0.45.3, 0.43.0)
fission (0.5.0)
fluent-logger (0.4.9)
fog (1.27.0, 1.23.0)
fog-atmos (0.1.0)
fog-aws (0.1.1)
fog-brightbox (0.7.1)
fog-core (1.30.0, 1.27.3)
fog-ecloud (0.1.3)
fog-google (0.0.5)
fog-json (1.0.0)
fog-local (0.2.1)
fog-powerdns (0.1.1)
fog-profitbricks (0.0.3)
fog-radosgw (0.0.4)
fog-riakcs (0.1.0)
fog-sakuracloud (1.0.1)
fog-serverlove (0.1.2)
fog-softlayer (0.3.30)
fog-storm_on_demand (0.1.1)
fog-terremark (0.1.0)
fog-vmfusion (0.1.0)
fog-voxel (0.1.0)
fog-xml (0.1.2)
formatador (0.2.5)
highline (1.6.21)
httpclient (2.4.0)
i18n (0.7.0)
inflecto (0.0.2)
ipaddress (0.8.0)
json (1.8.2)
json_pure (1.8.2, 1.8.1)
little-plugger (1.1.3)
log4r (1.1.10)
logging (1.8.2)
mime-types (2.4.3)
mini_portile (0.6.2)
minitar (0.5.4)
minitest (5.7.0)
msgpack (0.5.9)
multi_json (1.10.1)
nats (0.5.0.beta.16, 0.5.0.beta.14)
net-http-persistent (2.9)
net-scp (1.1.2)
net-ssh (2.9.2)
net-ssh-gateway (1.2.0)
netaddr (1.5.0)
nokogiri (1.6.6.1)
progressbar (0.9.2)
rack (1.5.2)
rdoc (3.9.4)
readwritesettings (3.0.1)
ruby-atmos-pure (1.0.5)
ruby-hmac (0.4.0)
semi_semantic (1.1.0)
steno (1.2.4)
terminal-table (1.4.5)
thin (1.6.3, 1.6.2)
thor (0.18.1.20140116)
thread_safe (0.3.5)
tzinfo (1.2.2)
vcap-concurrency (0.1.0)
yajl-ruby (1.2.1)

bosh-lite releases

Is there a way to generate a bosh-lite release? Old blog posts and video demo mentions it but I cannot figure out how to go about it as I am not sure which of the three options (1. AWS 2. OpenStack 3. vSphere) I am supposed to pick when starting new.

package -f blob/blob.tgz didn't work as expected

$ tree blobs
blobs
└── softhsm
    └── SoftHSMv2-2.3.0.tar.gz

$ bosh-gen package softhsm -f softhsm/SoftHSMv2-2.3.0.tar.gz
      create  packages/softhsm/packaging
tar: Error opening archive: Failed to open 'softhsm/SoftHSMv2-2.3.0.tar.gz'
Skipping unknown file /Users/drnic/Projects/bosh_releases/softhsm-boshrelease/softhsm/SoftHSMv2-2.3.0.tar.gz
      create  packages/softhsm/spec

The way that worked was to include blobs/ - but it would be good to support existing blobs

$ bosh-gen package softhsm -f blobs/softhsm/SoftHSMv2-2.3.0.tar.gz

Selecting vSphere as the target results in error

I'm using bosh-gen to create a bosh release and when I select vsphere as the platform I get the following stack strace. It works for AWS.

/Users/jomeara/.rbenv/versions/2.0.0-p645/lib/ruby/gems/2.0.0/gems/cyoi-0.11.3/lib/cyoi/cli/providers/provider_cli_vsphere.rb:22:in `setup_credentials': undefined local variable or method`h1' for #Cyoi::Cli::Providers::ProviderCliVsphere:0x007fa6e2907910 (NameError)
    from /Users/jomeara/.rbenv/versions/2.0.0-p645/lib/ruby/gems/2.0.0/gems/cyoi-0.11.3/lib/cyoi/cli/providers/provider_cli_vsphere.rb:6:in `perform_and_return_attributes'
    from /Users/jomeara/.rbenv/versions/2.0.0-p645/lib/ruby/gems/2.0.0/gems/cyoi-0.11.3/lib/cyoi/cli/provider.rb:18:in`execute!'
    from /Users/jomeara/.rbenv/versions/2.0.0-p645/lib/ruby/gems/2.0.0/gems/bosh-gen-0.22.0/lib/bosh/gen/generators/new_release_generator.rb:28:in `select_provider'
    from /Users/jomeara/.rbenv/versions/2.0.0-p645/lib/ruby/gems/2.0.0/gems/thor-0.19.1/lib/thor/command.rb:27:in`run'
    from /Users/jomeara/.rbenv/versions/2.0.0-p645/lib/ruby/gems/2.0.0/gems/thor-0.19.1/lib/thor/invocation.rb:126:in `invoke_command'
    from /Users/jomeara/.rbenv/versions/2.0.0-p645/lib/ruby/gems/2.0.0/gems/thor-0.19.1/lib/thor/invocation.rb:133:in`block in invoke_all'
    from /Users/jomeara/.rbenv/versions/2.0.0-p645/lib/ruby/gems/2.0.0/gems/thor-0.19.1/lib/thor/invocation.rb:133:in `each'
    from /Users/jomeara/.rbenv/versions/2.0.0-p645/lib/ruby/gems/2.0.0/gems/thor-0.19.1/lib/thor/invocation.rb:133:in`map'
    from /Users/jomeara/.rbenv/versions/2.0.0-p645/lib/ruby/gems/2.0.0/gems/thor-0.19.1/lib/thor/invocation.rb:133:in `invoke_all'
    from /Users/jomeara/.rbenv/versions/2.0.0-p645/lib/ruby/gems/2.0.0/gems/thor-0.19.1/lib/thor/group.rb:232:in`dispatch'
    from /Users/jomeara/.rbenv/versions/2.0.0-p645/lib/ruby/gems/2.0.0/gems/thor-0.19.1/lib/thor/base.rb:440:in `start'
    from /Users/jomeara/.rbenv/versions/2.0.0-p645/lib/ruby/gems/2.0.0/gems/bosh-gen-0.22.0/lib/bosh/gen/cli.rb:18:in`new'
    from /Users/jomeara/.rbenv/versions/2.0.0-p645/lib/ruby/gems/2.0.0/gems/thor-0.19.1/lib/thor/command.rb:27:in `run'
    from /Users/jomeara/.rbenv/versions/2.0.0-p645/lib/ruby/gems/2.0.0/gems/thor-0.19.1/lib/thor/invocation.rb:126:in`invoke_command'
    from /Users/jomeara/.rbenv/versions/2.0.0-p645/lib/ruby/gems/2.0.0/gems/thor-0.19.1/lib/thor.rb:359:in `dispatch'
    from /Users/jomeara/.rbenv/versions/2.0.0-p645/lib/ruby/gems/2.0.0/gems/thor-0.19.1/lib/thor/base.rb:440:in`start'
    from /Users/jomeara/.rbenv/versions/2.0.0-p645/lib/ruby/gems/2.0.0/gems/bosh-gen-0.22.0/bin/bosh-gen:7:in `<top (required)>'
    from /Users/jomeara/.rbenv/versions/2.0.0-p645/bin/bosh-gen:23:in`load'
    from /Users/jomeara/.rbenv/versions/2.0.0-p645/bin/bosh-gen:23:in `<main>'

Stack trace when attempting `bosh-gen manifest`

Without latest_release_filename specified in config/dev.yml, manifest creation blows up and its not obvious what to do without looking at the source.

mkb@beemo ~/code/counter-boshrelease [master]
± % bosh-gen manifest counter-demo .                                                                  [ruby-2.1.5@bosh]
/Users/mkb/.rvm/gems/ruby-2.1.5@bosh/gems/bosh-gen-0.18.4/lib/bosh/gen/models/release_detection.rb:12:in `expand_path': no implicit conversion of nil into String (TypeError)
        from /Users/mkb/.rvm/gems/ruby-2.1.5@bosh/gems/bosh-gen-0.18.4/lib/bosh/gen/models/release_detection.rb:12:in `initialize'
        from /Users/mkb/.rvm/gems/ruby-2.1.5@bosh/gems/bosh-gen-0.18.4/lib/bosh/gen/generators/deployment_manifest_generator.rb:55:in `new'
        from /Users/mkb/.rvm/gems/ruby-2.1.5@bosh/gems/bosh-gen-0.18.4/lib/bosh/gen/generators/deployment_manifest_generator.rb:55:in `release_detector'
        from /Users/mkb/.rvm/gems/ruby-2.1.5@bosh/gems/bosh-gen-0.18.4/lib/bosh/gen/generators/deployment_manifest_generator.rb:73:in `detect_jobs'
        from /Users/mkb/.rvm/gems/ruby-2.1.5@bosh/gems/bosh-gen-0.18.4/lib/bosh/gen/generators/deployment_manifest_generator.rb:78:in `jobs'
        from /Users/mkb/.rvm/gems/ruby-2.1.5@bosh/gems/bosh-gen-0.18.4/lib/bosh/gen/generators/deployment_manifest_generator.rb:29:in `check_valid_requested_jobs'
        from /Users/mkb/.rvm/gems/ruby-2.1.5@bosh/gems/thor-0.19.1/lib/thor/command.rb:27:in `run'
        from /Users/mkb/.rvm/gems/ruby-2.1.5@bosh/gems/thor-0.19.1/lib/thor/invocation.rb:126:in `invoke_command'
        from /Users/mkb/.rvm/gems/ruby-2.1.5@bosh/gems/thor-0.19.1/lib/thor/invocation.rb:133:in `block in invoke_all'
        from /Users/mkb/.rvm/gems/ruby-2.1.5@bosh/gems/thor-0.19.1/lib/thor/invocation.rb:133:in `each'
        from /Users/mkb/.rvm/gems/ruby-2.1.5@bosh/gems/thor-0.19.1/lib/thor/invocation.rb:133:in `map'
        from /Users/mkb/.rvm/gems/ruby-2.1.5@bosh/gems/thor-0.19.1/lib/thor/invocation.rb:133:in `invoke_all'
        from /Users/mkb/.rvm/gems/ruby-2.1.5@bosh/gems/thor-0.19.1/lib/thor/group.rb:232:in `dispatch'
        from /Users/mkb/.rvm/gems/ruby-2.1.5@bosh/gems/thor-0.19.1/lib/thor/base.rb:440:in `start'
        from /Users/mkb/.rvm/gems/ruby-2.1.5@bosh/gems/bosh-gen-0.18.4/lib/bosh/gen/cli.rb:134:in `manifest'
        from /Users/mkb/.rvm/gems/ruby-2.1.5@bosh/gems/thor-0.19.1/lib/thor/command.rb:27:in `run'
        from /Users/mkb/.rvm/gems/ruby-2.1.5@bosh/gems/thor-0.19.1/lib/thor/invocation.rb:126:in `invoke_command'
        from /Users/mkb/.rvm/gems/ruby-2.1.5@bosh/gems/thor-0.19.1/lib/thor.rb:359:in `dispatch'
        from /Users/mkb/.rvm/gems/ruby-2.1.5@bosh/gems/thor-0.19.1/lib/thor/base.rb:440:in `start'
        from /Users/mkb/.rvm/gems/ruby-2.1.5@bosh/gems/bosh-gen-0.18.4/bin/bosh-gen:7:in `<top (required)>'
        from /Users/mkb/.rvm/gems/ruby-2.1.5@bosh/bin/bosh-gen:23:in `load'
        from /Users/mkb/.rvm/gems/ruby-2.1.5@bosh/bin/bosh-gen:23:in `<main>'
        from /Users/mkb/.rvm/gems/ruby-2.1.5@bosh/bin/ruby_executable_hooks:15:in `eval'
        from /Users/mkb/.rvm/gems/ruby-2.1.5@bosh/bin/ruby_executable_hooks:15:in `<main>'

package -f dir should assume files 'dir/**/*'

If there is a folder src/gopath/src/extra/... and the command run is:

bosh-gen package myapp -f gopath

Then the generated packages/myapp/spec should be:

name: myapp
files:
- gopath/**/*

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.