blob: 4edf10d119d188f4782019a0a8a708288161e378 [file] [log] [blame]
Andy Bavierf73c3d22021-08-30 10:29:06 -07001.. vim: syntax=rst
2
3Setting Up Aether-in-a-Box
4==========================
5
Andy Bavier840e0b42021-09-16 17:10:23 -07006Aether-in-a-Box (AiaB) provides an easy way to deploy Aether's SD-CORE and ROC
7components, and then run basic tests to validate the installation.
8This guide describes the steps to set up AiaB.
Andy Bavierf73c3d22021-08-30 10:29:06 -07009
Andy Bavier840e0b42021-09-16 17:10:23 -070010AiaB can be set up with a 4G or 5G SD-CORE. In either case, SD-CORE configuration
11can be done with or without the ROC. The ROC
12provides an interactive GUI for examining and changing the configuration, and is used to
13manage the production Aether; it can be deployed to test the integration between
14ROC and SD-CORE. If the ROC is not deployed, a simple tool called SimApp
15is used to configure the required state in SD-CORE for testing core functionality.
16
17Helm charts are the primary method of installing the SD-CORE and ROC resources.
18AiaB offers a great deal of flexibility regarding which Helm chart versions to install:
19
20* Local definitions of charts (for testing Helm chart changes)
21* Latest published charts (for deploying a development version of Aether)
22* Specified versions of charts (for deploying a specific Aether release)
23
24AiaB can be run on a bare metal machine or VM. System prerequisites:
Andy Bavierf73c3d22021-08-30 10:29:06 -070025
26* Ubuntu 18.04
27* Kernel 4.15 or later
28* Haswell CPU or newer
Andy Bavier72547672022-02-03 14:45:16 -070029* At least 4 CPUs and 12GB RAM
Andy Bavierf73c3d22021-08-30 10:29:06 -070030
31Clone Repositories
32------------------
33
Andy Bavier840e0b42021-09-16 17:10:23 -070034To initialize the AiaB environment, first clone the following repository
35using your Gerrit ID::
Andy Bavierf73c3d22021-08-30 10:29:06 -070036
Andy Bavier840e0b42021-09-16 17:10:23 -070037 cd ~
38 git clone "ssh://<username>@gerrit.opencord.org:29418/aether-in-a-box"
39
40If you are going to install AiaB using published Helm charts, you can proceed to the
41next section.
42
43If you wish to install SD-CORE from local Helm charts, clone these additional repositories::
44
45 mkdir -p ~/cord
46 cd ~/cord
Andy Bavier7ff674f2021-11-05 12:47:17 -070047 git clone "ssh://<username>@gerrit.opencord.org:29418/sdcore-helm-charts"
Andy Bavierf73c3d22021-08-30 10:29:06 -070048 git clone "ssh://<username>@gerrit.opencord.org:29418/aether-helm-charts"
49
Andy Bavier112a33c2021-11-11 11:13:49 -070050If you wish to install the ROC from local Helm charts, clone this::
Andy Bavier840e0b42021-09-16 17:10:23 -070051
52 mkdir -p ~/cord
53 cd ~/cord
Andy Baviere86261e2021-09-21 11:05:18 -070054 git clone "ssh://<username>@gerrit.opencord.org:29418/roc-helm-charts"
Andy Bavier840e0b42021-09-16 17:10:23 -070055
56Now change to *~/aether-in-a-box* directory.
Andy Bavierf73c3d22021-08-30 10:29:06 -070057
58Set up Authentication Tokens
59----------------------------
60
Andy Bavier840e0b42021-09-16 17:10:23 -070061Edit the file *configs/authentication*.
Andy Bavierf73c3d22021-08-30 10:29:06 -070062
63Fill out REGISTRY_USERNAME and REGISTRY_CLI_SECRET as follows:
64
65* Log into the `Aether Harbor Registry <https://registry.aetherproject.org>`_ using your Crowd credentials
66* Select *User Profile* from the drop-down menu in the upper right corner
67* For REGISTRY_USERNAME, use the *Username* in your profile
68* Copy the *CLI secret* to the clipboard and paste to REGISTRY_CLI_SECRET
69
Andy Bavier7ff674f2021-11-05 12:47:17 -070070Also fill out REPO_USERNAME and REPO_PASSWORD with the information needed to authenticate
71with Aether's Helm chart repositories.
Andy Bavierf73c3d22021-08-30 10:29:06 -070072
Andy Bavier840e0b42021-09-16 17:10:23 -070073If you have already set up AiaB but you used incorrect credentials, first clean up AiaB as described
Andy Bavier72547672022-02-03 14:45:16 -070074in the `Cleanup`_ section, and also run these commands::
75
76 kubectl -n omec delete secret aether.registry
77 rm /tmp/build/milestones/helm-ready
78
79Then edit *configs/authentication* and re-build AiaB.
Andy Bavierf73c3d22021-08-30 10:29:06 -070080
Andy Bavier840e0b42021-09-16 17:10:23 -070081Installing the ROC
82------------------
Andy Bavierf73c3d22021-08-30 10:29:06 -070083
Andy Bavier840e0b42021-09-16 17:10:23 -070084Note that you must install the ROC *before* installing SD-CORE.
85If you are not using the ROC to configure SD-CORE, you can skip this step.
Andy Bavierf73c3d22021-08-30 10:29:06 -070086
Andy Bavier840e0b42021-09-16 17:10:23 -070087First choose whether you will install the 4G or 5G SD-CORE. To install the ROC to
88configure the 4G SD-CORE::
Andy Bavierf73c3d22021-08-30 10:29:06 -070089
Andy Bavier840e0b42021-09-16 17:10:23 -070090 make roc-4g-models
91
92To install the ROC to configure the 5G SD-CORE::
93
94 make roc-5g-models
95
96By default the above commands install the ROC from the local charts in the Git repos cloned
97earlier. In order to install the ROC using the latest published charts, add *CHARTS=latest*
98to the command, e.g.,::
99
100 CHARTS=latest make roc-4g-models
101
Andy Bavier1d631762022-01-10 15:47:51 -0800102To install the Aether 1.6 release, add *CHARTS=release-1.6*::
Andy Bavier840e0b42021-09-16 17:10:23 -0700103
Andy Bavier1d631762022-01-10 15:47:51 -0800104 CHARTS=release-1.6 make roc-4g-models
Andy Bavier840e0b42021-09-16 17:10:23 -0700105
Andy Bavier4d27e4e2022-02-07 14:49:45 -0700106The ROC has successfully initialized when you see output like this::
107
108 echo "ONOS CLI pod: pod/onos-cli-5b947f8f6-4r5nm"
109 ONOS CLI pod: pod/onos-cli-5b947f8f6-4r5nm
110 until kubectl -n aether-roc exec pod/onos-cli-5b947f8f6-4r5nm -- \
111 curl -s -f -L -X PATCH "http://aether-roc-api:8181/aether-roc-api" \
112 --header 'Content-Type: application/json' \
113 --data-raw "$(cat /root/aether-in-a-box//roc-5g-models-v4.json)"; do sleep 5; done
114 command terminated with exit code 22
115 command terminated with exit code 22
116 command terminated with exit code 22
117 "9513ea10-883d-11ec-84bf-721e388172cd"
118
119Don't worry if you see a few lines of *command terminated with exit code 22*; that command is trying to
120load the ROC models, and the message appears if the ROC isn't ready yet. However if you see that message
121more than 10 times then something is probably wrong with the ROC or its models.
122
Andy Bavier840e0b42021-09-16 17:10:23 -0700123Start the 4G SD-CORE
124--------------------
125
126If you are installing the 5G SD-CORE, you can skip this step.
127
128To deploy the 4G SD-CORE and run a simple ping test::
129
130 make test
131
132By default the above commands install the 4G SD-CORE from the local charts in the Git repos cloned
133earlier. In order to install the SD-CORE using the latest published charts, add *CHARTS=latest*
134to the command, e.g.,::
135
136 CHARTS=latest make test
137
Andy Bavier1d631762022-01-10 15:47:51 -0800138To install the Aether 1.6 release, add *CHARTS=release-1.6*::
Andy Bavierf73c3d22021-08-30 10:29:06 -0700139
Andy Bavier1d631762022-01-10 15:47:51 -0800140 CHARTS=release-1.6 make test
Andy Bavierf73c3d22021-08-30 10:29:06 -0700141
Andy Bavier840e0b42021-09-16 17:10:23 -0700142Start the 5G SD-CORE
143--------------------
Andy Bavierf73c3d22021-08-30 10:29:06 -0700144
Andy Bavier840e0b42021-09-16 17:10:23 -0700145If you have already installed the 4G SD-CORE, you must skip this step. Only one version of
146the SD-CORE can be installed at a time.
Andy Bavierf73c3d22021-08-30 10:29:06 -0700147
Andy Bavier1d631762022-01-10 15:47:51 -0800148To deploy the 5G SD-CORE and run a test with gNBSim that performs Registration + UE-initiated
149PDU Session Establishment + sends User Data packets::
Andy Bavierf73c3d22021-08-30 10:29:06 -0700150
Andy Bavier1d631762022-01-10 15:47:51 -0800151 make 5g-test
Andy Bavierf73c3d22021-08-30 10:29:06 -0700152
Andy Bavier840e0b42021-09-16 17:10:23 -0700153By default the above commands install the 5G SD-CORE from the local charts in the Git repos cloned
154earlier. In order to install the SD-CORE using the latest published charts, add *CHARTS=latest*
155to the command, e.g.,::
Andy Bavierf73c3d22021-08-30 10:29:06 -0700156
Andy Bavier1d631762022-01-10 15:47:51 -0800157 CHARTS=latest make 5g-test
Andy Bavierf73c3d22021-08-30 10:29:06 -0700158
Andy Bavier1d631762022-01-10 15:47:51 -0800159To install the Aether 1.6 release, add *CHARTS=release-1.6*::
Andy Bavierf73c3d22021-08-30 10:29:06 -0700160
Andy Bavier1d631762022-01-10 15:47:51 -0800161 CHARTS=release-1.6 make 5g-test
Andy Bavierf73c3d22021-08-30 10:29:06 -0700162
Andy Bavier1d631762022-01-10 15:47:51 -0800163To change the behavior of the test run by gNBSim, change the contents of *gnb.conf*
164in *ransim-values.yaml*. Consult the
165`gNBSim documentation <https://docs.sd-core.opennetworking.org/master/developer/gnbsim.html>`_ for more information.
Andy Bavierf73c3d22021-08-30 10:29:06 -0700166
Andy Bavier4d27e4e2022-02-07 14:49:45 -0700167Exploring AiaB
168--------------
169
170The *kubectl* tool is the best way to get familiar with the pods and other Kubernetes objects installed by AiaB.
171The SD-CORE services, UPF, and simulated edge devices run in the *omec* namespace, while the ROC is running
172in the *aether-roc* namespace.
173
174The ROC GUI is available on port 31194 on the host running AiaB.
175
Andy Bavier840e0b42021-09-16 17:10:23 -0700176Cleanup
177-------
Andy Bavierf73c3d22021-08-30 10:29:06 -0700178
Andy Bavier840e0b42021-09-16 17:10:23 -0700179The first time you build AiaB, it takes a while because it sets up the Kubernetes cluster.
180Subsequent builds will be much faster if you follow these steps to clean up the Helm charts without
181destroying the Kubernetes cluster.
Andy Bavierf73c3d22021-08-30 10:29:06 -0700182
Andy Bavier840e0b42021-09-16 17:10:23 -0700183* Clean up the 4G SD-CORE: *make reset-test*
Andy Bavier72547672022-02-03 14:45:16 -0700184* Reset the 4G UE / eNB in order to re-run the 4G test: *make reset-ue*
Andy Bavier840e0b42021-09-16 17:10:23 -0700185* Clean up the 5G SD-CORE: *make reset-5g-test*
186* Clean up the ROC: *make roc-clean*
187
188It's normal for the above commands to take a minute or two to complete.
189
190As an example, suppose that you want to test the 4G SD-CORE with the ROC, and then the 5G SD-CORE
191with the ROC. You could run these commands::
192
193 CHARTS=latest make roc-4g-models # Install ROC with 4G configuration
194 CHARTS=latest make test # Install 4G SD-CORE and run ping test
195 make reset-test
196 make roc-clean
197 CHARTS=latest make roc-5g-models # Install ROC with 5G configuration
Andy Bavier1d631762022-01-10 15:47:51 -0800198 CHARTS=latest make 5g-test # Install 5G SD-CORE and run gNB Sim test
Andy Bavier840e0b42021-09-16 17:10:23 -0700199 make reset-5g-test
200 make roc-clean
201
202Developer Loop
203--------------
204
205Suppose you wish to test a new build of a 5G SD-CORE services. You can deploy custom images
206by editing `~/aether-in-a-box/5g-core-values.yaml`, for example::
Andy Bavierf73c3d22021-08-30 10:29:06 -0700207
208 images:
209 tags:
210 webui: registry.aetherproject.org/omecproject/5gc-webui:onf-release3.0.5-roc-935305f
211 pullPolicy: IfNotPresent
Andy Bavierf73c3d22021-08-30 10:29:06 -0700212
Andy Bavier840e0b42021-09-16 17:10:23 -0700213To upgrade a running 5G SD-CORE with the new image, or to deploy the 5G SD-CORE with the image::
Andy Bavierf73c3d22021-08-30 10:29:06 -0700214
Andy Bavier1d631762022-01-10 15:47:51 -0800215 make 5g-test
Andy Bavier840e0b42021-09-16 17:10:23 -0700216
217Troubleshooting / Known Issues
218------------------------------
219
220If you suspect a problem, first verify that all pods are in Running state::
221
222 kubectl -n omec get pods
223 kubectl -n aether-roc get pods
224
Andy Bavier72547672022-02-03 14:45:16 -0700225Pods in ImagePullBackOff State
226^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
227If the pods are stuck in ImagePullBackOff state, then it's likely an issue with credentials. To verify this,
228run *kubectl describe* on a pod in that state, for example::
229
230 kubectl -n omec describe pod gnbsim-0
231
232Look in the *Events* section for more information about why the image pull failed. If you see *unauthorized to
233access repository* then it's probably a credentials issue; see `Set up Authentication Tokens`_ above.
Andy Bavier840e0b42021-09-16 17:10:23 -0700234
2354G Test Fails
236^^^^^^^^^^^^^
237Occasionally *make test* (for 4G) fails for unknown reasons; this is true regardless of which Helm charts are used.
Andy Bavier72547672022-02-03 14:45:16 -0700238If this happens, first try recreating the simulated UE / eNB and re-running the test as follows::
239
240 make reset-ue
241 make test
242
243If that does not work, try cleaning up AiaB as described above and re-building it.
244
245If *make test* fails consistently, check whether the configuration has been pushed to the SD-CORE::
Andy Bavier840e0b42021-09-16 17:10:23 -0700246
247 kubectl -n omec logs config4g-0 | grep "Successfully"
248
249You should see that a device group and slice has been pushed::
250
251 [INFO][WebUI][CONFIG] Successfully posted message for device group 4g-oaisim-user to main config thread
252 [INFO][WebUI][CONFIG] Successfully posted message for slice default to main config thread
253
254Then tail the *config4g-0* log and make sure that the configuration has been successfully pushed to all
255SD-CORE components.