3 #------------------------Pre-Modification----------------------------------------------------
7 #---------Clone the repo and perform the steps customize the deployment and values files------
8 git clone https://gerrit.o-ran-sc.org/r/it/dep
9 #run the localize script
10 cd /home/cloudadmin/RIC/dep
11 git checkout 189c974169043e89fa216df5ca638fb550e041e4
12 cat <<EOF >runric_env.sh
15 ################################################################################
16 # Copyright (c) 2019 AT&T Intellectual Property. #
17 # Copyright (c) 2019 Nokia. #
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. #
30 ################################################################################
33 # customize the following repo info to local infrastructure
34 export __RICENV_SET__='1'
35 export __RUNRICENV_GERRIT_HOST__='gerrit-o-ran-sc.org'
36 export __RUNRICENV_GERRIT_IP__='34.215.66.175'_
38 export __RUNRICENV_DOCKER_HOST__='rancodev'
39 export __RUNRICENV_DOCKER_IP__='127.0.0.1'
40 export __RUNRICENV_DOCKER_PORT__='5555'
41 export __RUNRICENV_DOCKER_USER__='docker'
42 export __RUNRICENV_DOCKER_PASS__='docker'
44 export __RUNRICENV_HELMREPO_HOST__='chart-repo.kube-system.svc.rec.io'
45 export __RUNRICENV_HELMREPO_PORT__='8088/charts'
46 export __RUNRICENV_HELMREPO_IP__='127.0.0.1'
47 export __RUNRICENV_HELMREPO_USER__='helm'
48 export __RUNRICENV_HELMREPO_PASS__='helm'
55 deployment_files="$(find . -name deployment.yaml)"
56 for file in $deployment_files; do
57 sed -i '/restartPolicy/d' "$file"
60 #------------------Delete the nodeport and privileges lines----------------------------------------
61 sed -ri 's/^(\s*)(type\s*:\s*NodePort\s*$)/\1type: ClusterIP/' appmgr/charts/appmgr/values.yaml
62 sed -ri 's/^(\s*)(type\s*:\s*NodePort\s*$)/\1type: ClusterIP/' e2mgr/charts/e2mgr/values.yaml
63 deployment_files="$(find . -name deployment.yaml)"
64 for file in $deployment_files; do
65 sed -i '/privileged: true/d' "$file"
68 #------------------Edit the appmgr file including the path of the ca certificate-------------------
69 cp /etc/openssl/ca.pem preric/resources/helmrepo.crt
70 sed -i '/hostAliases:/,/system.svc.rec.io"/d' appmgr/charts/appmgr/templates/deployment.yaml
72 #-----------------Update tiller container name-----------------------------------------------------
73 sed -ri 's/^(\s*)("tiller-service"\s*:\s*"tiller-deploy"\s*$)/\1"tiller-service": "tiller"/' appmgr/charts/appmgr/values.yaml
75 #-----------------Change the repo location to rec.io----------------------------------------------
76 values_files="$(find . -name values.yaml)"
77 for file in $values_files; do
78 sed -i 's,rancodev:5555,registry.kube-system.svc.rec.io:5555/ric,g' "$file"
81 #-----------------Change the repo location to rec.io---------------------------------------------
82 requirements_files="$(find . -name requirements.yaml)"
83 for file in $requirements_files; do
84 sed -i 's,local,localric,g' "$file"
87 sed -i 's,rancodev:5555,rancodev,g' ./prepull.sh
88 sed -i 's/docker logout/#/' ./prepull.sh
89 sed -i 's/docker login/#/' ./prepull.sh
92 #-----------------Installation--------------------------------------------------------------------
93 #--------------Reloading docker images-----------------------------------------------------------
94 echo "docker" | sh ./prepull.sh
98 "xapp-manager:latest" \
102 "redis-standalone:latest"
105 docker tag rancodev/${i} registry.kube-system.svc.rec.io:5555/ric/${i}
106 docker push registry.kube-system.svc.rec.io:5555/ric/${i}
109 #-------------create ricplatform namespace------------------------------------------------------
110 kubectl create namespace ricplatform
112 #create ricplatform danmnet
113 cat <<! | kubectl apply -f -
114 apiVersion: danm.k8s.io/v1
118 namespace: ricplatform
124 #------------run ric_install script-----------------------------------------------------------
125 sed -i 's,http://127.0.0.1:8879,http://127.0.0.1:8879/charts,g' "ric_install.sh"
126 sed -i 's,local,localric,g' "ric_install.sh"
128 bash -x ./ric_install.sh
129 #--------------kill helm---------------------------------------------------------------------
131 #-------------checking the output-------------------------------------------------------------
134 command="$(kubectl get po --no-headers --namespace=ricplatform --field-selector status.phase!=Running 2> /dev/null)"
135 if [[ $command != "" ]]; then