cppforlife / bosh-generic-sb-release

Generic Service Broker for BOSH deployments
Apache License 2.0
3 stars 1 forks source link

zookeeper run.sh - missing git #7

Open drnic opened 7 years ago

drnic commented 7 years ago

Running zookeeper run.sh, the "create service instances" section failed:

-----> Thu 19 Oct 2017 10:41:19 AEST: Create service instances
Using service broker 'http://10.244.0.2:8080' as user 'broker'

In progress state: running

Provisioning service instance: Polling instance: Failed state: "deploying service instance deployment: executing bosh: exit status 1 (stderr: Creating and uploading releases:\n  Uploading release 'zookeeper/0.0.7':\n    Cloning git repo:\n      Starting command 'git clone https://github.com/cppforlife/zookeeper-release --depth 1 /var/vcap/data/bosh-generic-sb/.bosh/tmp/bosh-upload-release-git-clone870054224':\n        exec: \"git\": executable file not found in $PATH\nExit code 1\n)"
drnic commented 7 years ago

One workaround might be to front-load the preparation of dependency releases - to extract releases from the service instance manifest, and add them to the broker manifest's releases section. Then the original operator - with their local git + local git credentials - can be responsible and capable of uploading all the releases.

drnic commented 7 years ago
$ si_manifest="$(wget -O- https://raw.githubusercontent.com/cppforlife/zookeeper-release/master/manifests/zookeeper.yml|bosh int - -o $example_dir/fixes.yml)"
$ echo "$(bosh int manifests/broker.yml --path /releases)\n$(bosh int <(echo "$si_manifest") --path /releases)"
- name: bosh-generic-sb
  version: latest
- name: bpm
  url: git+https://github.com/cloudfoundry-incubator/bpm-release
  version: 0.1.0
- name: zookeeper
  sha1: a863ef216ea75d22950703a3c924959cb20e59ba
  url: https://bosh.io/d/github.com/cppforlife/zookeeper-release?v=0.0.7
  version: 0.0.7
drnic commented 7 years ago

The following works for zookeeper:

function indent() {
  c='s/^/  /'
  case $(uname) in
    Darwin) sed -l "$c";;
    *)      sed -u "$c";;
  esac
}

si_manifest="$(wget -O- https://raw.githubusercontent.com/cppforlife/zookeeper-release/master/manifests/zookeeper.yml|bosh int - -o $example_dir/fixes.yml)"
releases="$(echo "$(bosh int manifests/broker.yml --path /releases)
$(bosh int <(echo "$si_manifest") --path /releases)")"
cat > $example_dir/releases.yml <<YAML
---
- type: replace
  path: /releases
  value:
$(echo "$releases" | indent)
YAML

echo "-----> `date`: Deploy"
( set -e
  bosh -n -d zookeeper-broker deploy ./manifests/broker.yml \
  -o ./manifests/dev.yml \
  -o $example_dir/releases.yml \
...
  --var-file si_manifest=<(echo "$si_manifest"|base64) \
...