64ff5a608f64cb12a4c22044855149fd1a4b30df
[it/test.git] / ric_robot_suite / helm / nanobot / README
1 #   Copyright (c) 2019 AT&T Intellectual Property.
2 #
3 #   Licensed under the Apache License, Version 2.0 (the "License");
4 #   you may not use this file except in compliance with the License.
5 #   You may obtain a copy of the License at
6 #
7 #       http://www.apache.org/licenses/LICENSE-2.0
8 #
9 #   Unless required by applicable law or agreed to in writing, software
10 #   distributed under the License is distributed on an "AS IS" BASIS,
11 #   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 #   See the License for the specific language governing permissions and
13 #   limitations under the License.
14
15 This directory contains a Helm chart for the minimal robot container
16 and Kubernetes job.
17
18 Before executing the nanobot test please do the following procedures
19 Deploy E2sim:
20 ============
21
22 1. Deploy RIC platform
23
24 2. kubectl rollout restart deployment --namespace ricplt deployment-ricplt-e2mgr deployment-ricplt-e2term-alpha (The e2mgr and e2term need to be restarted; this is due to some issues with health check; I don’t know whether it has been resolved by that team)
25
26 3. clone sim/e2-interface
27
28 4. In the root directory of e2sim: Follow directions in README to produce the deb files
29
30 5. Since the deb files are not yet pushed to package cloud, we need to copy them
31
32 6. cp e2sim*deb ../e2sm_examples/kpm_e2sm
33
34 7. cd ../e2sm_examples/kpm_e2sm
35
36 8. Edit the Dockerfile at the bottom to have IP address of service-ricplt-e2term-sctp-alpha service
37
38 9. docker build .
39
40 10. docker tag <tag just built> e2simul:0.0.2
41
42 11. Once deployed, kubectl logs will show:
43
44 An E2 Setup Request from E2 Simulator to E2 Term
45 An E2 Setup Response from E2 Term to E2 Simulator
46
47 Deploy Bouncer Xapp in common way:
48 ==================================
49
50 Follow the link to deploy xapps
51 https://wiki.o-ran-sc.org/display/IAT/AD+xApp+Flows
52
53 1.Preparing an xApp for onboarding:
54
55 echo '{"config-file.json_url": "https://gerrit.o-ran-sc.org/r/gitweb?p=ric-app/ts.git;a=blob_plain;f=xapp-descriptor/config.json;hb=HEAD" }' > onboard.ts.url
56
57
58 2. Onboarding xApps:
59 Invoke the API calls into the xApp On-boarder, providing it the locations of the xApp descripters.
60 curl --location --request POST "http://$(hostname):32080/onboard/api/v1/onboard/download" --header 'Content-Type: application/json' --data-binary "@./onboard.ts.url"
61
62 3. Checking the on-boarded charts:
63 curl --location --request GET "http://$(hostname):32080/onboard/api/v1/charts"
64
65 4. Deploying Xapp:
66 curl --location --request POST "http://$(hostname):32080/appmgr/ric/v1/xapps" --header 'Content-Type: application/json' --data-raw '{"xappName": "trafficxapp"}'
67
68 Deploy KPIMONXapp:
69 ==================
70 currently KPIMON deployment must be done in the following way:
71
72 https://wiki.o-ran-sc.org/display/IAT/Traffic+Steering+Flows
73
74
75 1. clone scp/ric-app/kpimon (note it is different than the ric-app/kpimon repo)
76 2. docker build .
77 3. docker tag <image tag just created> nexus3.o-ran-sc.org:10002/ric-app-kpimon:1.0.0
78 4 .curl -X POST --data-binary @xappkpimon-0.2.0.tgz http://<vm-name>:32080/helmrepo/api/charts (Push hand-crafted helm chart to appmgr chart museum)
79
80 Once Xapp deployed
81
82 1.Checkout the it/test repo
83 2.Modify Values.yaml based on your Xapp deployment name, Xapp name and E2sim deployment with PLMID, GNBID update.
84 ric_robot_suite/helm/nanobot/values.yaml.
85 3.Add testsuites name based on our testing.
86 Note: Only one xapp to E2sim test is possible.
87
88 ==================================================================================================================================================================================
89 Subscription Duplication Deployment
90 ====================================
91 The above E2sim deployment procedures are same. For Bouncer xApp deployment please follow up below steps.
92
93 Scenario-1:
94 ==========
95 Deploy 2 bouncer xapps with intermission delay of 2 to 5secs.
96 1. Use 2 different paths for 2 xapps configfile and modify xappname based on your requirement in configfile.
97
98 2.Use local config file shared path for preparing an xApp onboarding:
99
100 examples:
101 echo '{"config-file.json_url": "https://${hostname}:8090/config.json" }' > onboard.bouncer.url
102 echo '{"config-file.json_url": "https://${hostname}:8090/anotherxapp/config.json" }' > onboard.bouncer_another.url
103
104 3. Onboarding xApps:
105 Invoke the API calls into the xApp On-boarder, providing it the locations of the xApp descripters.
106 curl --location --request POST "http://$(hostname):32080/onboard/api/v1/onboard/download" --header 'Content-Type: application/json' --data-binary "@./onboard.bouncer.url"
107 curl --location --request POST "http://$(hostname):32080/onboard/api/v1/onboard/download" --header 'Content-Type: application/json' --data-binary "@./onboard.bouncer_another.url"
108
109 4. Checking the on-boarded charts:
110 curl --location --request GET "http://$(hostname):32080/onboard/api/v1/charts"
111
112 5. Deploying Xapp:
113 curl --location --request POST "http://$(hostname):32080/appmgr/ric/v1/xapps" --header 'Content-Type: application/json' --data-raw '{"xappName": "bouncerxapp"}'
114 delay 2 to 5secs
115 curl --location --request POST "http://$(hostname):32080/appmgr/ric/v1/xapps" --header 'Content-Type: application/json' --data-raw '{"xappName": "bouncerxapp_1"}'
116
117 Once Xapp deployed
118
119 1.Checkout the it/test repo
120 2.Modify Values.yaml based on your Xapp deployment- 2 Xapp names and E2sim deployment with PLMID, GNBID update.
121 ric_robot_suite/helm/nanobot/values.yaml.
122 3.Add testsuites name "subscription_duplication_scenario1".
123 Note: Only bouncer xapps to E2sim test possible.
124
125
126 Scenario-2:
127 ===========
128 Deploy 1 bouncer xapp by following the below procedure
129
130 1.Use local config file shared path for preparing an xApp onboarding:
131
132 examples:
133 echo '{"config-file.json_url": "https://${hostname}:8090/config.json" }' > onboard.bouncer.url
134
135 2. Onboarding xApps:
136 Invoke the API calls into the xApp On-boarder, providing it the locations of the xApp descripters.
137 curl --location --request POST "http://$(hostname):32080/onboard/api/v1/onboard/download" --header 'Content-Type: application/json' --data-binary "@./onboard.bouncer.url"
138
139 3. Checking the on-boarded charts:
140 curl --location --request GET "http://$(hostname):32080/onboard/api/v1/charts"
141
142 4. Deploying Xapp:
143 curl --location --request POST "http://$(hostname):32080/appmgr/ric/v1/xapps" --header 'Content-Type: application/json' --data-raw '{"xappName": "bouncerxapp"}'
144
145 Ensure on bouncer xapp logs to check upto indication packets received from E2sim.
146
147 Deploy 2 bouncer xapp
148
149 1.Use local config file shared path for preparing an xApp onboarding:
150
151 examples:
152 echo '{"config-file.json_url": "https://${hostname}:8090/anotherxapp/config.json" }' > onboard.bouncer_another.url
153
154 2. Onboarding xApps:
155 Invoke the API calls into the xApp On-boarder, providing it the locations of the xApp descripters.
156 curl --location --request POST "http://$(hostname):32080/onboard/api/v1/onboard/download" --header 'Content-Type: application/json' --data-binary "@./onboard.bouncer_another.url"
157
158 4. Checking the on-boarded charts:
159 curl --location --request GET "http://$(hostname):32080/onboard/api/v1/charts"
160
161 5. Deploying Xapp:
162 curl --location --request POST "http://$(hostname):32080/appmgr/ric/v1/xapps" --header 'Content-Type: application/json' --data-raw '{"xappName": "bouncerxapp_1"}'
163
164
165 Once Xapp deployed
166
167 1.Checkout the it/test repo
168 2.Modify Values.yaml based on your Xapp deployment- 2 Xapp names and E2sim deployment with PLMID, GNBID update.
169 ric_robot_suite/helm/nanobot/values.yaml.
170 3.Add testsuites name "subscription_duplication_scenario2" .
171 Note: Only bouncer xapps to E2sim tests possible.
172
173
174 ===============================================================================================================================================
175
176 Follow the below steps for nanobot testing.
177 USING THE CHART
178 To install the chart (which creates and runs a single Kubernetes job),
179 first copy the packaged Common-Template chart (from
180 https://gerrit.o-ran-sc.org/r/it/dep.git) into
181 ric_robot_suite/helm/nanobot/charts.  Then, edit
182 ric_robot_suite/helm/nanobot/values.yaml to reflect your
183 environment and desired tests and run
184
185 $ helm install [--values <override-file> ] --namespace <namespace> nanobot
186
187 ... in the ric_robot_suite/helm directory, where <override-file>
188 is the recipe override file used when deploying the RIC, if any.  The
189 output from the test will be in the job's log:
190
191 kubectl logs --namespace <namespace> job/nanobot-r0-ric-robot-run
192
193 (the job name may be different if you have altered the values.yaml
194 file; use 'kubectl --namespace <namespace> get jobs' to find it).
195
196 The namespace selected will be where the job's service account is
197 created and the job runs.  It may but need not be the same as the RIC
198 platform or xapp namespace —- the chart may be deployed in any
199 namespace.
200
201 CUSTOMIZING AND EXTENDING THE CHART
202 The job mounts its testsuites directory as a configmap, built from
203 files in nanobot/configmap-src/testsuites.  Template expansion is
204 performed on files in that directory.
205
206 Configuration of the chart is split between the "recipe" used to
207 deploy the RIC (and consumed by the ric-common chart, which is
208 required for this chart) and the chart's own values.yaml file.
209 Generally, RIC platform configuration is specified by the recipe, and
210 robot and xapp configuration from the chart's values.yaml, although
211 there is some overlap.
212
213 Support files (testsuites, keyword definition libraries, scripts, and
214 variable definition files) for the robot framework itself are supplied
215 by k8s configmaps generated from the contents of subdirectories of the
216 configmap-src directory; those subdirectories may contain one or more of
217 the following directories:
218
219 bin/:        scripts/binaries, mounted at /robot/bin
220 testsuites/: test suites, mounted at /robot/testsuites
221 properties/: variable definition (properties) files;
222              contents mounted at /robot/resources
223 resources/:  robot keyword definition libraries, contents
224              mounted at /robot/resources
225
226 Helm template expansion is performed on the contents of all
227 directories.
228 Because both resources/ and properties/ are mounted at
229 robot/resources, care should be taken to ensure that names do not
230 collide across those directories, particularly between trees.
231
232 The job uses the nanobot docker image built by
233 ric_robot_suite/docker/nanobot/Dockerfile; see
234 ric_robot_suite/docker/nanobot/README for information about the
235 image.
236