2 #------------------------Pre-Modification----------------------------------------------------
6 #---------Clone the repo and perform the steps customize the deployment and values files------
7 git clone https://gerrit.o-ran-sc.org/r/it/dep
8 #run the localize script
9 cd /home/cloudadmin/RIC/dep
10 git checkout 189c974169043e89fa216df5ca638fb550e041e4
11 cat <<EOF >runric_env.sh
14 ################################################################################
15 # Copyright (c) 2019 AT&T Intellectual Property. #
16 # Copyright (c) 2019 Nokia. #
18 # Licensed under the Apache License, Version 2.0 (the "License"); #
19 # you may not use this file except in compliance with the License. #
20 # You may obtain a copy of the License at #
22 # http://www.apache.org/licenses/LICENSE-2.0 #
24 # Unless required by applicable law or agreed to in writing, software #
25 # distributed under the License is distributed on an "AS IS" BASIS, #
26 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
27 # See the License for the specific language governing permissions and #
28 # limitations under the License. #
29 ################################################################################
32 # customize the following repo info to local infrastructure
33 export __RICENV_SET__='1'
34 export __RUNRICENV_GERRIT_HOST__='gerrit-o-ran-sc.org'
35 export __RUNRICENV_GERRIT_IP__='34.215.66.175'_
37 export __RUNRICENV_DOCKER_HOST__='rancodev'
38 export __RUNRICENV_DOCKER_IP__='127.0.0.1'
39 export __RUNRICENV_DOCKER_PORT__='5555'
40 export __RUNRICENV_DOCKER_USER__='docker'
41 export __RUNRICENV_DOCKER_PASS__='docker'
43 export __RUNRICENV_HELMREPO_HOST__='chart-repo.kube-system.svc.rec.io'
44 export __RUNRICENV_HELMREPO_PORT__='8088/charts'
45 export __RUNRICENV_HELMREPO_IP__='127.0.0.1'
46 export __RUNRICENV_HELMREPO_USER__='helm'
47 export __RUNRICENV_HELMREPO_PASS__='helm'
54 deployment_files="$(find . -name deployment.yaml)"
55 for file in $deployment_files; do
56 sed -i '/restartPolicy/d' "$file"
59 #------------------Delete the nodeport and privileges lines----------------------------------------
60 sed -ri 's/^(\s*)(type\s*:\s*NodePort\s*$)/\1type: ClusterIP/' appmgr/charts/appmgr/values.yaml
61 sed -ri 's/^(\s*)(type\s*:\s*NodePort\s*$)/\1type: ClusterIP/' e2mgr/charts/e2mgr/values.yaml
62 deployment_files="$(find . -name deployment.yaml)"
63 for file in $deployment_files; do
64 sed -i '/privileged: true/d' "$file"
67 #------------------Edit the appmgr file including the path of the ca certificate-------------------
68 cp /etc/openssl/ca.pem preric/resources/helmrepo.crt
69 sed -i '/hostAliases:/,/system.svc.rec.io"/d' appmgr/charts/appmgr/templates/deployment.yaml
71 #-----------------Update tiller container name-----------------------------------------------------
72 sed -ri 's/^(\s*)("tiller-service"\s*:\s*"tiller-deploy"\s*$)/\1"tiller-service": "tiller"/' appmgr/charts/appmgr/values.yaml
74 #-----------------Change the repo location to rec.io----------------------------------------------
75 values_files="$(find . -name values.yaml)"
76 for file in $values_files; do
77 sed -i 's,rancodev:5555,registry.kube-system.svc.rec.io:5555/ric,g' "$file"
80 #-----------------Change the repo location to rec.io---------------------------------------------
81 requirements_files="$(find . -name requirements.yaml)"
82 for file in $requirements_files; do
83 sed -i 's,local,localric,g' "$file"
86 sed -i 's,rancodev:5555,rancodev,g' ./prepull.sh
87 sed -i 's/docker logout/#/' ./prepull.sh
88 sed -i 's/docker login/#/' ./prepull.sh
91 #-----------------Installation--------------------------------------------------------------------
92 #--------------Reloading docker images-----------------------------------------------------------
93 echo "docker" | sh ./prepull.sh
97 "xapp-manager:latest" \
101 "redis-standalone:latest"
104 docker tag rancodev/${i} registry.kube-system.svc.rec.io:5555/ric/${i}
105 docker push registry.kube-system.svc.rec.io:5555/ric/${i}
108 #-------------create ricplatform namespace------------------------------------------------------
109 kubectl create namespace ricplatform
111 #create ricplatform danmnet
112 cat <<! | kubectl apply -f -
113 apiVersion: danm.k8s.io/v1
117 namespace: ricplatform
123 #------------run ric_install script-----------------------------------------------------------
124 sed -i 's,http://127.0.0.1:8879,http://127.0.0.1:8879/charts,g' "ric_install.sh"
125 sed -i 's,local,localric,g' "ric_install.sh"
127 bash -x ./ric_install.sh
128 #--------------kill helm---------------------------------------------------------------------
130 #-------------checking the output-------------------------------------------------------------
131 command="$(kubectl get po --no-headers --namespace=ricplatform --field-selector status.phase!=Running 2> /dev/null)"
132 if [[ $command != "" ]]; then