blob: ddf330d7a9e5e0e00e4a85954746441c1ef04527 [file] [log] [blame]
Lusheng Jic38ca2f2017-09-11 20:11:29 +00001#!/bin/bash
2#
3# ============LICENSE_START==========================================
4# ===================================================================
5# Copyright © 2017 AT&T Intellectual Property. All rights reserved.
6# ===================================================================
7# Licensed under the Apache License, Version 2.0 (the "License");
8# you may not use this file except in compliance with the License.
9# You may obtain a copy of the License at
10#
11# http://www.apache.org/licenses/LICENSE-2.0
12#
13# Unless required by applicable law or agreed to in writing, software
14# distributed under the License is distributed on an "AS IS" BASIS,
15# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied
16# See the License for the specific language governing permissions and
17# limitations under the License.
18# ============LICENSE_END============================================
19#
20# ECOMP and OpenECOMP are trademarks
21# and service marks of AT&T Intellectual Property.
22#
23
24# URLs for artifacts needed for installation
25DESIGTYPES={{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_platform_plugins_releases }}/type_files/dnsdesig/dns_types.yaml
26DESIGPLUG={{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_platform_plugins_releases }}/plugins/dnsdesig-1.0.0-py27-none-any.wgn
27SSHKEYTYPES={{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_platform_plugins_releases }}/type_files/sshkeyshare/sshkey_types.yaml
28SSHKEYPLUG={{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_platform_plugins_releases }}/plugins/sshkeyshare-1.0.0-py27-none-any.wgn
29OSPLUGINZIP=https://github.com/cloudify-cosmo/cloudify-openstack-plugin/archive/1.4.zip
Lusheng Jid92d4482017-09-21 05:42:28 +000030OSPLUGINWGN=https://github.com/cloudify-cosmo/cloudify-openstack-plugin/releases/download/2.2.0/cloudify_openstack_plugin-2.2.0-py27-none-linux_x86_64-centos-Core.wgn
31
Jack Lucasa3ff3762017-10-14 00:24:19 +000032PLATBPSRC={{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_blueprints_releases }}/blueprints
33DOCKERBP=DockerBP.yaml
34CBSBP=config_binding_service.yaml
35CDAPBP=cdapbp7.yaml
36CDAPBROKERBP=cdap_broker.yaml
37INVBP=inventory.yaml
38DHBP=DeploymentHandler.yaml
39PHBP=policy_handler.yaml
40
41DOCKERBPURL="${PLATBPSRC}/${DOCKERBP}"
42CBSBPURL="${PLATBPSRC}/${CBSBP}"
43CDAPBPURL="${PLATBPSRC}/${CDAPBP}"
44CDAPBROKERBPURL="${PLATBPSRC}/${CDAPBROKERBP}"
45INVBPURL="${PLATBPSRC}/${INVBP}"
46DHBPURL="${PLATBPSRC}/${DHBP}"
47PHBPURL="${PLATBPSRC}/${PHBP}"
48
49LOCATIONID=$(printenv LOCATION)
Lusheng Jic38ca2f2017-09-11 20:11:29 +000050
51# Make sure ssh doesn't prompt for new host or choke on a new host with an IP it's seen before
52SSHOPTS="-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no"
53STARTDIR=$(pwd)
54
Lusheng Ji10388fd2017-10-20 16:14:38 -040055# clear out files for writing out floating IP addresses
56rm -f "$STARTDIR"/config/runtime.ip.consul
57rm -f "$STARTDIR"/config/runtime.ip.cm
58
59
Lusheng Jic38ca2f2017-09-11 20:11:29 +000060SSHUSER=centos
61PVTKEY=./config/key
62INPUTS=./config/inputs.yaml
63
Lusheng Jid92d4482017-09-21 05:42:28 +000064if [ "$LOCATION" = "" ]
Lusheng Jic38ca2f2017-09-11 20:11:29 +000065then
66 echo 'Environment variable LOCATION not set. Should be set to location ID for this installation.'
67 exit 1
68fi
69
70set -e
71set -x
72
73# Docker workaround for SSH key
74# In order for the container to be able to access the key when it's mounted from the Docker host,
75# the key file has to be world-readable. But ssh itself will not work with a private key that's world readable.
76# So we make a copy and change permissions on the copy.
77# NB -- the key on the Docker host has to be world-readable, which means that, from the host machine, you
78# can't use it with ssh. It needs to be a world-readable COPY.
79PVTKEY=./key600
80cp ./config/key ${PVTKEY}
81chmod 600 ${PVTKEY}
82
83# Create a virtual environment
84virtualenv dcaeinstall
85source dcaeinstall/bin/activate
86
87# Install Cloudify
88pip install cloudify==3.4.0
89
90# Install the Cloudify OpenStack plugin
91wget -qO- ${OSPLUGINZIP} > openstack.zip
92pip install openstack.zip
93
94# Spin up a VM
95
96# Get the Designate and SSH key type files and plugins
97mkdir types
98wget -qO- ${DESIGTYPES} > types/dns_types.yaml
99wget -qO- ${SSHKEYTYPES} > types/sshkey_types.yaml
100
101wget -O dnsdesig.wgn ${DESIGPLUG}
102wget -O sshkeyshare.wgn ${SSHKEYPLUG}
103
104wagon install -s dnsdesig.wgn
105wagon install -s sshkeyshare.wgn
106
107## Fix up the inputs file to get the private key locally
108sed -e "s#key_filename:.*#key_filename: $PVTKEY#" < ${INPUTS} > /tmp/local_inputs
109
110# Now install the VM
111# Don't exit on error after this point--keep container running so we can do uninstalls after a failure
112set +e
Lusheng Ji557c2cd2017-10-25 13:36:54 -0400113if wget -O /tmp/centos_vm.yaml {{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_blueprints_releases }}/blueprints/centos_vm.yaml; then
114 mv -f /tmp/centos_vm.yaml ./blueprints/
Lusheng Jic38ca2f2017-09-11 20:11:29 +0000115 echo "Succeeded in getting the newest centos_vm.yaml"
116else
117 echo "Failed to update centos_vm.yaml, using default version"
Lusheng Ji557c2cd2017-10-25 13:36:54 -0400118 rm -f /tmp/centos_vm.yaml
Lusheng Jic38ca2f2017-09-11 20:11:29 +0000119fi
120set -e
121cfy local init --install-plugins -p ./blueprints/centos_vm.yaml -i /tmp/local_inputs -i "datacenter=$LOCATION"
122cfy local execute -w install --task-retries=10
123PUBIP=$(cfy local outputs | grep -Po '"public_ip": "\K.*?(?=")')
124
125
126## It's probably not completely ready when the installation finish, so wait
Lusheng Ji557c2cd2017-10-25 13:36:54 -0400127#sleep 180
128while [ $( ping -c 1 $PUBIP 2> /dev/null | grep icmp* | wc -l ) -eq 0 ];
129do
130 sleep 5
131 echo "."
132done
133sleep 10
Lusheng Jic38ca2f2017-09-11 20:11:29 +0000134
135echo "Installing Cloudify Manager on ${PUBIP}."
136
137PVTIP=$(ssh $SSHOPTS -i "$PVTKEY" "$SSHUSER"@"$PUBIP" 'echo PVTIP=`curl --silent http://169.254.169.254/2009-04-04/meta-data/local-ipv4`' | grep PVTIP | sed 's/PVTIP=//')
138if [ "$PVTIP" = "" ]
139then
140 echo Cannot access specified machine at $PUBIP using supplied credentials
141 # Don't exit--keep the container up so we can uninstall the VM and supporting entities
142 while true
143 do
144 sleep 300
145 done
146fi
147
148
149# Copy private key onto Cloudify Manager VM
150PVTKEYPATH=$(cat ${INPUTS} | grep "key_filename" | cut -d "'" -f2)
151PVTKEYNAME=$(basename $PVTKEYPATH)
152PVTKEYDIR=$(dirname $PVTKEYPATH)
153scp $SSHOPTS -i $PVTKEY $PVTKEY $SSHUSER@$PUBIP:/tmp/$PVTKEYNAME
154ssh -t $SSHOPTS -i $PVTKEY $SSHUSER@$PUBIP sudo mkdir -p $PVTKEYDIR
155ssh -t $SSHOPTS -i $PVTKEY $SSHUSER@$PUBIP sudo mv /tmp/$PVTKEYNAME $PVTKEYPATH
156
157ESMAGIC=$(uuidgen -r)
158WORKDIR=$HOME/cmtmp
159BSDIR=$WORKDIR/cmbootstrap
160PVTKEY2=$BSDIR/id_rsa.cfybootstrap
161TMPBASE=$WORKDIR/tmp
162TMPDIR=$TMPBASE/lib
163SRCS=$WORKDIR/srcs.tar
164TOOL=$WORKDIR/tool.py
165rm -rf $WORKDIR
166mkdir -p $BSDIR $TMPDIR/cloudify/wheels $TMPDIR/cloudify/sources $TMPDIR/manager
167chmod 700 $WORKDIR
168cp "$PVTKEY" $PVTKEY2
169cat >$TOOL <<!EOF
170#!/usr/local/bin/python
171#
172import yaml
173import sys
174bsdir = sys.argv[1]
175with open(bsdir + '/simple-manager-blueprint-inputs.yaml', 'r') as f:
176 inpyaml = yaml.load(f)
177with open(bsdir + '/simple-manager-blueprint.yaml', 'r') as f:
178 bpyaml = yaml.load(f)
179for param, value in bpyaml['inputs'].items():
180 if value.has_key('default') and not inpyaml.has_key(param):
181 inpyaml[param] = value['default']
182print inpyaml['manager_resources_package']
183!EOF
184
185#
186# Try to disable attempt to download virtualenv when not needed
187#
188ssh $SSHOPTS -t -i $PVTKEY2 $SSHUSER@$PUBIP 'sudo bash -xc "echo y; mkdir -p /root/.virtualenv; echo '"'"'[virtualenv]'"'"' >/root/.virtualenv/virtualenv.ini; echo no-download=true >>/root/.virtualenv/virtualenv.ini"'
189
190# Gather installation artifacts
191# from documentation, URL for manager blueprints archive
192BSURL=https://github.com/cloudify-cosmo/cloudify-manager-blueprints/archive/3.4.tar.gz
193BSFILE=$(basename $BSURL)
194
195umask 022
196wget -qO- $BSURL >$BSDIR/$BSFILE
197cd $BSDIR
198tar xzvf $BSFILE
199MRPURL=$(python $TOOL $BSDIR/cloudify-manager-blueprints-3.4)
200MRPFILE=$(basename $MRPURL)
201wget -qO- $MRPURL >$TMPDIR/cloudify/sources/$MRPFILE
202
203tar cf $SRCS -C $TMPDIR cloudify
204rm -rf $TMPBASE
205#
206# Load required package files onto VM
207#
208scp $SSHOPTS -i $PVTKEY2 $SRCS $SSHUSER@$PUBIP:/tmp/.
209ssh -t $SSHOPTS -i $PVTKEY2 $SSHUSER@$PUBIP 'sudo bash -xc "cd /opt; tar xf /tmp/srcs.tar; chown -R root:root /opt/cloudify /opt/manager; rm -rf /tmp/srcs.tar"'
210#
211# Install config file -- was done by DCAE controller. What now?
212#
213ssh $SSHOPTS -t -i $PVTKEY2 $SSHUSER@$PUBIP 'sudo bash -xc '"'"'mkdir -p /opt/dcae; if [ -f /tmp/cfy-config.txt ]; then cp /tmp/cfy-config.txt /opt/dcae/config.txt && chmod 644 /opt/dcae/config.txt; fi'"'"
214cd $WORKDIR
215
216#
217# Check for and set up https certificate information
218#
219rm -f $BSDIR/cloudify-manager-blueprints-3.4/resources/ssl/server.key $BSDIR/cloudify-manager-blueprints-3.4/resources/ssl/server.crt
220ssh -t $SSHOPTS -i $PVTKEY2 $SSHUSER@$PUBIP 'sudo bash -xc "openssl pkcs12 -in /opt/app/dcae-certificate/certificate.pkcs12 -passin file:/opt/app/dcae-certificate/.password -nodes -chain"' | awk 'BEGIN{x="/dev/null";}/-----BEGIN CERTIFICATE-----/{x="'$BSDIR'/cloudify-manager-blueprints-3.4/resources/ssl/server.crt";}/-----BEGIN PRIVATE KEY-----/{x="'$BSDIR'/cloudify-manager-blueprints-3.4/resources/ssl/server.key";}{print >x;}/-----END /{x="/dev/null";}'
221USESSL=false
222if [ -f $BSDIR/cloudify-manager-blueprints-3.4/resources/ssl/server.key -a -f $BSDIR/cloudify-manager-blueprints-3.4/resources/ssl/server.crt ]
223then
224 USESSL=true
225fi
226#
227# Set up configuration for the bootstrap
228#
229export CLOUDIFY_USERNAME=admin CLOUDIFY_PASSWORD=encc0fba9f6d618a1a51935b42342b17658
230cd $BSDIR/cloudify-manager-blueprints-3.4
231cp simple-manager-blueprint.yaml bootstrap-blueprint.yaml
232ed bootstrap-blueprint.yaml <<'!EOF'
233/^node_types:/-1a
234 plugin_resources:
235 description: >
236 Holds any archives that should be uploaded to the manager.
237 default: []
238 dsl_resources:
239 description: >
240 Holds a set of dsl required resources
241 default: []
242.
243/^ upload_resources:/a
244 plugin_resources: { get_input: plugin_resources }
245.
246w
247q
248!EOF
249
250sed <simple-manager-blueprint-inputs.yaml >bootstrap-inputs.yaml \
251 -e "s;.*public_ip: .*;public_ip: '$PUBIP';" \
252 -e "s;.*private_ip: .*;private_ip: '$PVTIP';" \
253 -e "s;.*ssh_user: .*;ssh_user: '$SSHUSER';" \
254 -e "s;.*ssh_key_filename: .*;ssh_key_filename: '$PVTKEY2';" \
255 -e "s;.*elasticsearch_java_opts: .*;elasticsearch_java_opts: '-Des.cluster.name=$ESMAGIC';" \
256 -e "/ssl_enabled: /s/.*/ssl_enabled: $USESSL/" \
257 -e "/security_enabled: /s/.*/security_enabled: $USESSL/" \
258 -e "/admin_password: /s/.*/admin_password: '$CLOUDIFY_PASSWORD'/" \
259 -e "/admin_username: /s/.*/admin_username: '$CLOUDIFY_USERNAME'/" \
260 -e "s;.*manager_resources_package: .*;manager_resources_package: 'http://169.254.169.254/nosuchthing/$MRPFILE';" \
261 -e "s;.*ignore_bootstrap_validations: .*;ignore_bootstrap_validations: true;" \
262
263# Add plugin resources
Jack Lucas1e353cb2017-10-11 21:10:08 +0000264# TODO Maintain plugin list as updates/additions occur
Lusheng Jic38ca2f2017-09-11 20:11:29 +0000265cat >>bootstrap-inputs.yaml <<'!EOF'
266plugin_resources:
267 - 'http://repository.cloudifysource.org/org/cloudify3/wagons/cloudify-openstack-plugin/1.4/cloudify_openstack_plugin-1.4-py27-none-linux_x86_64-centos-Core.wgn'
268 - 'http://repository.cloudifysource.org/org/cloudify3/wagons/cloudify-fabric-plugin/1.4.1/cloudify_fabric_plugin-1.4.1-py27-none-linux_x86_64-centos-Core.wgn'
269 - '{{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_platform_plugins_releases }}/plugins/dnsdesig-1.0.0-py27-none-any.wgn'
270 - '{{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_platform_plugins_releases }}/plugins/sshkeyshare-1.0.0-py27-none-any.wgn'
Jack Lucas25745022017-10-20 18:39:00 +0000271 - '{{ ONAPTEMPLATE_RAWREPOURL_org_onap_ccsdk_platform_plugins_releases }}/plugins/pgaas-1.0.0-py27-none-any.wgn'
Jack Lucas1e353cb2017-10-11 21:10:08 +0000272 - '{{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/plugins/cdapcloudify/cdapcloudify-14.2.5-py27-none-any.wgn'
273 - '{{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/plugins/dcaepolicyplugin/dcaepolicyplugin-1.0.0-py27-none-any.wgn'
274 - '{{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/plugins/dockerplugin/dockerplugin-2.4.0-py27-none-any.wgn'
275 - '{{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_plugins_releases }}/plugins/relationshipplugin/relationshipplugin-1.0.0-py27-none-any.wgn'
Lusheng Jic38ca2f2017-09-11 20:11:29 +0000276!EOF
277#
278# And away we go
279#
280cfy init -r
281cfy bootstrap --install-plugins -p bootstrap-blueprint.yaml -i bootstrap-inputs.yaml
282rm -f resources/ssl/server.key
283
284# Install Consul VM via a blueprint
285cd $STARTDIR
286mkdir consul
287cd consul
288cfy init -r
289cfy use -t ${PUBIP}
290echo "Deploying Consul VM"
291
292set +e
Lusheng Ji557c2cd2017-10-25 13:36:54 -0400293if wget -O /tmp/consul_cluster.yaml {{ ONAPTEMPLATE_RAWREPOURL_org_onap_dcaegen2_platform_blueprints_releases }}/blueprints/consul_cluster.yaml; then
294 mv -f /tmp/consul_cluster.yaml ../blueprints/
Lusheng Jic38ca2f2017-09-11 20:11:29 +0000295 echo "Succeeded in getting the newest consul_cluster.yaml"
296else
297 echo "Failed to update consul_cluster.yaml, using default version"
Lusheng Ji557c2cd2017-10-25 13:36:54 -0400298 rm -f /tmp/consul_cluster.yaml
Lusheng Jic38ca2f2017-09-11 20:11:29 +0000299fi
300set -e
301cfy install -p ../blueprints/consul_cluster.yaml -d consul -i ../${INPUTS} -i "datacenter=$LOCATION"
302
303# Get the floating IP for one member of the cluster
304# Needed for instructing the Consul agent on CM host to join the cluster
305CONSULIP=$(cfy deployments outputs -d consul | grep -Po 'Value: \K.*')
306echo Consul deployed at $CONSULIP
307
308# Wait for Consul API to come up
309until curl http://$CONSULIP:8500/v1/agent/services
310do
311 echo Waiting for Consul API
312 sleep 60
313done
314
315# Wait for a leader to be elected
316until [[ "$(curl -Ss http://$CONSULIP:8500/v1/status/leader)" != '""' ]]
317do
318 echo Waiting for leader
319 sleep 30
320done
321
322# Instruct the client-mode Consul agent running on the CM to join the cluster
323curl http://$PUBIP:8500/v1/agent/join/$CONSULIP
324
325# Register Cloudify Manager in Consul via the local agent on CM host
326
327REGREQ="
328{
329 \"Name\" : \"cloudify_manager\",
330 \"ID\" : \"cloudify_manager\",
331 \"Tags\" : [\"http://${PUBIP}/api/v2.1\"],
332 \"Address\": \"${PUBIP}\",
333 \"Port\": 80,
334 \"Check\" : {
335 \"Name\" : \"cloudify_manager_health\",
336 \"Interval\" : \"300s\",
337 \"HTTP\" : \"http://${PUBIP}/api/v2.1/status\",
338 \"Status\" : \"passing\",
339 \"DeregisterCriticalServiceAfter\" : \"30m\"
340 }
341}
342"
343
344curl -X PUT -H 'Content-Type: application/json' --data-binary "$REGREQ" http://$PUBIP:8500/v1/agent/service/register
345# Make Consul address available to plugins on Cloudify Manager
346# TODO probably not necessary anymore
347ENVINI=$(mktemp)
348cat <<!EOF > $ENVINI
349[$LOCATION]
350CONSUL_HOST=$CONSULIP
351CONFIG_BINDING_SERVICE=config_binding_service
352!EOF
353scp $SSHOPTS -i ../$PVTKEY $ENVINI $SSHUSER@$PUBIP:/tmp/env.ini
354ssh -t $SSHOPTS -i ../$PVTKEY $SSHUSER@$PUBIP sudo mv /tmp/env.ini /opt/env.ini
355rm $ENVINI
356
Jack Lucasa3ff3762017-10-14 00:24:19 +0000357
358##### INSTALLATION OF PLATFORM COMPONENTS
359
360# Get component blueprints
361wget -P ./blueprints/docker/ ${DOCKERBPURL}
362wget -P ./blueprints/cbs/ ${CBSBPURL}
363wget -P ./blueprints/cdap/ ${CDAPBPURL}
364wget -P ./blueprints/cdapbroker/ ${CDAPBROKERBPURL}
365wget -P ./blueprints/inv/ ${INVBPURL}
366wget -P ./blueprints/dh/ ${DHBPURL}
367wget -P ./blueprints/ph/ ${PHBPURL}
368
369
370# Set up the credentials for access to the Docker registry
371curl -X PUT -H "Content-Type: application/json" --data-binary '[{"username":"docker", "password":"docker", "registry": "nexus3.onap.org:10001"}]' http://${CONSULIP}:8500/v1/kv/docker_plugin/docker_logins
372
373# Install platform Docker host
374# Note we're still in the "consul" directory, which is init'ed for talking to CM
375
376set +e
377# Docker host for platform containers
378cfy install -v -p ./blueprints/docker/${DOCKERBP} -b DockerBP -d DockerPlatform -i ../${INPUTS} -i "registered_dockerhost_name=platform_dockerhost" -i "registrator_image=onapdcae/registrator:v7" -i "location_id=${LOCATION}" -i "node_name=dokp00" -i "target_datacenter=${LOCATION}"
379
380# Docker host for service containers
381cfy deployments create -b DockerBP -d DockerComponent -i ../${INPUTS} -i "registered_dockerhost_name=component_dockerhost" -i "location_id=${LOCATION}" -i "registrator_image=onapdcae/registrator:v7" -i "node_name=doks00" -i "target_datacenter=${LOCATION}"
382cfy executions start -d DockerComponent -w install
383
384# wait for the extended platform VMs settle
385#sleep 180
386
387
388# CDAP cluster
Jack Lucas53b024f2017-10-19 13:36:15 +0000389cfy install -p ./blueprints/cdap/${CDAPBP} -b cdapbp7 -d cdap7 -i ../${INPUTS} -i "location_id=${LOCATION}"
Jack Lucasa3ff3762017-10-14 00:24:19 +0000390
391# config binding service
392cfy install -p ./blueprints/cbs/${CBSBP} -b config_binding_service -d config_binding_service -i "location_id=${LOCATION}"
393
394
395# Inventory
396cfy install -p ./blueprints/inv/${INVBP} -b PlatformServicesInventory -d PlatformServicesInventory -i "location_id=${LOCATION}" -i ../config/invinputs.yaml
397
398
399# Deployment Handler DH
400cat >../dhinputs <<EOL
401application_config:
402 cloudify:
403 protocol: "http"
404 inventory:
405 protocol: "http"
406EOL
407cfy install -p ./blueprints/dh/${DHBP} -b DeploymentHandlerBP -d DeploymentHandler -i "location_id=${LOCATION}" -i ../dhinputs
408
409
410# Policy Handler PH
411cfy install -p ./blueprints/ph/${PHBP} -b policy_handler_BP -d policy_handler -i 'policy_handler_image=nexus3.onap.org:10001/onap/org.onap.dcaegen2.platform.policy-handler:1.1-latest' -i "location_id=${LOCATION}" -i ../config/phinputs.yaml
412
413
Jack Lucas53b024f2017-10-19 13:36:15 +0000414# Wait for the CDAP cluster to be registered in Consul
415echo "Waiting for CDAP cluster to register"
416until curl -Ss http://${CONSULIP}:8500/v1/catalog/service/cdap | grep cdap
417do
418 echo -n .
419 sleep 30
420done
421echo "CDAP cluster registered"
422
423
Jack Lucasa3ff3762017-10-14 00:24:19 +0000424# CDAP Broker
Jack Lucas53b024f2017-10-19 13:36:15 +0000425cfy install -p ./blueprints/cdapbroker/${CDAPBROKERBP} -b cdapbroker -d cdapbroker -i "location_id=${LOCATION}"
Jack Lucasa3ff3762017-10-14 00:24:19 +0000426
427
Lusheng Ji10388fd2017-10-20 16:14:38 -0400428# write out IP addresses
429echo "$CONSULIP" > "$STARTDIR"/config/runtime.ip.consul
430echo "$PUBIP" > "$STARTDIR"/config/runtime.ip.cm
431
432
Jack Lucasa3ff3762017-10-14 00:24:19 +0000433# Keep the container up
Lusheng Jic37f51b2017-10-15 22:17:30 -0400434rm -f /tmp/ready_to_exit
435while [ ! -e /tmp/ready_to_exit ]
Lusheng Jic38ca2f2017-09-11 20:11:29 +0000436do
Lusheng Jic37f51b2017-10-15 22:17:30 -0400437 sleep 30
Lusheng Jic38ca2f2017-09-11 20:11:29 +0000438done