Adding documentation to repo
[ric-plt/ric-dep.git] / docs / installation-ric.rst
1 .. This work is licensed under a Creative Commons Attribution 4.0 International License.
2 .. SPDX-License-Identifier: CC-BY-4.0
3 .. ===============LICENSE_START=======================================================
4 .. Copyright (C) 2019-2020 AT&T Intellectual Property
5 .. ===================================================================================
6 .. This documentation file is distributed under the Creative Commons Attribution
7 .. 4.0 International License (the "License"); you may not use this file except in
8 .. compliance with the License.  You may obtain a copy of the License at
9 ..
10 .. http://creativecommons.org/licenses/by/4.0
11 ..
12 .. This file is distributed on an "AS IS" BASIS,
13 .. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 .. See the License for the specific language governing permissions and
15 .. limitations under the License.
16 .. ===============LICENSE_END=========================================================
17
18
19 Getting and Preparing Deployment Scripts
20 ----------------------------------------
21
22 Clone the ric-plt/dep git repository that has deployment scripts and support files on the target VM.
23
24 ::
25
26   % git clone "https://gerrit.o-ran-sc.org/r/ric-plt/ric-dep"
27
28
29 .. code:: bash
30
31   git clone "https://gerrit.o-ran-sc.org/r/ric-plt/ric-dep" 
32
33 Modify the deployment recipe
34 ----------------------------
35
36 Edit the recipe files ./RECIPE_EXAMPLE/example_recipe.yaml.
37
38 .. code:: bash
39
40   extsvcplt:
41     ricip: ""
42     auxip: ""
43
44 - To specify which version of the RIC platform components will be deployed, update the RIC platform component container tags in their corresponding section.
45 - You can specify which docker registry will be used for each component. If the docker registry requires login credential, you can add the credential in the following section. Please note that the installation suite has already included credentials for O-RAN Linux Foundation docker registries. Please do not create duplicate entries.
46
47 .. code:: bash
48
49   docker-credential:
50     enabled: true
51     credential:
52       SOME_KEY_NAME:
53         registry: ""
54         credential:
55           user: ""
56           password: ""
57           email: ""
58
59 For more advanced recipe configuration options, please refer to the recipe configuration guideline.
60
61
62 Deploying the Infrastructure and Platform Groups
63 ------------------------------------------------
64
65 Copy the ric-common helm charts for it/dep, configure the helm repo and start local helm server
66
67 .. code:: bash
68
69    git clone "https://gerrit.o-ran-sc.org/r/it/dep"
70    HELM_HOME=$(helm home)
71    COMMON_CHART_VERSION=$(cat dep/ric-common/Common-Template/helm/ric-common/Chart.yaml | grep version | awk '{print $2}')
72    helm package -d /tmp dep/ric-common/Common-Template/helm/ric-common
73    cp /tmp/ric-common-$COMMON_CHART_VERSION.tgz $HELM_HOME/repository/local/
74    helm repo index $HELM_HOME/repository/local/
75    helm serve >& /dev/null &
76    helm repo remove local
77    helm repo add local http://127.0.0.1:8879/charts
78
79
80 After the recipes are edited and helm started, the Near Realtime RIC platform is ready to be deployed.
81
82 .. code:: bash
83
84   cd ric-dep/bin
85   ./install -f ../RECIPE_EXAMPLE/PLATFORM/example_recipe.yaml
86
87
88 Checking the Deployment Status
89 ------------------------------
90
91 Now check the deployment status after a short wait. Results similar to the
92 output shown below indicate a complete and successful deployment. Check the
93 STATUS column from both kubectl outputs to ensure that all are either
94 "Completed" or "Running", and that none are "Error" or "ImagePullBackOff".
95
96 .. code::
97
98   # helm list
99   NAME                  REVISION        UPDATED                         STATUS          CHART                   APP VERSION     NAMESPACE
100   r3-a1mediator         1               Thu Jan 23 14:29:12 2020        DEPLOYED        a1mediator-3.0.0        1.0             ricplt
101   r3-appmgr             1               Thu Jan 23 14:28:14 2020        DEPLOYED        appmgr-3.0.0            1.0             ricplt
102   r3-dbaas1             1               Thu Jan 23 14:28:40 2020        DEPLOYED        dbaas1-3.0.0            1.0             ricplt
103   r3-e2mgr              1               Thu Jan 23 14:28:52 2020        DEPLOYED        e2mgr-3.0.0             1.0             ricplt
104   r3-e2term             1               Thu Jan 23 14:29:04 2020        DEPLOYED        e2term-3.0.0            1.0             ricplt
105   r3-infrastructure     1               Thu Jan 23 14:28:02 2020        DEPLOYED        infrastructure-3.0.0    1.0             ricplt
106   r3-jaegeradapter      1               Thu Jan 23 14:29:47 2020        DEPLOYED        jaegeradapter-3.0.0     1.0             ricplt
107   r3-rsm                1               Thu Jan 23 14:29:39 2020        DEPLOYED        rsm-3.0.0               1.0             ricplt
108   r3-rtmgr              1               Thu Jan 23 14:28:27 2020        DEPLOYED        rtmgr-3.0.0             1.0             ricplt
109   r3-submgr             1               Thu Jan 23 14:29:23 2020        DEPLOYED        submgr-3.0.0            1.0             ricplt
110   r3-vespamgr           1               Thu Jan 23 14:29:31 2020        DEPLOYED        vespamgr-3.0.0          1.0             ricplt
111
112   # kubectl get pods -n ricplt
113   NAME                                               READY   STATUS             RESTARTS   AGE
114   deployment-ricplt-a1mediator-69f6d68fb4-7trcl      1/1     Running            0          159m
115   deployment-ricplt-appmgr-845d85c989-qxd98          2/2     Running            0          160m
116   deployment-ricplt-dbaas-7c44fb4697-flplq           1/1     Running            0          159m
117   deployment-ricplt-e2mgr-569fb7588b-wrxrd           1/1     Running            0          159m
118   deployment-ricplt-e2term-alpha-db949d978-rnd2r     1/1     Running            0          159m
119   deployment-ricplt-jaegeradapter-585b4f8d69-tmx7c   1/1     Running            0          158m
120   deployment-ricplt-rsm-755f7c5c85-j7fgf             1/1     Running            0          158m
121   deployment-ricplt-rtmgr-c7cdb5b58-2tk4z            1/1     Running            0          160m
122   deployment-ricplt-submgr-5b4864dcd7-zwknw          1/1     Running            0          159m
123   deployment-ricplt-vespamgr-864f95c9c9-5wth4        1/1     Running            0          158m
124   r3-infrastructure-kong-68f5fd46dd-lpwvd            2/2     Running            3          160m
125
126   # kubectl get pods -n ricinfra
127   NAME                                        READY   STATUS      RESTARTS   AGE
128   deployment-tiller-ricxapp-d4f98ff65-9q6nb   1/1     Running     0          163m
129   tiller-secret-generator-plpbf               0/1     Completed   0          163m
130
131 Checking Container Health
132 -------------------------
133
134 Check the health of the application manager platform component by querying it
135 via the ingress controller using the following command.
136
137 .. code:: bash
138
139   % curl -v http://localhost:32080/appmgr/ric/v1/health/ready
140
141 The output should look as follows.
142
143 .. code::
144
145   *   Trying 10.0.2.100...
146   * TCP_NODELAY set
147   * Connected to 10.0.2.100 (10.0.2.100) port 32080 (#0)
148   > GET /appmgr/ric/v1/health/ready HTTP/1.1
149   > Host: 10.0.2.100:32080
150   > User-Agent: curl/7.58.0
151   > Accept: */*
152   >
153   < HTTP/1.1 200 OK
154   < Content-Type: application/json
155   < Content-Length: 0
156   < Connection: keep-alive
157   < Date: Wed, 22 Jan 2020 20:55:39 GMT
158   < X-Kong-Upstream-Latency: 0
159   < X-Kong-Proxy-Latency: 2
160   < Via: kong/1.3.1
161   <
162   * Connection #0 to host 10.0.2.100 left intact
163
164
165 Undeploying the Infrastructure and Platform Groups
166 --------------------------------------------------
167
168 To undeploy all the containers, perform the following steps in a root shell
169 within the it-dep repository.
170
171 .. code:: bash
172
173   # cd bin
174   # ./uninstall
175
176 Results similar to below indicate a complete and successful cleanup.
177
178 .. code::
179
180   # ./undeploy-ric-platform
181   Undeploying RIC platform components [appmgr rtmgr dbaas1 e2mgr e2term a1mediator submgr vespamgr rsm jaegeradapter infrastructure]
182   release "r3-appmgr" deleted
183   release "r3-rtmgr" deleted
184   release "r3-dbaas1" deleted
185   release "r3-e2mgr" deleted
186   release "r3-e2term" deleted
187   release "r3-a1mediator" deleted
188   release "r3-submgr" deleted
189   release "r3-vespamgr" deleted
190   release "r3-rsm" deleted
191   release "r3-jaegeradapter" deleted
192   release "r3-infrastructure" deleted
193   configmap "ricplt-recipe" deleted
194   namespace "ricxapp" deleted
195   namespace "ricinfra" deleted
196   namespace "ricplt" deleted
197
198
199 Restarting the VM
200 -----------------
201
202 After a reboot of the VM, and a suitable delay for initialization,
203 all the containers should be running again as shown above.