| Jeremy Mordkoff | 6f07e6f | 2016-09-07 18:56:51 -0400 | [diff] [blame] | 1 | #! /bin/bash |
| 2 | |
| 3 | set -e |
| 4 | set -x |
| 5 | |
| 6 | SOURCE_DIR=@CMAKE_CURRENT_SOURCE_DIR@ |
| 7 | BINARY_DIR=@CMAKE_CURRENT_BINARY_DIR@ |
| 8 | PROJECT_TOP_DIR=@PROJECT_TOP_DIR@ |
| 9 | QCOW_IMAGE=${RIFT_ROOT}/images/Fedora-x86_64-20-20131211.1-sda.qcow2 |
| 10 | RIFT_QCOW_IMAGE=${RIFT_ROOT}/images/Fedora-x86_64-20-20131211.1-sda.qcow2 |
| 11 | PONG_QCOW_IMAGE=${RIFT_ROOT}/images/Fedora-x86_64-20-20131211.1-sda-pong.qcow2 |
| 12 | PING_QCOW_IMAGE=${RIFT_ROOT}/images/Fedora-x86_64-20-20131211.1-sda-ping.qcow2 |
| 13 | |
| 14 | # These paths are needed for finding the overrides and so files |
| Philip Joseph | 06ba382 | 2016-09-16 07:24:18 -0400 | [diff] [blame] | 15 | PYTHONPATH=@RIFT_SUBMODULE_SOURCE_ROOT@/rwvcs/ra:@RIFT_SUBMODULE_BINARY_ROOT@/models/plugins/yang:${PYTHONPATH} |
| 16 | PYTHON3PATH=@RIFT_SUBMODULE_SOURCE_ROOT@/rwvcs/ra:@RIFT_SUBMODULE_BINARY_ROOT@/models/plugins/yang:${PYTHON3PATH} |
| 17 | LD_LIBRARY_PATH=@RIFT_SUBMODULE_BINARY_ROOT@/models/plugins/yang:@RIFT_SUBMODULE_BINARY_ROOT@/common/plugins/yang:${LD_LIBRARY_PATH} |
| Jeremy Mordkoff | 6f07e6f | 2016-09-07 18:56:51 -0400 | [diff] [blame] | 18 | |
| 19 | #Rift Logos |
| 20 | PING_VNFD_LOGO=${SOURCE_DIR}/rift_logo.png |
| 21 | PONG_VNFD_LOGO=${SOURCE_DIR}/rift_logo.png |
| 22 | PING_PONG_NSD_LOGO=${SOURCE_DIR}/rift_logo.png |
| 23 | |
| 24 | # Remove any old directories |
| 25 | rm -rf ${BINARY_DIR}/ping_vnfd |
| 26 | rm -rf ${BINARY_DIR}/pong_vnfd |
| 27 | rm -rf ${BINARY_DIR}/ping_pong_nsd |
| 28 | |
| 29 | rm -rf ${BINARY_DIR}/ping_vnfd_with_image |
| 30 | rm -rf ${BINARY_DIR}/pong_vnfd_with_image |
| 31 | |
| 32 | |
| 33 | rm -rf ${BINARY_DIR}/ping_vnfd_aws |
| 34 | rm -rf ${BINARY_DIR}/pong_vnfd_aws |
| 35 | rm -rf ${BINARY_DIR}/ping_pong_nsd_aws |
| 36 | |
| 37 | rm -rf ${BINARY_DIR}/ping_vnfd_with_epa |
| 38 | rm -rf ${BINARY_DIR}/pong_vnfd_with_epa |
| 39 | rm -rf ${BINARY_DIR}/ping_pong_nsd_with_epa |
| 40 | |
| Jeremy Mordkoff | 4870d0e | 2017-09-30 20:28:33 -0400 | [diff] [blame] | 41 | rm -rf ${BINARY_DIR}/ping_vnfd_with_vca |
| 42 | rm -rf ${BINARY_DIR}/pong_vnfd_with_vca |
| 43 | rm -rf ${BINARY_DIR}/ping_pong_nsd_with_vca |
| 44 | |
| 45 | rm -rf ${BINARY_DIR}/ping_vnfd_with_vip |
| 46 | rm -rf ${BINARY_DIR}/pong_vnfd_with_vip |
| 47 | rm -rf ${BINARY_DIR}/ping_pong_nsd_with_vip |
| 48 | |
| 49 | rm -rf ${BINARY_DIR}/ping_vnfd_with_scaling |
| 50 | rm -rf ${BINARY_DIR}/pong_vnfd_with_scaling |
| 51 | rm -rf ${BINARY_DIR}/ping_pong_nsd_with_scaling |
| 52 | |
| 53 | rm -rf ${BINARY_DIR}/ping_vnfd_with_vnf_input_parameters |
| 54 | rm -rf ${BINARY_DIR}/pong_vnfd_with_vnf_input_parameters |
| 55 | rm -rf ${BINARY_DIR}/ping_pong_nsd_with_vnf_input_parameters |
| 56 | |
| Jeremy Mordkoff | 6f07e6f | 2016-09-07 18:56:51 -0400 | [diff] [blame] | 57 | |
| 58 | # Generate image md5sum |
| 59 | ping_md5sum="$(md5sum ${PING_QCOW_IMAGE} | cut -f1 -d" ")" |
| 60 | pong_md5sum="$(md5sum ${PONG_QCOW_IMAGE} | cut -f1 -d" ")" |
| 61 | |
| 62 | # Generate the descriptors (in various formats) |
| 63 | ${SOURCE_DIR}/ping_pong_nsd.py --outdir=${BINARY_DIR} --format=yaml --ping-image-md5=${ping_md5sum} --pong-image-md5=${pong_md5sum} --pong-cloud-init=pong_cloud_init.cfg --ping-cloud-init=ping_cloud_init.cfg |
| 64 | |
| 65 | |
| 66 | # create directories for packages with images |
| 67 | cp -r ${BINARY_DIR}/ping_vnfd ${BINARY_DIR}/ping_vnfd_with_image |
| 68 | cp -r ${BINARY_DIR}/pong_vnfd ${BINARY_DIR}/pong_vnfd_with_image |
| 69 | mkdir -p ${BINARY_DIR}/ping_vnfd_with_image/images |
| 70 | mkdir -p ${BINARY_DIR}/pong_vnfd_with_image/images |
| Jeremy Mordkoff | 6f07e6f | 2016-09-07 18:56:51 -0400 | [diff] [blame] | 71 | ### Generate descriptors for AWS |
| Jeremy Mordkoff | 4870d0e | 2017-09-30 20:28:33 -0400 | [diff] [blame] | 72 | ${SOURCE_DIR}/ping_pong_nsd.py --outdir=${BINARY_DIR}/aws --format=yaml --aws |
| Jeremy Mordkoff | 6f07e6f | 2016-09-07 18:56:51 -0400 | [diff] [blame] | 73 | |
| 74 | ### Move the generated artifacts to appropriate directories |
| 75 | mv ${BINARY_DIR}/aws/ping_vnfd ${BINARY_DIR}/ping_vnfd_aws |
| 76 | mv ${BINARY_DIR}/aws/pong_vnfd ${BINARY_DIR}/pong_vnfd_aws |
| 77 | mv ${BINARY_DIR}/aws/ping_pong_nsd ${BINARY_DIR}/ping_pong_nsd_aws |
| 78 | |
| 79 | ### ReMove the original directories |
| 80 | rm -rf ${BINARY_DIR}/aws |
| 81 | |
| Jeremy Mordkoff | 4870d0e | 2017-09-30 20:28:33 -0400 | [diff] [blame] | 82 | ### Generate descriptors for VNF Input Parameters |
| 83 | ${SOURCE_DIR}/ping_pong_nsd.py --outdir=${BINARY_DIR}/vnf_input_parameters --format=yaml --ping-image-md5=${ping_md5sum} --pong-image-md5=${pong_md5sum} --pong-cloud-init=pong_cloud_init.cfg --ping-cloud-init=ping_cloud_init.cfg --vnf-input-parameter |
| 84 | |
| 85 | ### Move the generated artifacts to appropriate directories |
| 86 | mv ${BINARY_DIR}/vnf_input_parameters/ping_vnfd ${BINARY_DIR}/ping_vnfd_with_vnf_input_parameters |
| 87 | mv ${BINARY_DIR}/vnf_input_parameters/pong_vnfd ${BINARY_DIR}/pong_vnfd_with_vnf_input_parameters |
| 88 | mv ${BINARY_DIR}/vnf_input_parameters/ping_pong_nsd ${BINARY_DIR}/ping_pong_nsd_with_vnf_input_parameters |
| 89 | |
| 90 | ### ReMove the original directories |
| 91 | rm -rf ${BINARY_DIR}/vnf_input_parameters |
| 92 | |
| Jeremy Mordkoff | 6f07e6f | 2016-09-07 18:56:51 -0400 | [diff] [blame] | 93 | ### Generate descriptors with EPA |
| Jeremy Mordkoff | 4870d0e | 2017-09-30 20:28:33 -0400 | [diff] [blame] | 94 | ${SOURCE_DIR}/ping_pong_nsd.py --outdir=${BINARY_DIR}/with_epa --format=yaml --epa --ping-image-md5=${ping_md5sum} --pong-image-md5=${pong_md5sum} |
| Jeremy Mordkoff | 6f07e6f | 2016-09-07 18:56:51 -0400 | [diff] [blame] | 95 | |
| 96 | ### Move the generated artifacts to appropriate directories |
| 97 | mv ${BINARY_DIR}/with_epa/ping_vnfd ${BINARY_DIR}/ping_vnfd_with_epa |
| 98 | mv ${BINARY_DIR}/with_epa/pong_vnfd ${BINARY_DIR}/pong_vnfd_with_epa |
| 99 | mv ${BINARY_DIR}/with_epa/ping_pong_nsd ${BINARY_DIR}/ping_pong_nsd_with_epa |
| 100 | |
| 101 | ### ReMove the original directories |
| 102 | rm -rf ${BINARY_DIR}/with_epa |
| 103 | |
| Jeremy Mordkoff | 4870d0e | 2017-09-30 20:28:33 -0400 | [diff] [blame] | 104 | ### Generate descriptors with VCA conf |
| 105 | ${SOURCE_DIR}/ping_pong_nsd.py --outdir=${BINARY_DIR}/with_vca --format=yaml --vca_conf --ping-image-md5=${ping_md5sum} --pong-image-md5=${pong_md5sum} |
| 106 | |
| 107 | ### Move the generated artifacts to appropriate directories |
| 108 | mv ${BINARY_DIR}/with_vca/ping_vnfd ${BINARY_DIR}/ping_vnfd_with_vca |
| 109 | mv ${BINARY_DIR}/with_vca/pong_vnfd ${BINARY_DIR}/pong_vnfd_with_vca |
| 110 | mv ${BINARY_DIR}/with_vca/ping_pong_nsd ${BINARY_DIR}/ping_pong_nsd_with_vca |
| 111 | |
| 112 | ### ReMove the original directories |
| 113 | rm -rf ${BINARY_DIR}/with_vca |
| 114 | |
| 115 | ### Generate descriptors with Virtual-IP |
| 116 | ${SOURCE_DIR}/ping_pong_nsd.py --outdir=${BINARY_DIR}/with_vip --format=yaml --virtual-ip --ping-image-md5=${ping_md5sum} --pong-image-md5=${pong_md5sum} |
| 117 | |
| 118 | ### Move the generated artifacts to appropriate directories |
| 119 | mv ${BINARY_DIR}/with_vip/ping_vnfd ${BINARY_DIR}/ping_vnfd_with_vip |
| 120 | mv ${BINARY_DIR}/with_vip/pong_vnfd ${BINARY_DIR}/pong_vnfd_with_vip |
| 121 | mv ${BINARY_DIR}/with_vip/ping_pong_nsd ${BINARY_DIR}/ping_pong_nsd_with_vip |
| 122 | |
| 123 | ### ReMove the original directories |
| 124 | rm -rf ${BINARY_DIR}/with_vip |
| 125 | |
| 126 | ### Generate descriptors with scaling |
| 127 | ${SOURCE_DIR}/ping_pong_nsd.py --outdir=${BINARY_DIR}/with_scaling --format=yaml --scale --ping-image-md5=${ping_md5sum} --pong-image-md5=${pong_md5sum} |
| 128 | |
| 129 | ### Move the generated artifacts to appropriate directories |
| 130 | mv ${BINARY_DIR}/with_scaling/ping_vnfd ${BINARY_DIR}/ping_vnfd_with_scaling |
| 131 | mv ${BINARY_DIR}/with_scaling/pong_vnfd ${BINARY_DIR}/pong_vnfd_with_scaling |
| 132 | mv ${BINARY_DIR}/with_scaling/ping_pong_nsd ${BINARY_DIR}/ping_pong_nsd_with_scaling |
| 133 | |
| 134 | ### ReMove the original directories |
| 135 | rm -rf ${BINARY_DIR}/with_scaling |
| 136 | |
| 137 | |
| Jeremy Mordkoff | 6f07e6f | 2016-09-07 18:56:51 -0400 | [diff] [blame] | 138 | # copy a dummy image for now |
| 139 | if [ -e ${PING_QCOW_IMAGE} ]; then |
| 140 | # Add RIFT Logos |
| 141 | mkdir -p ${BINARY_DIR}/ping_vnfd_with_image/icons |
| 142 | cp ${PING_VNFD_LOGO} ${BINARY_DIR}/ping_vnfd_with_image/icons/ |
| 143 | |
| 144 | cp ${PING_QCOW_IMAGE} ${BINARY_DIR}/ping_vnfd_with_image/images/ |
| 145 | ${RIFT_INSTALL}/usr/rift/toolchain/cmake/bin/generate_descriptor_pkg.sh ${BINARY_DIR} ping_vnfd_with_image |
| 146 | else |
| 147 | echo >&2 "Warn: Skipped creating ping_vnfd_with_image due to missing image: ${PING_QCOW_IMAGE}" |
| 148 | fi |
| 149 | |
| 150 | if [ -e ${PONG_QCOW_IMAGE} ]; then |
| 151 | # Add RIFT Logos |
| 152 | mkdir -p ${BINARY_DIR}/pong_vnfd_with_image/icons |
| 153 | cp ${PONG_VNFD_LOGO} ${BINARY_DIR}/pong_vnfd_with_image/icons/ |
| 154 | |
| 155 | cp ${PONG_QCOW_IMAGE} ${BINARY_DIR}/pong_vnfd_with_image/images/ |
| 156 | ${RIFT_INSTALL}/usr/rift/toolchain/cmake/bin/generate_descriptor_pkg.sh ${BINARY_DIR} pong_vnfd_with_image |
| 157 | else |
| 158 | echo >&2 "Warn: Skipped creating pong_vnfd_with_image due to missing image: ${PONG_QCOW_IMAGE}" |
| 159 | fi |
| 160 | |
| 161 | # Add RIFT Logos |
| 162 | mkdir -p ${BINARY_DIR}/ping_vnfd/icons |
| 163 | mkdir -p ${BINARY_DIR}/pong_vnfd/icons |
| 164 | mkdir -p ${BINARY_DIR}/ping_pong_nsd/icons |
| 165 | |
| 166 | cp ${PING_VNFD_LOGO} ${BINARY_DIR}/ping_vnfd/icons/ |
| 167 | cp ${PONG_VNFD_LOGO} ${BINARY_DIR}/pong_vnfd/icons/ |
| 168 | cp ${PING_PONG_NSD_LOGO} ${BINARY_DIR}/ping_pong_nsd/icons/ |
| 169 | |
| 170 | # Generate the tar files |
| 171 | ${RIFT_INSTALL}/usr/rift/toolchain/cmake/bin/generate_descriptor_pkg.sh ${BINARY_DIR} ping_vnfd |
| 172 | ${RIFT_INSTALL}/usr/rift/toolchain/cmake/bin/generate_descriptor_pkg.sh ${BINARY_DIR} pong_vnfd |
| 173 | ${RIFT_INSTALL}/usr/rift/toolchain/cmake/bin/generate_descriptor_pkg.sh ${BINARY_DIR} ping_pong_nsd |
| 174 | |
| 175 | |
| 176 | # Add RIFT Logos |
| 177 | mkdir -p ${BINARY_DIR}/ping_vnfd_aws/icons |
| 178 | mkdir -p ${BINARY_DIR}/pong_vnfd_aws/icons |
| 179 | mkdir -p ${BINARY_DIR}/ping_pong_nsd_aws/icons |
| 180 | |
| 181 | cp ${PING_VNFD_LOGO} ${BINARY_DIR}/ping_vnfd_aws/icons/ |
| 182 | cp ${PONG_VNFD_LOGO} ${BINARY_DIR}/pong_vnfd_aws/icons/ |
| 183 | cp ${PING_PONG_NSD_LOGO} ${BINARY_DIR}/ping_pong_nsd_aws/icons/ |
| 184 | |
| 185 | ${RIFT_INSTALL}/usr/rift/toolchain/cmake/bin/generate_descriptor_pkg.sh ${BINARY_DIR} ping_vnfd_aws |
| 186 | ${RIFT_INSTALL}/usr/rift/toolchain/cmake/bin/generate_descriptor_pkg.sh ${BINARY_DIR} pong_vnfd_aws |
| 187 | ${RIFT_INSTALL}/usr/rift/toolchain/cmake/bin/generate_descriptor_pkg.sh ${BINARY_DIR} ping_pong_nsd_aws |
| 188 | |
| 189 | # Add RIFT Logos |
| Jeremy Mordkoff | 4870d0e | 2017-09-30 20:28:33 -0400 | [diff] [blame] | 190 | mkdir -p ${BINARY_DIR}/ping_vnfd_with_vnf_input_parameters/icons |
| 191 | mkdir -p ${BINARY_DIR}/pong_vnfd_with_vnf_input_parameters/icons |
| 192 | mkdir -p ${BINARY_DIR}/ping_pong_nsd_with_vnf_input_parameters/icons |
| 193 | |
| 194 | cp ${PING_VNFD_LOGO} ${BINARY_DIR}/ping_vnfd_with_vnf_input_parameters/icons/ |
| 195 | cp ${PONG_VNFD_LOGO} ${BINARY_DIR}/pong_vnfd_with_vnf_input_parameters/icons/ |
| 196 | cp ${PING_PONG_NSD_LOGO} ${BINARY_DIR}/ping_pong_nsd_with_vnf_input_parameters/icons/ |
| 197 | |
| 198 | ${RIFT_INSTALL}/usr/rift/toolchain/cmake/bin/generate_descriptor_pkg.sh ${BINARY_DIR} ping_vnfd_with_vnf_input_parameters |
| 199 | ${RIFT_INSTALL}/usr/rift/toolchain/cmake/bin/generate_descriptor_pkg.sh ${BINARY_DIR} pong_vnfd_with_vnf_input_parameters |
| 200 | ${RIFT_INSTALL}/usr/rift/toolchain/cmake/bin/generate_descriptor_pkg.sh ${BINARY_DIR} ping_pong_nsd_with_vnf_input_parameters |
| 201 | |
| 202 | # Add RIFT Logos |
| Jeremy Mordkoff | 6f07e6f | 2016-09-07 18:56:51 -0400 | [diff] [blame] | 203 | mkdir -p ${BINARY_DIR}/ping_vnfd_with_epa/icons |
| 204 | mkdir -p ${BINARY_DIR}/pong_vnfd_with_epa/icons |
| 205 | mkdir -p ${BINARY_DIR}/ping_pong_nsd_with_epa/icons |
| 206 | |
| 207 | cp ${PING_VNFD_LOGO} ${BINARY_DIR}/ping_vnfd_with_epa/icons/ |
| 208 | cp ${PONG_VNFD_LOGO} ${BINARY_DIR}/pong_vnfd_with_epa/icons/ |
| 209 | cp ${PING_PONG_NSD_LOGO} ${BINARY_DIR}/ping_pong_nsd_with_epa/icons/ |
| 210 | |
| 211 | ${RIFT_INSTALL}/usr/rift/toolchain/cmake/bin/generate_descriptor_pkg.sh ${BINARY_DIR} ping_vnfd_with_epa |
| 212 | ${RIFT_INSTALL}/usr/rift/toolchain/cmake/bin/generate_descriptor_pkg.sh ${BINARY_DIR} pong_vnfd_with_epa |
| 213 | ${RIFT_INSTALL}/usr/rift/toolchain/cmake/bin/generate_descriptor_pkg.sh ${BINARY_DIR} ping_pong_nsd_with_epa |
| Jeremy Mordkoff | 4870d0e | 2017-09-30 20:28:33 -0400 | [diff] [blame] | 214 | |
| 215 | # Add RIFT Logos |
| 216 | mkdir -p ${BINARY_DIR}/ping_vnfd_with_vca/icons |
| 217 | mkdir -p ${BINARY_DIR}/pong_vnfd_with_vca/icons |
| 218 | mkdir -p ${BINARY_DIR}/ping_pong_nsd_with_vca/icons |
| 219 | |
| 220 | cp ${PING_VNFD_LOGO} ${BINARY_DIR}/ping_vnfd_with_vca/icons/ |
| 221 | cp ${PONG_VNFD_LOGO} ${BINARY_DIR}/pong_vnfd_with_vca/icons/ |
| 222 | cp ${PING_PONG_NSD_LOGO} ${BINARY_DIR}/ping_pong_nsd_with_vca/icons/ |
| 223 | |
| 224 | ${RIFT_INSTALL}/usr/rift/toolchain/cmake/bin/generate_descriptor_pkg.sh ${BINARY_DIR} ping_vnfd_with_vca |
| 225 | ${RIFT_INSTALL}/usr/rift/toolchain/cmake/bin/generate_descriptor_pkg.sh ${BINARY_DIR} pong_vnfd_with_vca |
| 226 | ${RIFT_INSTALL}/usr/rift/toolchain/cmake/bin/generate_descriptor_pkg.sh ${BINARY_DIR} ping_pong_nsd_with_vca |
| 227 | |
| 228 | |
| 229 | mkdir -p ${BINARY_DIR}/ping_vnfd_with_vip/icons |
| 230 | mkdir -p ${BINARY_DIR}/pong_vnfd_with_vip/icons |
| 231 | mkdir -p ${BINARY_DIR}/ping_pong_nsd_with_vip/icons |
| 232 | |
| 233 | cp ${PING_VNFD_LOGO} ${BINARY_DIR}/ping_vnfd_with_vip/icons/ |
| 234 | cp ${PONG_VNFD_LOGO} ${BINARY_DIR}/pong_vnfd_with_vip/icons/ |
| 235 | cp ${PING_PONG_NSD_LOGO} ${BINARY_DIR}/ping_pong_nsd_with_vip/icons/ |
| 236 | |
| 237 | ${RIFT_INSTALL}/usr/rift/toolchain/cmake/bin/generate_descriptor_pkg.sh ${BINARY_DIR} ping_vnfd_with_vip |
| 238 | ${RIFT_INSTALL}/usr/rift/toolchain/cmake/bin/generate_descriptor_pkg.sh ${BINARY_DIR} pong_vnfd_with_vip |
| 239 | ${RIFT_INSTALL}/usr/rift/toolchain/cmake/bin/generate_descriptor_pkg.sh ${BINARY_DIR} ping_pong_nsd_with_vip |
| 240 | |
| 241 | mkdir -p ${BINARY_DIR}/ping_vnfd_with_scaling/icons |
| 242 | mkdir -p ${BINARY_DIR}/pong_vnfd_with_scaling/icons |
| 243 | mkdir -p ${BINARY_DIR}/ping_pong_nsd_with_scaling/icons |
| 244 | |
| 245 | cp ${PING_VNFD_LOGO} ${BINARY_DIR}/ping_vnfd_with_scaling/icons/ |
| 246 | cp ${PONG_VNFD_LOGO} ${BINARY_DIR}/pong_vnfd_with_scaling/icons/ |
| 247 | cp ${PING_PONG_NSD_LOGO} ${BINARY_DIR}/ping_pong_nsd_with_scaling/icons/ |
| 248 | |
| 249 | ${RIFT_INSTALL}/usr/rift/toolchain/cmake/bin/generate_descriptor_pkg.sh ${BINARY_DIR} ping_vnfd_with_scaling |
| 250 | ${RIFT_INSTALL}/usr/rift/toolchain/cmake/bin/generate_descriptor_pkg.sh ${BINARY_DIR} pong_vnfd_with_scaling |
| 251 | ${RIFT_INSTALL}/usr/rift/toolchain/cmake/bin/generate_descriptor_pkg.sh ${BINARY_DIR} ping_pong_nsd_with_scaling |