4 NEXUS_USERNAME=$(cat /opt/config/nexus_username.txt)
5 NEXUS_PASSWD=$(cat /opt/config/nexus_password.txt)
6 NEXUS_DOCKER_REPO=$(cat /opt/config/nexus_docker_repo.txt)
7 CASS_MUSIC_IMAGE_VERSION=$(cat /opt/config/cass_version.txt)
8 MUSIC_IMAGE_VERSION=$(cat /opt/config/music_version.txt)
9 HAS_IMAGE_VERSION=$(cat /opt/config/has_docker_version.txt)
10 OSDF_IMAGE_VERSION=$(cat /opt/config/osdf_docker_version.txt)
15 COND_CONF=/opt/optf-has/conductor.conf
16 LOG_CONF=/opt/optf-has/log.conf
18 # Certification file for OOF-HAS
19 AAI_cert=/usr/local/bin/AAF_RootCA.cer
20 BUNDLE=/opt/optf-has/AAF_RootCA.cer
22 OSDF_IMG=${NEXUS_DOCKER_REPO}/onap/optf-osdf:${OSDF_IMAGE_VERSION}
23 HAS_IMG=${NEXUS_DOCKER_REPO}/onap/optf-has:${HAS_IMAGE_VERSION}
25 # pull OOF images from repo
26 docker login -u $NEXUS_USERNAME -p $NEXUS_PASSWD $NEXUS_DOCKER_REPO
27 docker pull ${OSDF_IMG}
28 docker pull ${HAS_IMG}
32 CASS_IMG=${NEXUS_DOCKER_REPO}/onap/music/cassandra_music:$CASS_MUSIC_IMAGE_VERSION
33 MUSIC_IMG=${NEXUS_DOCKER_REPO}/onap/music/music:$MUSIC_IMAGE_VERSION
34 TOMCAT_IMG=library/tomcat:8.5
35 ZK_IMG=library/zookeeper:3.4
36 WORK_DIR=/opt/optf-has
37 CASS_USERNAME=cassandra1
38 CASS_PASSWORD=cassandra1
42 docker pull ${TOMCAT_IMG}
43 docker pull ${CASS_IMG}
44 docker pull ${MUSIC_IMG}
46 # create directory for music properties and logs
47 mkdir -p /opt/optf-has/music/properties
48 mkdir -p /opt/optf-has/music/logs
50 # add music.properties file
51 cat > /opt/optf-has/music/properties/music.properties<<NEWFILE
54 my.public.ip=localhost
55 all.public.ips=localhost
57 #######################################
59 # Optional current values are defaults
61 #######################################
62 zookeeper.host=music-zk
63 cassandra.host=music-db
66 #music.rest.ip=localhost
67 #lock.lease.period=6000
68 cassandra.user=cassandra1
69 cassandra.password=cassandra1
71 # AAF Endpoint if using AAF
72 aaf.endpoint.url=https://aaf.api.simpledemo.onap.org
75 # Create Volume for mapping war file and tomcat
76 docker volume create music-vol
78 # Create a network for all the containers to run in.
79 docker network create music-net
82 docker run -d --rm --name music-db --network music-net -p "7000:7000" -p "7001:7001" -p "7199:7199" -p "9042:9042" -p "9160:9160" -e CASSUSER=${CASS_USERNAME} -e CASSPASS=${CASS_PASSWORD} ${CASS_IMG}
85 docker run -d --rm --name music-war -v music-vol:/app ${MUSIC_IMG}
88 docker run -d --rm --name music-zk --network music-net -p "2181:2181" -p "2888:2888" -p "3888:3888" ${ZK_IMG}
93 # Start Up tomcat - Needs to have properties,logs dir and war file volume mapped.
94 docker run -d --rm --name music-tomcat --network music-net -p "8080:8080" -v music-vol:/usr/local/tomcat/webapps -v ${WORK_DIR}/music/properties:/opt/app/music/etc:ro -v ${WORK_DIR}/music/logs:/opt/app/music/logs ${TOMCAT_IMG}
96 # Connect tomcat to host bridge network so that its port can be seen.
97 docker network connect bridge music-tomcat;
99 echo "Running onboarding curl command"
101 http://localhost:8080/MUSIC/rest/v2/admin/onboardAppWithMusic \
102 -H 'Cache-Control: no-cache' \
103 -H 'Content-Type: application/json' \
104 -H 'Postman-Token: 7d2839f4-b032-487a-8998-4d1b27a932d7' \
106 "appname": "conductor",
107 "userId" : "conductor",
109 "password" : "c0nduct0r"
112 echo "Onboarding curl complete"
115 MUSIC_URL=$(docker inspect --format '{{ .NetworkSettings.Networks.bridge.IPAddress}}' music-tomcat)
118 # Set A&AI and MUSIC url inside OOF-HAS conductor.conf
119 sed -i "147 s%.*%aaf_url = http://aaf.api.simpledemo.onap.org:8100/authz/perms/user/%" $COND_CONF
120 sed -i "167 s%.*%aaf_sms_url = http://aaf-sms.api.simpledemo.onap.org:10443%" $COND_CONF
121 sed -i "202 s%.*%server_url = https://aai.api.simpledemo.onap.org:8443/aai%" $COND_CONF
122 sed -i "211 s%.*%server_url_version = v14%" $COND_CONF
123 sed -i "382 s%.*%server_url = http://msb.api.simpledemo.onap.org/api/multicloud%" $COND_CONF
124 sed -i "401 s%.*%server_url = http://$MUSIC_URL:8080/MUSIC/rest/v2%" $COND_CONF
125 sed -i "433 s%.*%replication_factor = 1%" $COND_CONF
126 sed -i "536 s%.*%server_url = https://sdnc.api.simpledemo.onap.org:8282/restconf/%" $COND_CONF
128 # Set A&AI and SMS authentication file locations inside OOF-HAS conductor.conf
129 sed -i "174 s%.*%aaf_ca_certs = $AAI_cert%" $COND_CONF
130 sed -i "225 s%.*%certificate_authority_bundle_file = $AAI_cert%" $COND_CONF
133 echo "Values to data component"
137 docker run -d --name controller -v $COND_CONF:/usr/local/bin/conductor.conf -v $LOG_CONF:/usr/local/bin/log.conf ${HAS_IMG} python /usr/local/bin/conductor-controller --config-file=/usr/local/bin/conductor.conf
139 docker run -d --name api -p "8091:8091" -v $COND_CONF:/usr/local/bin/conductor.conf -v $LOG_CONF:/usr/local/bin/log.conf ${HAS_IMG} python /usr/local/bin/conductor-api --port=8091 -- --config-file=/usr/local/bin/conductor.conf
141 docker run -d --name solver -v $COND_CONF:/usr/local/bin/conductor.conf -v $LOG_CONF:/usr/local/bin/log.conf ${HAS_IMG} python /usr/local/bin/conductor-solver --config-file=/usr/local/bin/conductor.conf
143 docker run -d --name reservation -v $COND_CONF:/usr/local/bin/conductor.conf -v $LOG_CONF:/usr/local/bin/log.conf ${HAS_IMG} python /usr/local/bin/conductor-reservation --config-file=/usr/local/bin/conductor.conf
145 docker run -d --name data -v $COND_CONF:/usr/local/bin/conductor.conf -v $LOG_CONF:/usr/local/bin/log.conf -v $BUNDLE:/usr/local/bin/AAF_RootCA.cer ${HAS_IMG} python /usr/local/bin/conductor-data --config-file=/usr/local/bin/conductor.conf
149 echo "Inserting healthcheck plan"
152 http://$MUSIC_URL:8080/MUSIC/rest/v2/keyspaces/conductor/tables/plans/rows/ \
153 -H 'Cache-Control: no-cache' \
154 -H 'Content-Type: application/json' \
155 -H 'Postman-Token: 502781e8-d588-475d-b181-c2e26625ac95' \
156 -H 'X-minorVersion: 3' \
157 -H 'X-patchVersion: 0' \
159 -H 'password: c0nduct0r' \
160 -H 'userId: conductor' \
166 "id" : "healthcheck",
167 "created": 1479482603641,
171 "solution": "{\"healthcheck\": \" healthcheck\"}",
173 "template": "{\"healthcheck\": \"healthcheck\"}",
175 "translation": "{\"healthcheck\": \" healthcheck\"}",
176 "updated": 1484324150629
181 echo "Healthcheck plan inserted"
185 OSDF_CONFIG=/opt/optf-osdf/config/osdf_config.yaml
186 HAS_HOST=$(docker inspect --format '{{ .NetworkSettings.Networks.bridge.IPAddress}}' api)
188 mkdir -p /opt/optf-osdf/config
190 cat > $OSDF_CONFIG<<NEWFILE
192 placementVersioningEnabled: False
194 # Placement API latest version numbers to be set in HTTP header
195 placementMajorVersion: "1"
196 placementMinorVersion: "0"
197 placementPatchVersion: "0"
199 # Placement API default version numbers to be set in HTTP header
200 placementDefaultMajorVersion: "1"
201 placementDefaultMinorVersion: "0"
202 placementDefaultPatchVersion: "0"
205 soUsername: "" # SO username for call back.
206 soPassword: "" # SO password for call back.
208 # Credentials for Conductor
209 conductorUrl: http://$HAS_HOST:8091/v1/plans/
210 conductorUsername: admin1
211 conductorPassword: plan.15
212 conductorPingWaitTime: 60 # seconds to wait before calling the conductor retry URL
213 conductorMaxRetries: 30 # if we don't get something in 30 minutes, give up
214 # versions to be set in HTTP header
215 conductorMinorVersion: 0
217 # Policy Platform -- requires ClientAuth, Authorization, and Environment
218 policyPlatformUrl: http://policy.api.simpledemo.onap.org:8081/pdp/api/getConfig # Policy Dev platform URL
219 policyPlatformEnv: TEST # Environment for policy platform
220 policyPlatformUsername: testpdp # Policy platform username.
221 policyPlatformPassword: alpha123 # Policy platform password.
222 policyClientUsername: python # For use with ClientAuth
223 policyClientPassword: test # For use with ClientAuth
225 # Credentials for DMaaP
226 messageReaderHosts: NA
227 messageReaderTopic: NA
228 messageReaderAafUserId: NA
229 messageReaderAafPassword: NA
231 # Credentials for SDC
235 sdcONAPInstanceID: NA
237 # Credentials for the OOF placement service - Generic
238 osdfPlacementUsername: test
239 osdfPlacementPassword: testpwd
241 # Credentials for the OOF placement service - SO
242 osdfPlacementSOUsername: so_test
243 osdfPlacementSOPassword: so_testpwd
245 # Credentials for the OOF placement service - VFC
246 osdfPlacementVFCUsername: vfc_test
247 osdfPlacementVFCPassword: vfc_testpwd
249 # Credentials for the OOF CM scheduling service - Generic
250 osdfCMSchedulerUsername: test1
251 osdfCMSchedulerPassword: testpwd1
253 is_aaf_enabled: False
254 aaf_cache_expiry_hrs: 3
255 aaf_url: https://aaf.api.simpledemo.onap.org:8100
257 - /api/oof/v1/placement:org.onap.osdf.access|*|read ALL
259 # Secret Management Service from AAF
260 aaf_sms_url: https://aaf-sms.api.simpledemo.onap.org:10443
263 aaf_ca_certs: ssl_certs/aaf_root_ca.cer
266 configDbUrl: http://config.db.url:8080
267 configDbUserName: osdf
268 configDbPassword: passwd
269 configDbGetCellListUrl: 'SDNCConfigDBAPI/getCellList'
270 configDbGetNbrListUrl: 'SDNCConfigDBAPI/getNbrList'
272 # Credentials for PCIHandler
273 pciHMSUsername: "" # pcihandler username for call back.
274 pciHMSPassword: "" # pcihandler password for call back.
276 # Credentials for the OOF PCI Opt service
277 osdfPCIOptUsername: pci_test
278 osdfPCIOptPassword: pci_testpwd
283 docker run -d --name osdf -v $OSDF_CONFIG:/opt/app/config/osdf_config.yaml -p 8698:8699 ${OSDF_IMG}