[Issue-Id:RIC-150] Enhancement to it/test repo
[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 Follow the below steps for nanobot testing.
89 USING THE CHART
90 To install the chart (which creates and runs a single Kubernetes job),
91 first copy the packaged Common-Template chart (from
92 https://gerrit.o-ran-sc.org/r/it/dep.git) into
93 ric_robot_suite/helm/nanobot/charts.  Then, edit
94 ric_robot_suite/helm/nanobot/values.yaml to reflect your
95 environment and desired tests and run
96
97 $ helm install [--values <override-file> ] --namespace <namespace> nanobot
98
99 ... in the ric_robot_suite/helm directory, where <override-file>
100 is the recipe override file used when deploying the RIC, if any.  The
101 output from the test will be in the job's log:
102
103 kubectl logs --namespace <namespace> job/nanobot-r0-ric-robot-run
104
105 (the job name may be different if you have altered the values.yaml
106 file; use 'kubectl --namespace <namespace> get jobs' to find it).
107
108 The namespace selected will be where the job's service account is
109 created and the job runs.  It may but need not be the same as the RIC
110 platform or xapp namespace —- the chart may be deployed in any
111 namespace.
112
113 CUSTOMIZING AND EXTENDING THE CHART
114 The job mounts its testsuites directory as a configmap, built from
115 files in nanobot/configmap-src/testsuites.  Template expansion is
116 performed on files in that directory.
117
118 Configuration of the chart is split between the "recipe" used to
119 deploy the RIC (and consumed by the ric-common chart, which is
120 required for this chart) and the chart's own values.yaml file.
121 Generally, RIC platform configuration is specified by the recipe, and
122 robot and xapp configuration from the chart's values.yaml, although
123 there is some overlap.
124
125 Support files (testsuites, keyword definition libraries, scripts, and
126 variable definition files) for the robot framework itself are supplied
127 by k8s configmaps generated from the contents of subdirectories of the
128 configmap-src directory; those subdirectories may contain one or more of
129 the following directories:
130
131 bin/:        scripts/binaries, mounted at /robot/bin
132 testsuites/: test suites, mounted at /robot/testsuites
133 properties/: variable definition (properties) files;
134              contents mounted at /robot/resources
135 resources/:  robot keyword definition libraries, contents
136              mounted at /robot/resources
137
138 Helm template expansion is performed on the contents of all
139 directories.
140 Because both resources/ and properties/ are mounted at
141 robot/resources, care should be taken to ensure that names do not
142 collide across those directories, particularly between trees.
143
144 The job uses the nanobot docker image built by
145 ric_robot_suite/docker/nanobot/Dockerfile; see
146 ric_robot_suite/docker/nanobot/README for information about the
147 image.
148