Skip to content

Commit

Permalink
xapp deployment guide for oran sc
Browse files Browse the repository at this point in the history
  • Loading branch information
gckopper committed Apr 8, 2024
1 parent 104dfd6 commit 0c079d1
Showing 1 changed file with 85 additions and 1 deletion.
86 changes: 85 additions & 1 deletion docs/RICs/oran-sc.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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/
Expand All @@ -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 <path-to-bouncer-xapp>/Bouncer/init/config-file.json --shcema_file_path <path-to-bouncer-xapp>/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
```

0 comments on commit 0c079d1

Please sign in to comment.