From 0c079d1ad7e9b93e7b8a1bf02e9ac8db3efe6c6e Mon Sep 17 00:00:00 2001 From: gckopper <41166074+gckopper@users.noreply.github.com> Date: Mon, 8 Apr 2024 17:42:01 -0300 Subject: [PATCH] xapp deployment guide for oran sc --- docs/RICs/oran-sc.md | 86 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 85 insertions(+), 1 deletion(-) diff --git a/docs/RICs/oran-sc.md b/docs/RICs/oran-sc.md index 8e496be..7310ba6 100644 --- a/docs/RICs/oran-sc.md +++ b/docs/RICs/oran-sc.md @@ -4,7 +4,18 @@ ### Containerd and kubernetes (skip if already installed) -First things first install containerd, kubeadm and kubectl. The cluster configuration passed to kubeadm is available [here](RICs/near-realtime/oran-sc/config.yaml) and the only required modification is under the "CertSANs" option you should change to the hostname of your machine. This modification ensures that the self-signed certificates generated by kubeadm will remain valid for your machine after a change in IP address, which is common for us, as long as you as acessing it using its hostname. +First things first install containerd, kubeadm and kubectl. The cluster +configuration passed to kubeadm is available +[here](RICs/near-realtime/oran-sc/config.yaml) and the only required +modification is under the "CertSANs" option you should change to the hostname +of your machine. This modification ensures that the self-signed certificates +generated by kubeadm will remain valid for your machine after a change in IP +address, which is common for us, as long as you as acessing it using its +hostname. + +Note: This will install kubernetes using containerd instead of docker, so the +cli for your containers is `ctr` and the namespace used by kubernetes is +`k8s.io` ### Step by step kubernetes setup @@ -39,6 +50,12 @@ Start a chartsmuseum instance (this is a repository for helm charts). chartmuseum --debug --port 6873 --storage local --storage-local-rootdir $HOME/helm/chartsmuseum/ ``` +Add a plugin to allow helm to push charts to its chartmuseums + +```bash +helm plugin install https://github.com/chartmuseum/helm-push +``` + Add the local museum to helm ```bash helm repo add local http://localhost:6873/ @@ -57,5 +74,72 @@ helm install nearrtric -n ricplt local/nearrtric -f RECIPE_EXAMPLE/example_recip ``` ## Building xApps + +Here are the instructions to build the modified version of the bouncer xApp +used in tests (the one that works with srsRAN 23.10.1). First clone the +repository: +```bash +git clone https://github.com/gckopper/bouncer-xapp -b srsRAN-E2 --depth 1 +``` +Note: the `-b` flag allows you to clone a specific branch, in this case the +`srsRAN-E2` branch, and the `--depth 1` flag tells git to only clone the latest +commit. + +Then there is a script inside the repository that builds the container image +using docker and saves it to containerd internal repository. Building images +with ctr is not possible at the moment. Once the image has finished build it +is time to deploy it. + ## Deploying and managing xApps +To deploy the container image, first clone the official appmgr repository from O-RAN. + +```bash +git clone https://gerrit.o-ran-sc.org/r/ric-plt/appmgr +``` + +This application is used to manage xApps. So lets build it and install it. First we +need to go inside the correct folder + +```bash +cd appmgr/xapp_orchestrater/dev/xapp_onboarder +``` + +Create a python virtual environmente to isolate the dependencies of the xApp +Onboarder from your system. Just remember that to use this application you'll +need to activate the environment using the second command. + +```bash +python3 -m venv venv3 +source venv/bin/activate +pip install -r requirements.txt +``` +If you need to deactivate this virtual environment simply use the command +`deativate`. + +Onboard the xApp. Keep in mind that the typo in `shcema` is necessary. +```bash +CHART_REPO_URL=http://localhost:6873 dms_cli onboard --config-file-path /Bouncer/init/config-file.json --shcema_file_path /Bouncer/init/schema.json +``` + +Download the chart you've just created. + +```bash +CHART_REPO_URL=http://localhost:6873 dms_cli download_helm_chart bouncer-xapp 2.0.0 +``` + +Install the xApp with helm. + +```bash +helm install bouncer-xapp -n ricxapp bouncer-xapp-2.0.0.tgz +``` + +Once installed you can start and stop the application by scaling its deployment +in kubernetes. + +```bash +# start xapp +kubectl scale --replicas=1 -n ricxapp deployment ricxapp-bouncer-xapp +# stop xapp +kubectl scale --replicas=0 -n ricxapp deployment ricxapp-bouncer-xapp +```