O-RAN notes(6)---Bronze Near-Realtime RIC(ricplt) deployment (3)//xApp Deployment

First, pull all xApp images manually. There are four xApps for now: 

  • Hello World xApp
  • QP(QoE Predictor) xApp
  • QP Driver xApp
  • TS(Traffic Steering) xApp
#docker_pull_xapp.sh
echo && echo Pulling nexus3.o-ran-sc.org:10002/o-ran-sc/ric-app-hw:1.0.6
docker pull nexus3.o-ran-sc.org:10002/o-ran-sc/ric-app-hw:1.0.6

echo && echo Pulling nexus3.o-ran-sc.org:10002/o-ran-sc/ric-app-qp:0.0.2
docker pull nexus3.o-ran-sc.org:10002/o-ran-sc/ric-app-qp:0.0.2

echo && echo Pulling nexus3.o-ran-sc.org:10002/o-ran-sc/ric-app-qp-driver:1.0.9
docker pull nexus3.o-ran-sc.org:10002/o-ran-sc/ric-app-qp-driver:1.0.9

echo && echo Pulling nexus3.o-ran-sc.org:10002/o-ran-sc/ric-app-ts:1.0.11
docker pull nexus3.o-ran-sc.org:10002/o-ran-sc/ric-app-ts:1.0.11

Check that TCP port 32080 is supposed to be listened by service 'r4-infrastructure-kong-proxy': 

(11:49 dabs@ricpltbronze dep) > sudo kubectl get service -A | grep 32080
ricplt        r4-infrastructure-kong-proxy                NodePort    10.99.129.214            32080:32080/TCP,32443:32443/TCP   13h

However, TCP port 32080 has already been occupied by kube-proxy:

(11:48 dabs@ricpltbronze dep) > sudo netstat -anp | grep 32080
tcp6       0      0 :::32080                :::*                    LISTEN      8675/kube-proxy

There are two solutions to this problem:

(1) change the $(hostname) to the ip addr. of service 'r4-infrastructure-kong-proxy', such as:

#before update
curl --location --request POST "http://$(hostname):32080/onboard/api/v1/onboard/download"  --header 'Content-Type: application/json' --data-binary "@./onboard.hw.url"

#after update
curl --location --request POST "http://10.99.129.214:32080/onboard/api/v1/onboard/download"  --header 'Content-Type: application/json' --data-binary "@./onboard.hw.url"

(2) use port-forwarding function:

(09:54 dabs@ricpltbronze dep) > sudo kubectl get pods -A | grep kong
ricplt        r4-infrastructure-kong-6c7f6db759-skqzc                      2/2     Running     13         13h


#setup port-forwarding as port 32080 is already used by kube-proxy
(09:54 dabs@ricpltbronze dep) > sudo kubectl port-forward r4-infrastructure-kong-6c7f6db759-skqzc 32088:32080 -n ricplt
Forwarding from 127.0.0.1:32088 -> 32080
Forwarding from [::1]:32088 -> 32080
Handling connection for 32088
Handling connection for 32088
Handling connection for 32088
Handling connection for 32088
Handling connection for 32088
Handling connection for 32088
Handling connection for 32088

Now you need change "http://$(hostname):32080/..." to "http://localhost:32088/...": 

#before update
curl --location --request POST "http://$(hostname):32080/onboard/api/v1/onboard/download"  --header 'Content-Type: application/json' --data-binary "@./onboard.hw.url"

#after update
curl --location --request POST "http://localhost:32088/onboard/api/v1/onboard/download"  --header 'Content-Type: application/json' --data-binary "@./onboard.hw.url"

I will use solution #2.

 

Now let's begin the journey of xApp deployment:

(1) prepare xApp descriptors:

(11:42 dabs@ricpltbronze dep) > pwd
/home/dabs/oran/dep

#hello world xapp descriptor
$echo '{ "config-file.json_url": "https://gerrit.o-ran-sc.org/r/gitweb?p=ric-app/hw.git;a=blob_plain;f=init/config-file.json;hb=HEAD" }' > onboard.hw.url

#QP(QoE Predictor) xapp descriptor
$ echo '{"config-file.json_url": "https://gerrit.o-ran-sc.org/r/gitweb?p=ric-app/qp.git;a=blob_plain;f=xapp-descriptor/config.json;hb=HEAD" }' > onboard.qp.url

#QP(QoE Predictor) driver xapp descriptor(using v1.0.9)
$ echo '{"config-file.json_url": "https://gerrit.o-ran-sc.org/r/gitweb?p=ric-app/qp-driver.git;a=blob_plain;f=xapp-descriptor/config.json;h=9bc76b31fa36ffd74200023214ab169b132cf62b;hb=f628e2b58bde028a9b0bd0ee48168fb773814e69" }' > onboard.qpd.url

#TS(traffic steering) xapp descriptor
$ 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

(2) on-boarding xApp:

(11:39 dabs@ricpltbronze dep) > sudo curl --location --request POST "http://localhost:32088/onboard/api/v1/onboard/download"  --header 'Content-Type: application/json' --data-binary "@./onboard.hw.url"
{
    "status": "Created"
}
(11:39 dabs@ricpltbronze dep) > sudo curl --location --request POST "http://localhost:32088/onboard/api/v1/onboard/download"  --header 'Content-Type: application/json' --data-binary "@./onboard.qp.url" 
{
    "status": "Created"
}
(11:39 dabs@ricpltbronze dep) > sudo curl --location --request POST "http://localhost:32088/onboard/api/v1/onboard/download"  --header 'Content-Type: application/json' --data-binary "@./onboard.qpd.url"
{
    "status": "Created"
}
(11:39 dabs@ricpltbronze dep) > sudo curl --location --request POST "http://localhost:32088/onboard/api/v1/onboard/download"  --header 'Content-Type: application/json' --data-binary "@./onboard.ts.url"
{
    "status": "Created"
}

(3) verify that helm charts exists:

(11:39 dabs@ricpltbronze dep) > sudo curl --location --request GET "http://localhost:32088/onboard/api/v1/charts"
{
    "hwxapp": [
        {
            "name": "hwxapp",
            "version": "1.0.0",
            "description": "Standard xApp Helm Chart",
            "apiVersion": "v1",
            "appVersion": "1.0",
            "urls": [
                "charts/hwxapp-1.0.0.tgz"
            ],
            "created": "2020-07-18T03:39:18.993909473Z",
            "digest": "dc504820c1b80bf04e67cff4b8dc57e52bcbaf522bc25d86eda0398b94ca054b"
        }
    ],
    "qp": [
        {
            "name": "qp",
            "version": "0.0.2",
            "description": "Standard xApp Helm Chart",
            "apiVersion": "v1",
            "appVersion": "1.0",
            "urls": [
                "charts/qp-0.0.2.tgz"
            ],
            "created": "2020-07-18T03:39:30.945778392Z",
            "digest": "2741030c59ad4c49f0479621e7ef2dc13504e9c6311ab3df772210c83de567e5"
        }
    ],
    "qpdriver": [
        {
            "name": "qpdriver",
            "version": "1.0.9",
            "description": "Standard xApp Helm Chart",
            "apiVersion": "v1",
            "appVersion": "1.0",
            "urls": [
                "charts/qpdriver-1.0.9.tgz"
            ],
            "created": "2020-07-18T03:39:39.848799745Z",
            "digest": "6860c6fb3561a6504bb636feb434c35ba92c09e25671984ecfecc96cd6b43aa7"
        }
    ],
    "trafficxapp": [
        {
            "name": "trafficxapp",
            "version": "1.0.0",
            "description": "Standard xApp Helm Chart",
            "apiVersion": "v1",
            "appVersion": "1.0",
            "urls": [
                "charts/trafficxapp-1.0.0.tgz"
            ],
            "created": "2020-07-18T03:39:49.427098828Z",
            "digest": "d4fafc91c5e557d6c277ab5b599eb11898d3026c3b29d9588d2a028b10f7cbb3"
        }
    ]
}

(4) deploy xApp:

#deploy xApp
sudo curl --location --request POST "http://localhost:32088/appmgr/ric/v1/xapps"  --header 'Content-Type: application/json'  --data-raw '{"xappName": "hwxapp"}' -v

sudo curl --location --request POST "http://localhost:32088/appmgr/ric/v1/xapps"  --header 'Content-Type: application/json'  --data-raw '{"xappName": "qp"}' -v

sudo curl --location --request POST "http://localhost:32088/appmgr/ric/v1/xapps"  --header 'Content-Type: application/json'  --data-raw '{"xappName": "qpdriver"}' -v

sudo curl --location --request POST "http://localhost:32088/appmgr/ric/v1/xapps"  --header 'Content-Type: application/json'  --data-raw '{"xappName": "trafficxapp"}' -v

Note: I actually think that you need reboot to get the xApp pods successfully deployed.

(5) check xApp pods in ns ricxapp:

(11:55 dabs@ricpltbronze dep) > sudo kubectl get pod -n ricxapp -w
NAME                                  READY   STATUS    RESTARTS   AGE
ricxapp-hwxapp-684d8d675b-fdtmv       1/1     Running   4          115m
ricxapp-qp-5f6fc7b746-8jnqd           1/1     Running   3          63m
ricxapp-qpdriver-6b89bb66c-zdsk4      1/1     Running   3          45m
ricxapp-trafficxapp-96bc7bd6b-46f4c   1/1     Running   4          72m

Good luck! 

(to be continued)  

你可能感兴趣的:(4G/5G)