54f7e09d07209fd74292426fa128c139707ff6f6
[it/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 it/dep git repository that has deployment scripts and support files on the target VM.
23 (You might have already done this in a previous step.)
24
25 ::
26
27   % git clone https://gerrit.o-ran-sc.org/r/it/dep
28
29 Check out the appropriate branch of the repository with the release you want to deploy.
30 For example:
31
32 ::
33
34   % git checkout Amber
35
36 In the RECIPE_EXAMPLE directory, edit the recipe files RIC_INFRA_RECIPE_EXAMPLE and
37 RIC_PLATFORM_RECIPE_EXAMPLE. In particular the following values often need adaptation
38 to local deployments:
39
40 #. Docker registry URL (property "repository"). This is the default source for
41    container images. For example,
42    nexus3.o-ran-sc.org:10004/o-ran-sc is the staging registry and has freshly built images;
43    nexus3.o-ran-sc.org:10002/o-ran-sc is the release registry and has stable images.
44 #. Docker registry credential. This is a name of a Kubernetes credential. Some registries
45    allow anonymous read access, including nexus3.o-ran-sc.org.
46 #. Helm repo and credential. The xApp Manager deploys xApps from charts in this repo.
47    No changes are required here for basic dev testing of platform components.
48 #. Component docker container image repository override and tag.  The recipes specify
49    the docker image to use in terms of name and tag.  These entries also allow override
50    of the default docker registry URL (see above); for example, the default might be the
51    releases registry and then a component under test is deployed from the staging registry.
52
53
54 Deploying the Infrastructure and Platform Groups
55 ------------------------------------------------
56
57 After the recipes are edited, the Near Realtime RIC is ready to be deployed.
58 Perform the following steps in a root shell.
59
60 .. code:: bash
61
62   % sudo -i
63   # cd dep/bin
64   # ./deploy-ric-platform ../RECIPE_EXAMPLE/PLATFORM/example_recipe.yaml
65
66 Checking the Deployment Status
67 ------------------------------
68
69 Now check the deployment status after a short wait. Results similar to the
70 output shown below indicate a complete and successful deployment. Check the
71 STATUS column from both kubectl outputs to ensure that all are either
72 "Completed" or "Running", and that none are "Error" or "ImagePullBackOff".
73
74 .. code::
75
76   # helm list
77   NAME                  REVISION        UPDATED                         STATUS          CHART                   APP VERSION     NAMESPACE
78   r3-a1mediator         1               Tue Jan 28 20:11:39 2020        DEPLOYED        a1mediator-3.0.0        1.0             ricplt
79   r3-appmgr             1               Tue Jan 28 20:10:52 2020        DEPLOYED        appmgr-3.0.0            1.0             ricplt
80   r3-dbaas1             1               Tue Jan 28 20:11:13 2020        DEPLOYED        dbaas1-3.0.0            1.0             ricplt
81   r3-e2mgr              1               Tue Jan 28 20:11:23 2020        DEPLOYED        e2mgr-3.0.0             1.0             ricplt
82   r3-e2term             1               Tue Jan 28 20:11:31 2020        DEPLOYED        e2term-3.0.0            1.0             ricplt
83   r3-infrastructure     1               Tue Jan 28 20:10:39 2020        DEPLOYED        infrastructure-3.0.0    1.0             ricplt
84   r3-jaegeradapter      1               Tue Jan 28 20:12:14 2020        DEPLOYED        jaegeradapter-3.0.0     1.0             ricplt
85   r3-rsm                1               Tue Jan 28 20:12:04 2020        DEPLOYED        rsm-3.0.0               1.0             ricplt
86   r3-rtmgr              1               Tue Jan 28 20:11:02 2020        DEPLOYED        rtmgr-3.0.0             1.0             ricplt
87   r3-submgr             1               Tue Jan 28 20:11:48 2020        DEPLOYED        submgr-3.0.0            1.0             ricplt
88   r3-vespamgr           1               Tue Jan 28 20:11:56 2020        DEPLOYED        vespamgr-3.0.0          1.0             ricplt
89
90   # kubectl get pods -n ricinfra
91   NAME                                        READY   STATUS      RESTARTS   AGE
92   deployment-tiller-ricxapp-d4f98ff65-xxpbb   1/1     Running     0          2m46s
93   tiller-secret-generator-76b5t               0/1     Completed   0          2m46s
94
95   # kubectl get pods -n ricplt
96   NAME                                               READY   STATUS         RESTARTS   AGE
97   deployment-ricplt-a1mediator-69f6d68fb4-ndkdv      1/1     Running        0          95s
98   deployment-ricplt-appmgr-845d85c989-4z7t5          2/2     Running        0          2m22s
99   deployment-ricplt-dbaas-7c44fb4697-6lbqq           1/1     Running        0          2m1s
100   deployment-ricplt-e2mgr-569fb7588b-fqfqn           1/1     Running        0          111s
101   deployment-ricplt-e2term-alpha-db949d978-nsjds     1/1     Running        0          103s
102   deployment-ricplt-jaegeradapter-585b4f8d69-gvmdf   1/1     Running        0          60s
103   deployment-ricplt-rsm-755f7c5c85-wdn46             0/1     ErrImagePull   0          69s
104   deployment-ricplt-rtmgr-c7cdb5b58-lsqw4            1/1     Running        0          2m12s
105   deployment-ricplt-submgr-5b4864dcd7-5k26s          1/1     Running        0          86s
106   deployment-ricplt-vespamgr-864f95c9c9-lj74h        1/1     Running        0          78s
107   r3-infrastructure-kong-79b6d8b95b-4lg58            2/2     Running        1          2m33s
108
109
110 Checking Container Health
111 -------------------------
112
113 Check the health of the application manager platform component by querying it
114 via the ingress controller using the following command.
115
116 .. code:: bash
117
118   % curl -v http://localhost:32080/appmgr/ric/v1/health/ready
119
120 The output should look as follows.
121
122 .. code::
123
124   *   Trying 10.0.2.100...
125   * TCP_NODELAY set
126   * Connected to 10.0.2.100 (10.0.2.100) port 32080 (#0)
127   > GET /appmgr/ric/v1/health/ready HTTP/1.1
128   > Host: 10.0.2.100:32080
129   > User-Agent: curl/7.58.0
130   > Accept: */*
131   >
132   < HTTP/1.1 200 OK
133   < Content-Type: application/json
134   < Content-Length: 0
135   < Connection: keep-alive
136   < Date: Wed, 22 Jan 2020 20:55:39 GMT
137   < X-Kong-Upstream-Latency: 0
138   < X-Kong-Proxy-Latency: 2
139   < Via: kong/1.3.1
140   <
141   * Connection #0 to host 10.0.2.100 left intact
142
143
144 Undeploying the Infrastructure and Platform Groups
145 --------------------------------------------------
146
147 To undeploy all the containers, perform the following steps in a root shell
148 within the it-dep repository.
149
150 .. code:: bash
151
152   # cd bin
153   # ./undeploy-ric-platform
154
155 Results similar to below indicate a complete and successful cleanup.
156
157 .. code::
158
159   # ./undeploy-ric-platform
160   Undeploying RIC platform components [appmgr rtmgr dbaas1 e2mgr e2term a1mediator submgr vespamgr rsm jaegeradapter infrastructure]
161   release "r3-appmgr" deleted
162   release "r3-rtmgr" deleted
163   release "r3-dbaas1" deleted
164   release "r3-e2mgr" deleted
165   release "r3-e2term" deleted
166   release "r3-a1mediator" deleted
167   release "r3-submgr" deleted
168   release "r3-vespamgr" deleted
169   release "r3-rsm" deleted
170   release "r3-jaegeradapter" deleted
171   release "r3-infrastructure" deleted
172   configmap "ricplt-recipe" deleted
173   namespace "ricxapp" deleted
174   namespace "ricinfra" deleted
175   namespace "ricplt" deleted
176
177
178 Restarting the VM
179 -----------------
180
181 After a reboot of the VM, and a suitable delay for initialization,
182 all the containers should be running again as shown above.