5 ### Setting up variables used in this script ###
6 build_node_ip=$(openstack server list -c Name -c Networks -f value | egrep ${openstack_build_stack_name} | awk '{print $NF}' | sed 's/.*=//g')
7 ssh_cmd="ssh -o StrictHostKeychecking=no -i ${ssh_key} ${remote_user}@${build_node_ip}"
8 onap_docker_images_dir="/tmp/resources/offline_data/docker_images_for_nexus"
10 ${ssh_cmd} "${clone_oom_cmd}"
12 ### Changing onap values.yaml to include all the components of onap, as by default all are set to false and then the data_list creator script ###
13 ### would not work as intended ###
15 #TODO: Is this the best way to do this? The values.yaml could change when new components are added and static content will not mirror this. [eronkeo: 10-10-2019]
16 ${ssh_cmd} "sudo bash -c \"cat << EOF > /tmp/oom/kubernetes/onap/values.yaml
17 # Copyright © 2019 Amdocs, Bell Canada
19 # Licensed under the Apache License, Version 2.0 (the "License");
20 # you may not use this file except in compliance with the License.
21 # You may obtain a copy of the License at
23 # http://www.apache.org/licenses/LICENSE-2.0
25 # Unless required by applicable law or agreed to in writing, software
26 # distributed under the License is distributed on an "AS IS" BASIS,
27 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
28 # See the License for the specific language governing permissions and
29 # limitations under the License.
31 #################################################################
32 # Global configuration overrides.
34 # These overrides will affect all helm charts (ie. applications)
35 # that are listed below and are 'enabled'.
36 #################################################################
38 # Change to an unused port prefix range to prevent port conflicts
39 # with other instances running within the same k8s cluster
41 nodePortPrefixExt: 304
44 # Uncomment the following to enable the use of a single docker
45 # repository but ONLY if your repository mirrors all ONAP
46 # docker images. This includes all images from dockerhub and
47 # any other repository that hosts images for ONAP components.
48 #repository: nexus3.onap.org:10001
53 # readiness check - temporary repo until images migrated to nexus3
54 readinessRepository: oomk8s
55 # logging agent - temporary repo until images migrated to nexus3
56 loggingRepository: docker.elastic.co
61 # default mount path root directory referenced
62 # by persistent volumes and log files
64 mountPath: /dockerdata-nfs
65 enableDefaultStorageclass: false
67 storageclassProvisioner: kubernetes.io/no-provisioner
68 volumeReclaimPolicy: Retain
70 # override default resource limit flavor for all charts
71 # flag to enable debugging - application support required
74 #################################################################
75 # Enable/disable and configure helm charts (ie. applications)
76 # to customize the ONAP deployment.
77 #################################################################
85 openStackType: OpenStackProvider
86 openStackName: OpenStack
87 openStackKeyStoneUrl: http://localhost:8181/apidoc/explorer/index.html
88 openStackServiceTenantName: default
89 openStackDomain: default
90 openStackUserName: admin
91 openStackEncryptedPassword: admin
104 #Pnda site is down and can't pull any version of pnda at the moment
126 # openstack configuration
127 openStackRegion: "Yolo"
128 openStackVNFTenantId: "1234"
140 # openStackEncryptedPasswordHere should match the encrypted string used in SO and APPC and overridden per environment
141 openStackEncryptedPasswordHere: "c124921a3a0efbe579782cde8227681e"
157 # necessary to disable liveness probe when setting breakpoints
158 # in debugger so K8s doesn't restart unresponsive container
161 # so server configuration
163 # message router configuration
165 # openstack configuration
166 openStackUserName: "vnf_user"
167 openStackRegion: "RegionOne"
168 openStackKeyStoneUrl: "http://1.2.3.4:5000"
169 openStackServiceTenantName: "service"
170 openStackEncryptedPasswordHere: "c124921a3a0efbe579782cde8227681e"
172 # configure embedded mariadb
175 mariadbRootPassword: password
192 ###TODO There is a script created in the offline installer to check rpms and create repo, but at the moment it is not usable, thus it is done manually###
193 #${ssh_cmd} "sudo /tmp/onap-offline/build/create_repo.sh -d $(pwd)"
195 ### RPM's for CentOS were changed, thus we need to remake the rpm.list file ###
196 ${ssh_cmd} "sudo bash -c \"cat << EOF > ${build_dir}/data_lists/onap_rpm.list
197 #Renewed list of rpms
198 containerd.io-1.2.5-3.1.el7.x86_64
199 container-selinux-1.12.5-14.el7.x86_64
200 container-selinux-2.107-3.el7.noarch
201 docker-ce-18.09.5-3.el7.x86_64
202 docker-ce-cli-18.09.6-3.el7.x86_64
203 gssproxy-0.7.0-26.el7.x86_64
204 keyutils-1.5.8-3.el7.x86_64
205 libbasicobjects-0.1.1-32.el7.x86_64
206 libcollection-0.7.0-32.el7.x86_64
207 libevent-2.0.21-4.el7.x86_64
208 libini_config-1.3.1-32.el7.x86_64
209 libnfsidmap-0.25-19.el7.x86_64
210 libpath_utils-0.2.1-32.el7.x86_64
211 libref_array-0.1.5-32.el7.x86_64
212 libverto-libevent-0.2.5-4.el7.x86_64
213 nfs-utils-1.3.0-0.65.el7.x86_64
214 python-docker-py-1.10.6-9.el7_6.noarch
215 python-docker-pycreds-0.3.0-9.el7_6.noarch
216 python-ipaddress-1.0.16-2.el7.noarch
217 python-jsonpointer-1.9-2.el7.noarch
218 python-websocket-client-0.56.0-3.git3c25814.el7.noarch
222 ###Need to download and install helm in order to populate data_list according to oom helm charts###
223 ###Since we cannot login as root, and scripts presume you are a root user,need to set up correctly to be able to use helm ###
225 ${ssh_cmd} "sudo ${build_dir}/download/download.py --http ${data_list_dir}/infra_bin_utils.list ${resources_dir}/downloads"
226 ${ssh_cmd} "sudo tar -xf ${resources_dir}/downloads/storage.googleapis.com/kubernetes-helm/*.tar.gz linux-amd64/helm"
227 ${ssh_cmd} "sudo mv linux-amd64/helm /usr/local/bin/helm"
228 ${ssh_cmd} "sudo sed -i -e '/secure_path/ s[=.*[&:/usr/local/bin[' /etc/sudoers"
229 ${ssh_cmd} "sudo sed -i ${sed_cmd} ${build_dir}/creating_data/docker-images-collector.sh"
230 ${ssh_cmd} "sudo ${build_dir}/creating_data/docker-images-collector.sh /tmp/oom/kubernetes/onap &>/dev/null"
232 ###*******Commands to incorporate Online PART 1*******###
233 #${ssh_cmd} "sudo curl https://artifactory.nordix.org/artifactory/list/onap/online-install/master/latest/onap_docker_images.list -o ${onap_offline_dir}/onap_docker_images_online.list"
234 #scp -o StrictHostKeychecking=no -i ${ssh_key} ${WORKSPACE}/build/scripts/docker_sha_downloader.py ${openstack_user}@${build_node_ip}:${onap_offline_dir}/docker_sha_downloader.py
235 #${ssh_cmd} "sudo $(onap_offline_dir}/docker_sha_downloader.py -l onap_docker_images_online.list -d ${onap_docker_images_dir}"
236 #${ssh_cmd} "sudo sed -i '/nexus3.onap.org:10001\/onap/d' ${data_list_dir}/onap_docker_images.list"
238 ###Download Scripts run step by step instead of using a wrapper script###
239 ${ssh_cmd} "sudo ${build_dir}/download/download.py \
240 --docker ${data_list_dir}/infra_docker_images.list ${resources_dir}/offline_data/docker_images_infra \
241 --docker ${data_list_dir}/k8s_docker_images.list ${resources_dir}/offline_data/docker_images_for_nexus \
242 --docker ${data_list_dir}/rke_docker_images.list ${resources_dir}/offline_data/docker_images_for_nexus \
243 --docker ${data_list_dir}/onap_docker_images.list ${resources_dir}/offline_data/docker_images_for_nexus"
245 if [ $? -ne 0 ]; then
246 echo "Error downloading docker images: Retrying"
247 #There is a problem with the collector making a list with the same image being pulled twice, but once from a bad repo, thus it needs to be removed
248 ${ssh_cmd} "sudo sed -i '/registry.hub.docker.com\/onap\/multicloud\/framework-artifactbroker:1.4.2/d' ${build_dir}/data_lists/onap_docker_images.list"
249 ${ssh_cmd} "sudo ${build_dir}/download/download.py \
250 --docker ${data_list_dir}/infra_docker_images.list ${resources_dir}/offline_data/docker_images_infra \
251 --docker ${data_list_dir}/k8s_docker_images.list ${resources_dir}/offline_data/docker_images_for_nexus \
252 --docker ${data_list_dir}/rke_docker_images.list ${resources_dir}/offline_data/docker_images_for_nexus \
253 --docker ${data_list_dir}/onap_docker_images.list ${resources_dir}/offline_data/docker_images_for_nexus"
254 if [ $? -ne 0 ]; then
255 echo "Error downloading docker images -----RETRY FAILED-----"
260 ${ssh_cmd} "sudo ${build_dir}/download/download.py --rpm ${data_list_dir}/onap_rpm.list ${resources_dir}/pkg/rhel"
261 if [ $? -ne 0 ]; then
262 echo "Error downloading rpm files"
266 ###Need to create repo, as that is used in the deployment stage###
267 ${ssh_cmd} "sudo createrepo /tmp/resources/pkg/rhel"
268 if [ $? -ne 0 ]; then
269 echo "Error creating repo"
273 ###*******Commands to incorporate Online PART 2 ( TO BE LEFT COMMENTED OUT FOR NIGHTLY PURPOSES ) *******###
274 #${ssh_cmd} "sudo bash -c \"cat ${onap_offline_dir}/onap_docker_images_online.list | sed 's/#sha256.*//' > ${onap_offline_dir}/onap_docker_images_work.list\""
275 #${ssh_cmd} "sudo sed -i 's/registry.nordix.org\/onap\/online-install\//nexus.onap.org:10001\//' ${onap_offline_dir}/onap_docker_images_work.list"
276 #${ssh_cmd} "sudo bash -c \"cat ${onap_offline_dir}/onap_docker_images_work.list | sort >> ${data_list_dir}/onap_docker_images.list\""
279 ###SHOULD NOT BE NEEDED ANYMORE IF WE ARE DROPPING THE 4 DIGIT TAG, but will be kept just in case###
280 #${ssh_cmd} "sudo sed -i 's/\.[0-9]*$//' ${onap_offline_dir}/onap_docker_images_work.list"
281 #${ssh_cmd} "sudo sed -i 's/\.[0-9]*[[:blank:]]$//' ${onap_offline_dir}/onap_docker_images_work.list"