From: Vijay Venkatesh Kumar Date: Fri, 5 Apr 2019 00:38:59 +0000 (+0000) Subject: Bulk update to deployment X-Git-Tag: 1.4.16~7 X-Git-Url: https://gerrit.onap.org/r/gitweb?a=commitdiff_plain;h=d2c821277a10f0c746ddb1a99c59a3ef88fb2f1c;p=dcaegen2%2Fdeployments.git Bulk update to deployment 1) Removed pnda folder (moved to pnda repo) 2) Moved older R3 - heat repo into archive folder 3) Added Dmaap plugin 4) Added new blueprints for Dashboard/helm Change-Id: I82cb8c482a0a35fe8094da825e7403b0fc4ee33b Signed-off-by: Vijay Venkatesh Kumar Issue-ID: DCAEGEN2-1270 Signed-off-by: Vijay Venkatesh Kumar --- diff --git a/archive/bootstrap/Dockerfile b/archive/bootstrap/Dockerfile new file mode 100644 index 0000000..2f93801 --- /dev/null +++ b/archive/bootstrap/Dockerfile @@ -0,0 +1,20 @@ +FROM ubuntu:16.04 +MAINTAINER maintainer +ENV INSROOT /opt/app +ENV APPUSER installer +RUN apt-get update\ + && apt-get install -y iputils-ping wget python-virtualenv python-pip ssh ed curl uuid-runtime netcat\ + && apt-get clean\ + && pip install --upgrade pip\ + && mkdir -p ${INSROOT}/${APPUSER}/blueprints\ + && useradd -d ${INSROOT}/${APPUSER} ${APPUSER} +COPY installer-docker.sh ${INSROOT}/${APPUSER}/installer +COPY teardown.sh ${INSROOT}/${APPUSER}/teardown +# COPY *.yaml ${INSROOT}/${APPUSER}/blueprints/ +RUN wget -P ${INSROOT}/${APPUSER}/blueprints/ https://nexus.onap.org/service/local/repositories/raw/content/org.onap.dcaegen2.platform.blueprints/R3/blueprints/centos_vm.yaml +RUN wget -P ${INSROOT}/${APPUSER}/blueprints/ https://nexus.onap.org/service/local/repositories/raw/content/org.onap.dcaegen2.platform.blueprints/R3/blueprints/consul_cluster.yaml +WORKDIR ${INSROOT}/${APPUSER} +RUN chown -R ${APPUSER}:${APPUSER} ${INSROOT}/${APPUSER} && chmod +x ${INSROOT}/${APPUSER}/installer && chmod +x ${INSROOT}/${APPUSER}/teardown +USER ${APPUSER} +ENTRYPOINT exec "${INSROOT}/${APPUSER}/installer" + diff --git a/bootstrap/Dockerfile-template b/archive/bootstrap/Dockerfile-template similarity index 100% rename from bootstrap/Dockerfile-template rename to archive/bootstrap/Dockerfile-template diff --git a/bootstrap/README-docker.md b/archive/bootstrap/README-docker.md similarity index 100% rename from bootstrap/README-docker.md rename to archive/bootstrap/README-docker.md diff --git a/archive/bootstrap/installer-docker.sh b/archive/bootstrap/installer-docker.sh new file mode 100755 index 0000000..4f889fc --- /dev/null +++ b/archive/bootstrap/installer-docker.sh @@ -0,0 +1,470 @@ +#!/bin/bash +# +# ============LICENSE_START========================================== +# =================================================================== +# Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved. +# =================================================================== +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied +# See the License for the specific language governing permissions and +# limitations under the License. +# ============LICENSE_END============================================ +# + +# URLs for artifacts needed for installation +DESIGTYPES=https://nexus.onap.org/service/local/repositories/raw/content/org.onap.ccsdk.platform.plugins/releases/type_files/dnsdesig/dns_types.yaml +DESIGPLUG=https://nexus.onap.org/service/local/repositories/raw/content/org.onap.ccsdk.platform.plugins/releases/plugins/dnsdesig-1.0.0-py27-none-any.wgn +SSHKEYTYPES=https://nexus.onap.org/service/local/repositories/raw/content/org.onap.ccsdk.platform.plugins/releases/type_files/sshkeyshare/sshkey_types.yaml +SSHKEYPLUG=https://nexus.onap.org/service/local/repositories/raw/content/org.onap.ccsdk.platform.plugins/releases/plugins/sshkeyshare-1.0.0-py27-none-any.wgn +OSPLUGINZIP=https://github.com/cloudify-cosmo/cloudify-openstack-plugin/archive/1.4.zip +OSPLUGINWGN=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 + +PLATBPSRC=https://nexus.onap.org/service/local/repositories/raw/content/org.onap.dcaegen2.platform.blueprints/releases/blueprints +DOCKERBP=DockerBP.yaml +CBSBP=config_binding_service.yaml +PGBP=pgaas-onevm.yaml +CDAPBP=cdapbp7.yaml +CDAPBROKERBP=cdap_broker.yaml +INVBP=inventory.yaml +DHBP=DeploymentHandler.yaml +PHBP=policy_handler.yaml +VESBP=ves.yaml +TCABP=tca.yaml +HRULESBP=holmes-rules.yaml +HENGINEBP=holmes-engine.yaml +PRHBP=prh.yaml +HVVESBP=hv-ves.yaml + +DOCKERBPURL="${PLATBPSRC}/${DOCKERBP}" +CBSBPURL="${PLATBPSRC}/${CBSBP}" +PGBPURL="${PLATBPSRC}/${PGBP}" +CDAPBPURL="${PLATBPSRC}/${CDAPBP}" +CDAPBROKERBPURL="${PLATBPSRC}/${CDAPBROKERBP}" +INVBPURL="${PLATBPSRC}/${INVBP}" +DHBPURL="${PLATBPSRC}/${DHBP}" +PHBPURL="${PLATBPSRC}/${PHBP}" +VESBPURL="${PLATBPSRC}/${VESBP}" +TCABPURL="${PLATBPSRC}/${TCABP}" +HRULESBPURL="${PLATBPSRC}/${HRULESBP}" +HENGINEBPURL="${PLATBPSRC}/${HENGINEBP}" +PRHBPURL="${PLATBPSRC}/${PRHBP}" +HVVESBPURL="${PLATBPSRC}/${HVVESBP}" + +LOCATIONID=$(printenv LOCATION) + +# Make sure ssh doesn't prompt for new host or choke on a new host with an IP it's seen before +SSHOPTS="-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no" +STARTDIR=$(pwd) + +# clear out files for writing out floating IP addresses +rm -f "$STARTDIR"/config/runtime.ip.consul +rm -f "$STARTDIR"/config/runtime.ip.cm + + +SSHUSER=centos +PVTKEY=./config/key +INPUTS=./config/inputs.yaml + +if [ "$LOCATION" = "" ] +then + echo 'Environment variable LOCATION not set. Should be set to location ID for this installation.' + exit 1 +fi + +set -e +set -x + +# Docker workaround for SSH key +# In order for the container to be able to access the key when it's mounted from the Docker host, +# the key file has to be world-readable. But ssh itself will not work with a private key that's world readable. +# So we make a copy and change permissions on the copy. +# NB -- the key on the Docker host has to be world-readable, which means that, from the host machine, you +# can't use it with ssh. It needs to be a world-readable COPY. +PVTKEY=./key600 +cp ./config/key ${PVTKEY} +chmod 600 ${PVTKEY} + +# Create a virtual environment +virtualenv dcaeinstall +source dcaeinstall/bin/activate + +# forcing pip version (pip>=10.0.0 no longer support use wheel) +pip install pip==9.0.3 + +# Install Cloudify +pip install cloudify==3.4.0 + +# Install the Cloudify OpenStack plugin +wget -qO- ${OSPLUGINZIP} > openstack.zip +pip install openstack.zip + +# Spin up a VM + +# Get the Designate and SSH key type files and plugins +mkdir types +wget -qO- ${DESIGTYPES} > types/dns_types.yaml +wget -qO- ${SSHKEYTYPES} > types/sshkey_types.yaml + +wget -O dnsdesig.wgn ${DESIGPLUG} +wget -O sshkeyshare.wgn ${SSHKEYPLUG} + +wagon install -s dnsdesig.wgn +wagon install -s sshkeyshare.wgn + +## Fix up the inputs file to get the private key locally +sed -e "s#key_filename:.*#key_filename: $PVTKEY#" < ${INPUTS} > /tmp/local_inputs + +# Now install the VM +# Don't exit on error after this point--keep container running so we can do uninstalls after a failure +set +e +if wget -O /tmp/centos_vm.yaml "${PLATBPSRC}"/centos_vm.yaml; then + mv -f /tmp/centos_vm.yaml ./blueprints/ + echo "Succeeded in getting the newest centos_vm.yaml" +else + echo "Failed to update centos_vm.yaml, using default version" + rm -f /tmp/centos_vm.yaml +fi +set -e +cfy local init --install-plugins -p ./blueprints/centos_vm.yaml -i /tmp/local_inputs -i "datacenter=$LOCATION" +cfy local execute -w install --task-retries=10 +PUBIP=$(cfy local outputs | grep -Po '"public_ip": "\K.*?(?=")') + +# wait till the cloudify manager's sshd ready +while ! nc -z -v -w5 ${PUBIP} 22; do echo "."; done +sleep 10 + +echo "Installing Cloudify Manager on ${PUBIP}." +PVTIP=$(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=//') +if [ "$PVTIP" = "" ] +then + echo Cannot access specified machine at $PUBIP using supplied credentials + exit +fi + + +# Copy private key onto Cloudify Manager VM +PVTKEYPATH=$(cat ${INPUTS} | grep "key_filename" | cut -d "'" -f2) +PVTKEYNAME=$(basename $PVTKEYPATH) +PVTKEYDIR=$(dirname $PVTKEYPATH) +scp $SSHOPTS -i $PVTKEY $PVTKEY $SSHUSER@$PUBIP:/tmp/$PVTKEYNAME +ssh -t $SSHOPTS -i $PVTKEY $SSHUSER@$PUBIP sudo mkdir -p $PVTKEYDIR +ssh -t $SSHOPTS -i $PVTKEY $SSHUSER@$PUBIP sudo mv /tmp/$PVTKEYNAME $PVTKEYPATH + +ESMAGIC=$(uuidgen -r) +WORKDIR=$HOME/cmtmp +BSDIR=$WORKDIR/cmbootstrap +PVTKEY2=$BSDIR/id_rsa.cfybootstrap +TMPBASE=$WORKDIR/tmp +TMPDIR=$TMPBASE/lib +SRCS=$WORKDIR/srcs.tar +TOOL=$WORKDIR/tool.py +rm -rf $WORKDIR +mkdir -p $BSDIR $TMPDIR/cloudify/wheels $TMPDIR/cloudify/sources $TMPDIR/manager +chmod 700 $WORKDIR +cp "$PVTKEY" $PVTKEY2 +cat >$TOOL </root/.virtualenv/virtualenv.ini; echo no-download=true >>/root/.virtualenv/virtualenv.ini"' + +# Gather installation artifacts +# from documentation, URL for manager blueprints archive +BSURL=https://github.com/cloudify-cosmo/cloudify-manager-blueprints/archive/3.4.tar.gz +BSFILE=$(basename $BSURL) + +umask 022 +wget -qO- $BSURL >$BSDIR/$BSFILE +cd $BSDIR +tar xzvf $BSFILE +MRPURL=$(python $TOOL $BSDIR/cloudify-manager-blueprints-3.4) +MRPFILE=$(basename $MRPURL) +wget -qO- $MRPURL >$TMPDIR/cloudify/sources/$MRPFILE + +tar cf $SRCS -C $TMPDIR cloudify +rm -rf $TMPBASE +# +# Load required package files onto VM +# +scp $SSHOPTS -i $PVTKEY2 $SRCS $SSHUSER@$PUBIP:/tmp/. +ssh -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"' +# +# Install config file -- was done by DCAE controller. What now? +# +ssh $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'"'" +cd $WORKDIR + +# +# Check for and set up https certificate information +# +rm -f $BSDIR/cloudify-manager-blueprints-3.4/resources/ssl/server.key $BSDIR/cloudify-manager-blueprints-3.4/resources/ssl/server.crt +ssh -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";}' +USESSL=false +if [ -f $BSDIR/cloudify-manager-blueprints-3.4/resources/ssl/server.key -a -f $BSDIR/cloudify-manager-blueprints-3.4/resources/ssl/server.crt ] +then + USESSL=true +fi +# +# Set up configuration for the bootstrap +# +export CLOUDIFY_USERNAME=admin CLOUDIFY_PASSWORD=encc0fba9f6d618a1a51935b42342b17658 +cd $BSDIR/cloudify-manager-blueprints-3.4 +cp simple-manager-blueprint.yaml bootstrap-blueprint.yaml +ed bootstrap-blueprint.yaml <<'!EOF' +/^node_types:/-1a + plugin_resources: + description: > + Holds any archives that should be uploaded to the manager. + default: [] + dsl_resources: + description: > + Holds a set of dsl required resources + default: [] +. +/^ upload_resources:/a + plugin_resources: { get_input: plugin_resources } +. +w +q +!EOF + +sed bootstrap-inputs.yaml \ + -e "s;.*public_ip: .*;public_ip: '$PUBIP';" \ + -e "s;.*private_ip: .*;private_ip: '$PVTIP';" \ + -e "s;.*ssh_user: .*;ssh_user: '$SSHUSER';" \ + -e "s;.*ssh_key_filename: .*;ssh_key_filename: '$PVTKEY2';" \ + -e "s;.*elasticsearch_java_opts: .*;elasticsearch_java_opts: '-Des.cluster.name=$ESMAGIC';" \ + -e "/ssl_enabled: /s/.*/ssl_enabled: $USESSL/" \ + -e "/security_enabled: /s/.*/security_enabled: $USESSL/" \ + -e "/admin_password: /s/.*/admin_password: '$CLOUDIFY_PASSWORD'/" \ + -e "/admin_username: /s/.*/admin_username: '$CLOUDIFY_USERNAME'/" \ + -e "s;.*manager_resources_package: .*;manager_resources_package: 'http://169.254.169.254/nosuchthing/$MRPFILE';" \ + -e "s;.*ignore_bootstrap_validations: .*;ignore_bootstrap_validations: true;" \ + +# Add plugin resources +# TODO Maintain plugin list as updates/additions occur +cat >>bootstrap-inputs.yaml <<'!EOF' +plugin_resources: + - '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' + - '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' + - 'https://nexus.onap.org/service/local/repositories/raw/content/org.onap.ccsdk.platform.plugins/releases/plugins/dnsdesig-1.0.0-py27-none-any.wgn' + - 'https://nexus.onap.org/service/local/repositories/raw/content/org.onap.ccsdk.platform.plugins/releases/plugins/sshkeyshare-1.0.0-py27-none-any.wgn' + - 'https://nexus.onap.org/service/local/repositories/raw/content/org.onap.ccsdk.platform.plugins/releases/plugins/pgaas-1.0.0-py27-none-any.wgn' + - 'https://nexus.onap.org/service/local/repositories/raw/content/org.onap.dcaegen2.platform.plugins/releases/plugins/cdapcloudify/cdapcloudify-14.2.5-py27-none-any.wgn' + - 'https://nexus.onap.org/service/local/repositories/raw/content/org.onap.dcaegen2.platform.plugins/releases/plugins/dcaepolicyplugin/dcaepolicyplugin-1.0.0-py27-none-any.wgn' + - 'https://nexus.onap.org/service/local/repositories/raw/content/org.onap.dcaegen2.platform.plugins/releases/plugins/dockerplugin/dockerplugin-2.4.0-py27-none-any.wgn' + - 'https://nexus.onap.org/service/local/repositories/raw/content/org.onap.dcaegen2.platform.plugins/releases/plugins/relationshipplugin/relationshipplugin-1.0.0-py27-none-any.wgn' +!EOF +# +# And away we go +# +cfy init -r +cfy bootstrap --install-plugins -p bootstrap-blueprint.yaml -i bootstrap-inputs.yaml +rm -f resources/ssl/server.key + +# Install Consul VM via a blueprint +cd $STARTDIR +mkdir consul +cd consul +cfy init -r +cfy use -t ${PUBIP} +echo "Deploying Consul VM" + +set +e +if wget -O /tmp/consul_cluster.yaml "${PLATBPSRC}"/consul_cluster.yaml; then + mv -f /tmp/consul_cluster.yaml ../blueprints/ + echo "Succeeded in getting the newest consul_cluster.yaml" +else + echo "Failed to update consul_cluster.yaml, using default version" + rm -f /tmp/consul_cluster.yaml +fi +set -e +cfy install -p ../blueprints/consul_cluster.yaml -d consul -i ../${INPUTS} -i "datacenter=$LOCATION" + +# Get the floating IP for one member of the cluster +# Needed for instructing the Consul agent on CM host to join the cluster +CONSULIP=$(cfy deployments outputs -d consul | grep -Po 'Value: \K.*') +echo Consul deployed at $CONSULIP + +# Wait for Consul API to come up +until curl http://$CONSULIP:8500/v1/agent/services +do + echo Waiting for Consul API + sleep 60 +done + +# Wait for a leader to be elected +until [[ "$(curl -Ss http://$CONSULIP:8500/v1/status/leader)" != '""' ]] +do + echo Waiting for leader + sleep 30 +done + +# Instruct the client-mode Consul agent running on the CM to join the cluster +curl http://$PUBIP:8500/v1/agent/join/$CONSULIP + +# Register Cloudify Manager in Consul via the local agent on CM host + +REGREQ=" +{ + \"Name\" : \"cloudify_manager\", + \"ID\" : \"cloudify_manager\", + \"Tags\" : [\"http://${PUBIP}/api/v2.1\"], + \"Address\": \"${PUBIP}\", + \"Port\": 80, + \"Check\" : { + \"Name\" : \"cloudify_manager_health\", + \"Interval\" : \"300s\", + \"HTTP\" : \"http://${PUBIP}/api/v2.1/status\", + \"Status\" : \"passing\", + \"DeregisterCriticalServiceAfter\" : \"30m\" + } +} +" + +curl -X PUT -H 'Content-Type: application/json' --data-binary "$REGREQ" http://$PUBIP:8500/v1/agent/service/register +# Make Consul address available to plugins on Cloudify Manager +# TODO probably not necessary anymore +ENVINI=$(mktemp) +cat < $ENVINI +[$LOCATION] +CONSUL_HOST=$CONSULIP +CONFIG_BINDING_SERVICE=config_binding_service +!EOF +scp $SSHOPTS -i ../$PVTKEY $ENVINI $SSHUSER@$PUBIP:/tmp/env.ini +ssh -t $SSHOPTS -i ../$PVTKEY $SSHUSER@$PUBIP sudo mv /tmp/env.ini /opt/env.ini +rm $ENVINI + + +##### INSTALLATION OF PLATFORM COMPONENTS + +# Get component blueprints +wget -P ./blueprints/docker/ ${DOCKERBPURL} +wget -P ./blueprints/cbs/ ${CBSBPURL} +wget -P ./blueprints/pg/ ${PGBPURL} +wget -P ./blueprints/cdap/ ${CDAPBPURL} +wget -P ./blueprints/cdapbroker/ ${CDAPBROKERBPURL} +wget -P ./blueprints/inv/ ${INVBPURL} +wget -P ./blueprints/dh/ ${DHBPURL} +wget -P ./blueprints/ph/ ${PHBPURL} +wget -P ./blueprints/ves/ ${VESBPURL} +wget -P ./blueprints/tca/ ${TCABPURL} +wget -P ./blueprints/hrules/ ${HRULESBPURL} +wget -P ./blueprints/hengine/ ${HENGINEBPURL} +wget -P ./blueprints/prh/ ${PRHBPURL} +wget -P ./blueprints/hv-ves/ ${HVVESBPURL} + + +# Set up the credentials for access to the Docker registry +curl -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 + +# Install platform Docker host +# Note we're still in the "consul" directory, which is init'ed for talking to CM + +set +e +# Docker host for platform containers +cfy 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}" + +# Docker host for service containers +cfy 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}" +cfy executions start -d DockerComponent -w install + +# wait for the extended platform VMs settle +#sleep 180 + + +# CDAP cluster +cfy install -p ./blueprints/cdap/${CDAPBP} -b cdapbp7 -d cdap7 -i ../config/cdapinputs.yaml -i "location_id=${LOCATION}" + +# config binding service +cfy install -p ./blueprints/cbs/${CBSBP} -b config_binding_service -d config_binding_service -i "location_id=${LOCATION}" + + +# Postgres +cfy install -p ./blueprints/pg/${PGBP} -b pgaas -d pgaas -i ../${INPUTS} + + +# Inventory +cfy install -p ./blueprints/inv/${INVBP} -b PlatformServicesInventory -d PlatformServicesInventory -i "location_id=${LOCATION}" -i ../config/invinputs.yaml + + +# Deployment Handler DH +cat >../dhinputs < "$STARTDIR"/config/runtime.ip.consul +echo "$PUBIP" > "$STARTDIR"/config/runtime.ip.cm + + +# Keep the container up +rm -f /tmp/ready_to_exit +while [ ! -e /tmp/ready_to_exit ] +do + sleep 30 +done diff --git a/bootstrap/installer-docker.sh-template b/archive/bootstrap/installer-docker.sh-template similarity index 100% rename from bootstrap/installer-docker.sh-template rename to archive/bootstrap/installer-docker.sh-template diff --git a/bootstrap/pom.xml b/archive/bootstrap/pom.xml similarity index 100% rename from bootstrap/pom.xml rename to archive/bootstrap/pom.xml diff --git a/bootstrap/teardown.sh b/archive/bootstrap/teardown.sh similarity index 100% rename from bootstrap/teardown.sh rename to archive/bootstrap/teardown.sh diff --git a/cloud_init/cdap-init.sh b/archive/cloud_init/cdap-init.sh similarity index 100% rename from cloud_init/cdap-init.sh rename to archive/cloud_init/cdap-init.sh diff --git a/cloud_init/instconsulagentub16.sh b/archive/cloud_init/instconsulagentub16.sh similarity index 100% rename from cloud_init/instconsulagentub16.sh rename to archive/cloud_init/instconsulagentub16.sh diff --git a/cloud_init/pom.xml b/archive/cloud_init/pom.xml similarity index 100% rename from cloud_init/pom.xml rename to archive/cloud_init/pom.xml diff --git a/archive/heat/build-plugins.sh b/archive/heat/build-plugins.sh new file mode 100755 index 0000000..647ef7a --- /dev/null +++ b/archive/heat/build-plugins.sh @@ -0,0 +1,77 @@ +#!/bin/bash +# ============LICENSE_START======================================================= +# org.onap.dcae +# ================================================================================ +# Copyright (c) 2018 AT&T Intellectual Property. All rights reserved. +# ================================================================================ +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============LICENSE_END========================================================= +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. + +# Pull plugin archives from repos +# Build wagons +# $1 is the DCAE repo URL +# $2 is the CCSDK repo URL +# (This script runs at Docker image build time) +# +set -x +DEST=wagons + +# For DCAE, we get zips of the archives and build wagons +DCAEPLUGINFILES=\ +"\ +k8splugin/1.4.3/k8splugin-1.4.3.tgz +relationshipplugin/1.0.0/relationshipplugin-1.0.0.tgz +dcaepolicyplugin/2.3.0/dcaepolicyplugin-2.3.0.tgz +dockerplugin/3.2.0/dockerplugin-3.2.0.tgz \ +" + +# For CCSDK, we pull down the wagon files directly +CCSDKPLUGINFILES=\ +"\ +plugins/pgaas-1.1.0-py27-none-any.wgn +plugins/sshkeyshare-1.0.0-py27-none-any.wgn +" + +# Build a set of wagon files from archives in a repo +# $1 -- repo base URL +# $2 -- list of paths to archive files in the repo +function build { + for plugin in $2 + do + # Could just do wagon create with the archive URL as source, + # but can't use a requirements file with that approach + mkdir work + target=$(basename ${plugin}) + curl -Ss $1/${plugin} > ${target} + tar zxvf ${target} --strip-components=2 -C work + wagon create -t tar.gz -o ${DEST} -r work/requirements.txt --validate ./work + rm -rf work + done +} + +# Copy a set of wagons from a repo +# $1 -- repo baseURL +# $2 -- list of paths to wagons in the repo +function get_wagons { + for wagon in $2 + do + target=$(basename ${wagon}) + curl -Ss $1/${wagon} > ${DEST}/${target} + done +} + +mkdir ${DEST} +build $1 "${DCAEPLUGINFILES}" +get_wagons $2 "${CCSDKPLUGINFILES}" diff --git a/heat/docker-compose-1.yaml b/archive/heat/docker-compose-1.yaml similarity index 100% rename from heat/docker-compose-1.yaml rename to archive/heat/docker-compose-1.yaml diff --git a/heat/docker-compose-2.yaml b/archive/heat/docker-compose-2.yaml similarity index 100% rename from heat/docker-compose-2.yaml rename to archive/heat/docker-compose-2.yaml diff --git a/heat/docker-compose-3.yaml b/archive/heat/docker-compose-3.yaml similarity index 100% rename from heat/docker-compose-3.yaml rename to archive/heat/docker-compose-3.yaml diff --git a/heat/docker-compose-4.yaml b/archive/heat/docker-compose-4.yaml similarity index 100% rename from heat/docker-compose-4.yaml rename to archive/heat/docker-compose-4.yaml diff --git a/heat/pom.xml b/archive/heat/pom.xml similarity index 100% rename from heat/pom.xml rename to archive/heat/pom.xml diff --git a/heat/pullall.sh b/archive/heat/pullall.sh similarity index 100% rename from heat/pullall.sh rename to archive/heat/pullall.sh diff --git a/heat/register.sh b/archive/heat/register.sh similarity index 100% rename from heat/register.sh rename to archive/heat/register.sh diff --git a/heat/setup.sh b/archive/heat/setup.sh similarity index 100% rename from heat/setup.sh rename to archive/heat/setup.sh diff --git a/heat/teardown.sh b/archive/heat/teardown.sh similarity index 100% rename from heat/teardown.sh rename to archive/heat/teardown.sh diff --git a/cm-container/Dockerfile b/cm-container/Dockerfile new file mode 100644 index 0000000..7415c55 --- /dev/null +++ b/cm-container/Dockerfile @@ -0,0 +1,50 @@ +# ============LICENSE_START======================================================= +# org.onap.dcae +# ================================================================================ +# Copyright (c) 2018 AT&T Intellectual Property. All rights reserved. +# ================================================================================ +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============LICENSE_END========================================================= +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +FROM cloudifyplatform/community:18.7.23 +MAINTAINER maintainer + +ENV TYPE_REPO https://nexus.onap.org/service/local/repositories/raw/content/org.onap.dcaegen2.platform.plugins/R3 +ENV CCSDK_REPO https://nexus.onap.org/service/local/repositories/raw/content/org.onap.ccsdk.platform.plugins + +# Store type files locally +RUN mkdir scripts +COPY get-type-files.sh dcae-cleanup.sh scripts/ +# Load our type files and the Cloudify 3.4 type files +RUN scripts/get-type-files.sh ${TYPE_REPO} ${CCSDK_REPO}\ + && mkdir /opt/manager/resources/spec/cloudify/3.4\ + && curl -Ss https://cloudify.co/spec/cloudify/3.4/types.yaml > /opt/manager/resources/spec/cloudify/3.4/types.yaml\ + && chown -R cfyuser:cfyuser /opt/manager/resources/spec/cloudify/3.4\ + && chmod +x scripts/*.sh +# Create mount point for CM config file +RUN mkdir -p /opt/onap && chown cfyuser:cfyuser /opt/onap + +# For HEAT environment, install software needed to use Cloudify CLI 4.2 to install plugins & deploy blueprints locally +# Install python development-related packages +RUN yum install -y gcc python-devel python-virtualenv python-pip + +# Install jq (used for cleanup--parsing output of CM API call) +RUN curl -Ss -L "https://github.com/stedolan/jq/releases/download/jq-1.5/jq-linux64" > /bin/jq \ +&& chmod +x /bin/jq + +# Set up virtualenv and install Cloudify CLI 4.2 +RUN pip install --upgrade pip==9.0.3 \ + && virtualenv cfy42 \ + && source cfy42/bin/activate \ + && pip install cloudify==4.2 diff --git a/cm-container/scripts/get-type-files.sh b/cm-container/scripts/get-type-files.sh index c931467..8a31d98 100755 --- a/cm-container/scripts/get-type-files.sh +++ b/cm-container/scripts/get-type-files.sh @@ -40,6 +40,7 @@ CCSDKTYPEFILES=\ /type_files/pgaas/1.1.0/pgaas_types.yaml \ /type_files/sshkeyshare/sshkey_types.yaml \ /type_files/helm/4.0.0/helm-type.yaml \ +/type_files/dmaap/dmaap.yaml \ " mkdir ${DEST} @@ -72,4 +73,4 @@ chown cfyuser:cfyuser /etc/cloudify/config.yaml # Need to provide the additional rules in a file that can be # used at deployment time to update the resolver rules echo "- ${TYPE_RULE0}" > ${EXTRA_RULES} -echo "- ${TYPE_RULE1}" >> ${EXTRA_RULES} \ No newline at end of file +echo "- ${TYPE_RULE1}" >> ${EXTRA_RULES} diff --git a/healthcheck-container/healthcheck.js b/healthcheck-container/healthcheck.js index c4f2dd7..33bb848 100644 --- a/healthcheck-container/healthcheck.js +++ b/healthcheck-container/healthcheck.js @@ -1,5 +1,5 @@ /* -Copyright(c) 2018 AT&T Intellectual Property. All rights reserved. +Copyright(c) 2018-2019 AT&T Intellectual Property. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -41,7 +41,7 @@ const bootDeps = 'dep-dcae-tca-analytics', 'dep-dcae-prh', 'dep-dcae-hv-ves-collector', - 'dep-dcae-datafile-collector' + 'dep-dcae-dashboard' ]; const status = require('./get-status'); diff --git a/k8s-bootstrap-container/bootstrap.sh b/k8s-bootstrap-container/bootstrap.sh index 0c55559..503cec2 100755 --- a/k8s-bootstrap-container/bootstrap.sh +++ b/k8s-bootstrap-container/bootstrap.sh @@ -193,6 +193,7 @@ set +e # Deploy platform components # Allow for some parallelism to speed up the process. Probably could be somewhat more aggressive. deploy pgaas_initdb k8s-pgaas-initdb.yaml k8s-pgaas-initdb-inputs.yaml & +deploy dashboard k8s-dashboard.yaml k8s-dashboard-inputs.yaml & PG_PID=$! wait ${PG_PID} diff --git a/k8s-bootstrap-container/build-plugins.sh b/k8s-bootstrap-container/build-plugins.sh index f7bc393..388f234 100755 --- a/k8s-bootstrap-container/build-plugins.sh +++ b/k8s-bootstrap-container/build-plugins.sh @@ -42,6 +42,7 @@ dcaepolicyplugin/2.3.0/dcaepolicyplugin-2.3.0.tgz \ CCSDKPLUGINFILES=\ "\ plugins/pgaas-1.1.0-py27-none-any.wgn +plugins/dmaap-1.3.2-py27-none-any.wgn plugins/sshkeyshare-1.0.0-py27-none-any.wgn plugins/helm-4.0.0-py27-none-linux_x86_64.wgn " diff --git a/k8s-bootstrap-container/load-blueprints.sh b/k8s-bootstrap-container/load-blueprints.sh index e42a72e..e6838e6 100755 --- a/k8s-bootstrap-container/load-blueprints.sh +++ b/k8s-bootstrap-container/load-blueprints.sh @@ -30,7 +30,9 @@ k8s-ves.yaml \ k8s-snmptrap.yaml \ k8s-prh.yaml \ k8s-hv-ves.yaml \ -k8s-datafile-collector.yaml +k8s-helm-override.yaml \ +k8s-helm.yaml \ +k8s-dashboard.yaml " BPDEST=blueprints diff --git a/k8s-bootstrap-container/pom.xml b/k8s-bootstrap-container/pom.xml index dc7393a..98ce298 100644 --- a/k8s-bootstrap-container/pom.xml +++ b/k8s-bootstrap-container/pom.xml @@ -27,7 +27,7 @@ limitations under the License. org.onap.dcaegen2.deployments k8s-bootstrap-container dcaegen2-deployments-k8s-bootstrap-container - 1.4.11 + 1.4.12 http://maven.apache.org UTF-8 diff --git a/pnda-bootstrap-container/README.md b/pnda-bootstrap-container/README.md deleted file mode 100644 index 43e089e..0000000 --- a/pnda-bootstrap-container/README.md +++ /dev/null @@ -1,8 +0,0 @@ -# PNDA Boostrap container -## Purpose -The artifacts in this directory build a Docker image including the PNDA CLI. -The CLI allows the bootstrap of a PNDA container. - -## Running the Container -The container is intended to be launched via a Helm chart as part -of the ONAP deployment process, guided by OOM. diff --git a/pnda-bootstrap-container/pom.xml b/pnda-bootstrap-container/pom.xml deleted file mode 100644 index 3c8dae5..0000000 --- a/pnda-bootstrap-container/pom.xml +++ /dev/null @@ -1,144 +0,0 @@ - - - - 4.0.0 - - org.onap.dcaegen2.deployments - deployments - 1.2.0-SNAPSHOT - - org.onap.dcaegen2.deployments - pnda-bootstrap-container - dcaegen2-deployments-pnda-bootstrap-container - 5.0.0 - http://maven.apache.org - - UTF-8 - true - . - py - Python - **/*.py - - - ${project.artifactId}-${project.version} - - - - org.codehaus.mojo - exec-maven-plugin - 1.2.1 - - - clean phase script - clean - - exec - - - - ${project.artifactId} - clean - - - - - generate-sources script - generate-sources - - exec - - - - ${project.artifactId} - generate-sources - - - - - compile script - compile - - exec - - - - ${project.artifactId} - compile - - - - - package script - package - - exec - - - - ${project.artifactId} - package - - - - - test script - test - - exec - - - - ${project.artifactId} - test - - - - - install script - install - - exec - - - - ${project.artifactId} - install - - - - - deploy script - deploy - - exec - - - - ${project.artifactId} - deploy - - - - - - - - diff --git a/pnda-mirror-container/Dockerfile b/pnda-mirror-container/Dockerfile deleted file mode 100644 index ea7e100..0000000 --- a/pnda-mirror-container/Dockerfile +++ /dev/null @@ -1,47 +0,0 @@ -# ============LICENSE_START======================================================= -# org.onap.dcae -# ================================================================================ -# Copyright (c) 2018 Cisco Systems. All rights reserved. -# ================================================================================ -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============LICENSE_END========================================================= - -FROM centos:7.5.1804 as build - -ARG PNDARELEASE=release/5.0 -# Can be HDP or CDH -ARG HADOOPDIST=HDP - -RUN yum clean all && rm -rf /var/cache/yum/* && yum install gettext git -y - -RUN git clone -b $PNDARELEASE https://github.com/pndaproject/pnda.git - -COPY pnda-5.0-maint.patch / -WORKDIR /pnda -RUN git apply /pnda-5.0-maint.patch - -WORKDIR /pnda/mirror -# Add the -r flag to mirror rpm packages -RUN ./create_mirror.sh -d $HADOOPDIST -r - -WORKDIR /pnda/build -RUN ./install-build-tools.sh - -RUN yum install bzip2 make which -y -RUN source ./set-pnda-env.sh \ - && PARALLEL="--jobs 1" ./build-pnda.sh RELEASE $PNDARELEASE $HADOOPDIST - -FROM nginx:alpine - -COPY --from=build /pnda/mirror/mirror-dist /usr/share/nginx/html/ -COPY --from=build /pnda/build/pnda-dist /usr/share/nginx/html/ diff --git a/pnda-mirror-container/README.md b/pnda-mirror-container/README.md deleted file mode 100644 index 6312439..0000000 --- a/pnda-mirror-container/README.md +++ /dev/null @@ -1,23 +0,0 @@ -# PNDA Mirror -## Purpose -The artifacts in this directory build a Docker image based public PNDA mirror -creation scripts. The container have all the needed offline resources to -deploy a PNDA platform. - -## Running the Container -The container is intended to be launched via a Helm chart as part -of the ONAP deployment process, guided by OOM. It can be run directly -into a native Docker environment, using: -``` -docker run --name pnda-mirror -d --restart unless-stopped \ - -v /sys/fs/cgroup:/sys/fs/cgroup:ro \ - -p :8080 \ - --tmpfs /run \ - --tmpfs /run/lock \ - --security-opt seccomp:unconfined - --cap-add SYS_ADMIN \ - -``` - -We also expect that in a Kubernetes environment the external port mapping would not be -needed. diff --git a/pnda-mirror-container/pnda-5.0-maint.patch b/pnda-mirror-container/pnda-5.0-maint.patch deleted file mode 100644 index 8dc4af1..0000000 --- a/pnda-mirror-container/pnda-5.0-maint.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/mirror/dependencies/pnda-static-file-dependencies.txt b/mirror/dependencies/pnda-static-file-dependencies.txt -index 8f04a87..133e08b 100644 ---- a/mirror/dependencies/pnda-static-file-dependencies.txt -+++ b/mirror/dependencies/pnda-static-file-dependencies.txt -@@ -21,5 +21,5 @@ http://central.maven.org/maven2/org/kitesdk/kite-tools/1.0.0/kite-tools-1.0.0-bi - http://central.maven.org/maven2/org/kitesdk/kite-tools/1.0.0/kite-tools-1.0.0-binary.jar.sha1 - https://releases.hashicorp.com/consul/1.0.3/consul_1.0.3_linux_amd64.zip - https://releases.hashicorp.com/consul/1.0.3/consul_1.0.3_SHA256SUMS --http://www.apache.org/dist/knox/1.1.0/knox-1.1.0.zip --http://www.apache.org/dist/knox/1.1.0/knox-1.1.0.zip.sha1 -+http://archive.apache.org/dist/knox/1.1.0/knox-1.1.0.zip -+http://archive.apache.org/dist/knox/1.1.0/knox-1.1.0.zip.sha1 - diff --git a/pnda-mirror-container/pom.xml b/pnda-mirror-container/pom.xml deleted file mode 100644 index 7ccabb5..0000000 --- a/pnda-mirror-container/pom.xml +++ /dev/null @@ -1,144 +0,0 @@ - - - - 4.0.0 - - org.onap.dcaegen2.deployments - deployments - 1.2.0-SNAPSHOT - - org.onap.dcaegen2.deployments - pnda-mirror-container - dcaegen2-deployments-pnda-mirror-container - 5.0.0 - http://maven.apache.org - - UTF-8 - true - . - py - Python - **/*.py - - - ${project.artifactId}-${project.version} - - - - org.codehaus.mojo - exec-maven-plugin - 1.2.1 - - - clean phase script - clean - - exec - - - - ${project.artifactId} - clean - - - - - generate-sources script - generate-sources - - exec - - - - ${project.artifactId} - generate-sources - - - - - compile script - compile - - exec - - - - ${project.artifactId} - compile - - - - - package script - package - - exec - - - - ${project.artifactId} - package - - - - - test script - test - - exec - - - - ${project.artifactId} - test - - - - - install script - install - - exec - - - - ${project.artifactId} - install - - - - - deploy script - deploy - - exec - - - - ${project.artifactId} - deploy - - - - - - - - diff --git a/pom.xml b/pom.xml index ee0e322..e0489ba 100644 --- a/pom.xml +++ b/pom.xml @@ -36,7 +36,6 @@ limitations under the License. pom - heat redis-cluster-container cm-container k8s-bootstrap-container @@ -46,7 +45,7 @@ limitations under the License. consul-loader-container multisite-init-container - + UTF-8 diff --git a/settings.xml b/settings.xml new file mode 100644 index 0000000..3330608 --- /dev/null +++ b/settings.xml @@ -0,0 +1,206 @@ + + + /home/vagrant/.m2/repository + + + + openecomp-staging + + + openecomp-staging + openecomp-staging + https://nexus.onap.org/content/repositories/staging/ + + true + never + + + false + + + + + + openecomp-staging + openecomp-staging + https://nexus.onap.org/content/repositories/staging/ + + true + never + + + false + + + + + + openecomp-public + + + openecomp-public + openecomp-public + https://nexus.onap.org/content/repositories/public/ + + true + never + + + false + + + + + + openecomp-public + openecomp-public + https://nexus.onap.org/content/repositories/public/ + + true + never + + + false + + + + + + openecomp-release + + + openecomp-release + openecomp-release + https://nexus.onap.org/content/repositories/releases/ + + true + never + + + false + + + + + + openecomp-release + openecomp-release + https://nexus.onap.org/content/repositories/releases/ + + true + never + + + false + + + + + + + openecomp-snapshots + + + openecomp-snapshot + openecomp-snapshot + https://nexus.onap.org/content/repositories/snapshots/ + + false + + + true + + + + + + openecomp-snapshot + openecomp-snapshot + https://nexus.onap.org/content/repositories/snapshots/ + + false + + + true + + + + + + opendaylight-release + + + opendaylight-mirror + opendaylight-mirror + https://nexus.opendaylight.org/content/repositories/public/ + + true + never + + + false + + + + + + opendaylight-mirror + opendaylight-mirror + https://nexus.opendaylight.org/content/repositories/public/ + + true + never + + + false + + + + + + + opendaylight-snapshots + + + opendaylight-snapshot + opendaylight-snapshot + https://nexus.opendaylight.org/content/repositories/opendaylight.snapshot/ + + false + + + true + + + + + + opendaylight-snapshot + opendaylight-snapshot + https://nexus.opendaylight.org/content/repositories/opendaylight.snapshot/ + + false + + + true + + + + + + + + + openecomp-staging + openecomp-public + openecomp-release + openecomp-snapshots + + + + diff --git a/pnda-bootstrap-container/Dockerfile b/tls-init-container/Dockerfile similarity index 59% rename from pnda-bootstrap-container/Dockerfile rename to tls-init-container/Dockerfile index 4fefa8a..366276d 100644 --- a/pnda-bootstrap-container/Dockerfile +++ b/tls-init-container/Dockerfile @@ -1,7 +1,7 @@ # ============LICENSE_START======================================================= # org.onap.dcae # ================================================================================ -# Copyright (c) 2018 Cisco Systems. All rights reserved. +# Copyright (c) 2018 AT&T Intellectual Property. All rights reserved. # ================================================================================ # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -15,20 +15,9 @@ # See the License for the specific language governing permissions and # limitations under the License. # ============LICENSE_END========================================================= - -FROM python:2.7.15 as build - -ARG PNDACLITAG=release/5.0 -ARG PLATFORMSALTTAG=release/5.0 - -RUN git clone -b $PNDACLITAG https://github.com/pndaproject/pnda-cli.git -RUN git clone -b $PLATFORMSALTTAG https://github.com/pndaproject/platform-salt.git - -RUN pip2 install --no-cache-dir -r pnda-cli/cli/requirements.txt --install-option="--prefix=/install" - -FROM python:2.7.15-alpine3.8 -COPY --from=build /install /usr/local -COPY --from=build /pnda-cli /pnda-cli -COPY --from=build /platform-salt /platform-salt - -RUN apk add --no-cache curl jq openssl openssh +FROM busybox +RUN mkdir -p /opt/tls/source && mkdir -p /opt/tls/shared +COPY ./tls /opt/tls/source +RUN base64 -d /opt/tls/source/trust.jks.b64 > /opt/tls/source/trust.jks && base64 -d /opt/tls/source/cert.jks.b64 > /opt/tls/source/cert.jks && base64 -d /opt/tls/source/cert.p12.b64 > /opt/tls/source/cert.p12 +COPY setup-tls.sh /opt/tls +ENTRYPOINT ["/opt/tls/setup-tls.sh"]