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