1 ##########################################################################
3 #==================LICENSE_START==========================================
6 # Copyright 2017 AT&T Intellectual Property. All rights reserved.
8 # Licensed under the Apache License, Version 2.0 (the "License");
9 # you may not use this file except in compliance with the License.
10 # You may obtain a copy of the License at
11 # http://www.apache.org/licenses/LICENSE-2.0
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.
19 #==================LICENSE_END============================================
21 # ECOMP is a trademark and service mark of AT&T Intellectual Property.
23 ##########################################################################
25 heat_template_version: 2013-05-23
27 description: Heat template to build vCPE vBRG Emulator (vBRGEMU)
29 #######################################################################
33 # 0_port should get IP address from DHCP discover through vBNG #
34 # DCAE is not monitoring the BRGEMULATOR #
35 #######################################################################
40 label: Image name or ID
41 description: Image to be used for compute instance
45 description: Type of instance (flavor) to be used
48 label: Public network name or ID
49 description: Public network that enables remote connection to VNF
53 description: Name of the vBRG
57 description: The VNF ID is provided by ONAP
61 description: The vCPE Module ID is provided by ONAP
65 description: Public/Private key pair name
69 description: Public key to be installed on the compute instance
72 label: Build script version number
73 description: Version number of the scripts that builds the vFW demo app
74 demo_artifacts_version:
76 label: Artifacts version used in demo vnfs
77 description: Artifacts (jar, tar.gz) version used in demo vnfs
80 description: Root URL for the Nexus repository for Maven artifacts.
81 default: "https://nexus.onap.org"
84 label: Cloud environment
85 description: Cloud environment (e.g., openstack, rackspace)
88 label: VPP Source Git Repo
89 description: URL for VPP source codes
90 vpp_source_repo_release_tag:
92 label: VPP Source Git Release Tag
93 description: Git Release Tag for the VPP source codes
94 hc2vpp_source_repo_url:
96 label: Honeycomb Source Git Repo
97 description: URL for Honeycomb source codes
98 hc2vpp_source_repo_release_tag:
100 label: Honeycomb Source Git Release Tag
101 description: Git Release Tag for the Honeycomb source codes
105 description: URL for VPP patch for vBRG Emulator
109 description: State to compile code or not; included for backwards compatibility
121 type: OS::Heat::RandomString
126 type: OS::Nova::KeyPair
132 base: { get_param: key_name }
133 rand: { get_resource: random-str }
134 public_key: { get_param: pub_key }
135 save_private_key: false
138 type: OS::Nova::Server
140 image: { get_param: vcpe_image_name }
141 flavor: { get_param: vcpe_flavor_name }
142 name: { get_param: vbrgemu_name_0 }
143 key_name: { get_resource: my_keypair }
145 - network: { get_param: public_net_id }
146 metadata: {vnf_id: { get_param: vnf_id }, vf_module_id: { get_param: vf_module_id }}
147 user_data_format: RAW
151 __demo_artifacts_version__: { get_param: demo_artifacts_version }
152 __script_version__: { get_param: script_version }
153 __cloud_env__: { get_param: cloud_env }
154 __vpp_source_repo_url__: { get_param: vpp_source_repo_url }
155 __vpp_source_repo_release_tag__: { get_param: vpp_source_repo_release_tag }
156 __hc2vpp_source_repo_url__: { get_param: hc2vpp_source_repo_url }
157 __hc2vpp_source_repo_release_tag__: { get_param: hc2vpp_source_repo_release_tag }
158 __vpp_patch_url__: { get_param: vpp_patch_url }
159 __compile_state__: { get_param: compile_state }
160 __nexus_artifact_repo__: { get_param: nexus_artifact_repo }
164 # Create configuration files
166 echo "__demo_artifacts_version__" > /opt/config/demo_artifacts_version.txt
167 echo "__script_version__" > /opt/config/script_version.txt
168 echo "__cloud_env__" > /opt/config/cloud_env.txt
169 echo "__vpp_source_repo_url__" > /opt/config/vpp_source_repo_url.txt
170 echo "__vpp_source_repo_release_tag__" > /opt/config/vpp_source_repo_release_tag.txt
171 echo "__hc2vpp_source_repo_url__" > /opt/config/hc2vpp_source_repo_url.txt
172 echo "__hc2vpp_source_repo_release_tag__" > /opt/config/hc2vpp_source_repo_release_tag.txt
173 echo "__vpp_patch_url__" > /opt/config/vpp_patch_url.txt
174 echo "__compile_state__" > /opt/config/compile_state.txt
175 echo "__nexus_artifact_repo__" > /opt/config/nexus_artifact_repo.txt
177 # Download and run install script
179 apt-get -y install unzip
180 if [[ "__script_version__" =~ "SNAPSHOT" ]]; then REPO=snapshots; else REPO=releases; fi
181 curl -k -L "__nexus_artifact_repo__/service/local/artifact/maven/redirect?r=${REPO}&g=org.onap.demo.vnf.vcpe&a=vcpe-scripts&e=zip&v=__script_version__" -o /opt/vcpe-scripts-__script_version__.zip
182 unzip -j /opt/vcpe-scripts-__script_version__.zip -d /opt v_brgemu_build.sh
184 chmod +x v_brgemu_build.sh