Example xApp: take the new xApp descriptor into use
Change-Id: I5669eda4621bb0e99f4d34b5712c389e41dbce8b
Signed-off-by: Mohamed Abukar <abukar.mohamed@nokia.com>
diff --git a/examples/build/build_example_xapp.sh b/examples/build/build_example_xapp.sh
index d81617e..7d1a623 100755
--- a/examples/build/build_example_xapp.sh
+++ b/examples/build/build_example_xapp.sh
@@ -22,12 +22,12 @@
echo "--> build_example_xapp.sh starts"
# Install RMR from deb packages at packagecloud.io
-rmr=rmr_3.7.2_amd64.deb
-wget --content-disposition https://packagecloud.io/o-ran-sc/staging/packages/debian/stretch/$rmr/download.deb
+rmr=rmr_4.2.2_amd64.deb
+wget --content-disposition https://packagecloud.io/o-ran-sc/release/packages/debian/stretch/$rmr/download.deb
sudo dpkg -i $rmr
rm $rmr
-rmrdev=rmr-dev_3.7.2_amd64.deb
-wget --content-disposition https://packagecloud.io/o-ran-sc/staging/packages/debian/stretch/$rmrdev/download.deb
+rmrdev=rmr-dev_4.2.2_amd64.deb
+wget --content-disposition https://packagecloud.io/o-ran-sc/release/packages/debian/stretch/$rmrdev/download.deb
sudo dpkg -i $rmrdev
rm $rmrdev
diff --git a/examples/build/run_example_xapp.sh b/examples/build/run_example_xapp.sh
index 169effb..db42d0f 100755
--- a/examples/build/run_example_xapp.sh
+++ b/examples/build/run_example_xapp.sh
@@ -22,6 +22,6 @@
# Abstract: Starts the example xApp service
# Date: 19 March 2020
#
-export RMR_SEED_RT=./uta_rtg.rt
+export RMR_SEED_RT=./config/uta_rtg.rt
-exec ./example_xapp -f ./config-file.json
+exec ./example_xapp -f ./config/config-file.json
diff --git a/examples/cmd/example-xapp.go b/examples/cmd/example-xapp.go
index a08844b..acb0b8d 100755
--- a/examples/cmd/example-xapp.go
+++ b/examples/cmd/example-xapp.go
@@ -135,7 +135,7 @@
func (e *ExampleXapp) Run() {
// Set MDC (read: name visible in the logs)
- xapp.Logger.SetMdc("example-xapp", "0.1.2")
+ xapp.Logger.SetMdc("example-xapp", "0.1.3")
// Register various callback functions for application management
xapp.SetReadyCB(func(d interface{}) { e.rmrReady = true }, true)
diff --git a/examples/config/config-file.json b/examples/config/config-file.json
index bfd885c..8caecdb 100755
--- a/examples/config/config-file.json
+++ b/examples/config/config-file.json
@@ -1,41 +1,109 @@
{
- "local": {
- "host": ":8080"
+ "name": "example",
+ "version": "0.6.0",
+ "vendor": "Nokia",
+ "moId": "SEP",
+ "containers": [
+ {
+ "name": "example",
+ "image": {
+ "registry": "ranco-dev-tools.eastus.cloudapp.azure.com:10001",
+ "name": "example-xapp",
+ "tag": "0.5.3"
+ },
+ "resources": {
+ "limits": {
+ "cpu": "1",
+ "memory": "50Mi"
+ },
+ "requests": {
+ "cpu": "1",
+ "memory": "100Mi"
+ }
+ }
+ }
+ ],
+ "livenessProbe": {
+ "httpGet": {
+ "path": "ric/v1/health/alive",
+ "port": 8080
+ },
+ "initialDelaySeconds": 5,
+ "periodSeconds": 15
},
- "logger": {
- "level": 3
+ "readinessProbe": {
+ "httpGet": {
+ "path": "ric/v1/health/ready",
+ "port": 8080
+ },
+ "initialDelaySeconds": 5,
+ "periodSeconds": 15
},
- "db": {
- "namespace": "sdl",
- "waitForSdl": true
+ "messaging": {
+ "ports": [
+ {
+ "name": "http",
+ "container": "example",
+ "port": 8080,
+ "description": "http service"
+ },
+ {
+ "name": "rmr-route",
+ "container": "example",
+ "port": 4561,
+ "description": "rmr route port for example"
+ },
+ {
+ "name": "rmr-data",
+ "container": "example",
+ "port": 4560,
+ "maxSize": 65536,
+ "rxMessages": ["RIC_SUB_RESP", "RIC_SUB_FAILURE", "RIC_SUB_DEL_RESP", "RIC_INDICATION"],
+ "txMessages": ["RIC_SUB_REQ", "RIC_SUB_DEL_REQ", "RIC_SGNB_ADDITION_REQ", "RIC_SGNB_ADDITION_ACK"],
+ "mtypes" : [
+ {"name":"TESTNAME1","id":55555},
+ {"name":"TESTNAME2","id":55556}
+ ],
+ "policies": [],
+ "description": "rmr data port for example"
+ }
+ ]
},
"controls": {
- "subscriptionActive": true
- },
- "rmr": {
- "protPort": "tcp:4560",
- "maxSize": 65536,
- "rxMessages": ["RIC_SUB_RESP", "RIC_SUB_FAILURE", "RIC_SUB_DEL_RESP", "RIC_INDICATION"],
- "txMessages": ["RIC_SUB_REQ", "RIC_SUB_DEL_REQ", "RIC_SGNB_ADDITION_REQ", "RIC_SGNB_ADDITION_ACK"],
- "mtypes" : [
- {"name":"TESTNAME1","id":55555},
- {"name":"TESTNAME2","id":55556}
- ]
- },
- "metrics": [
- {
- "objectName": "UEEventStreamingCounters",
- "objectInstance": "SgNBAdditionRequest",
- "name": "ricxapp_ExampleXapp_SgNBAdditionRequest",
- "type": "counter",
- "description": "The total number of SG addition request events processed"
+ "logger": {
+ "level": 3
},
+ "subscription": {
+ "subscriptionActive": true
+ }
+ },
+ "metrics": {
+ "url": "/ric/v1/metrics",
+ "namespace": "ricxapp"
+ },
+ "faults": { },
+ "measurements": [
{
- "objectName": "UEEventStreamingCounters",
- "objectInstance": "SgNBAdditionRequestAcknowledge",
- "name": "ricxapp_ExampleXapp_SgNBAdditionRequestAcknowledge",
- "type": "counter",
- "description": "The total number of SG addition request acknowledge events"
+ "moId": "XAPP-example",
+ "measType": "X2AP_Streaming",
+ "measId": "91001",
+ "measInterval": "60",
+ "metrics": [
+ {
+ "objectName": "UEEventStreamingCounters",
+ "objectInstance": "SgNBAdditionRequest",
+ "name": "ricxapp_ExampleXapp_SgNBAdditionRequest",
+ "type": "counter",
+ "description": "The total number of SG addition request events processed"
+ },
+ {
+ "objectName": "UEEventStreamingCounters",
+ "objectInstance": "SgNBAdditionRequestAcknowledge",
+ "name": "ricxapp_ExampleXapp_SgNBAdditionRequestAcknowledge",
+ "type": "counter",
+ "description": "The total number of SG addition request acknowledge events"
+ }
+ ]
}
]
}
diff --git a/examples/go.mod b/examples/go.mod
index 53baac5..750f9a8 100644
--- a/examples/go.mod
+++ b/examples/go.mod
@@ -2,9 +2,9 @@
module gerrit.o-ran-sc.org/r/ric-plt/xapp-frame/example-xapp
-require gerrit.o-ran-sc.org/r/ric-plt/xapp-frame v0.4.1
+require gerrit.o-ran-sc.org/r/ric-plt/xapp-frame v0.6.1
-replace gerrit.o-ran-sc.org/r/ric-plt/xapp-frame => gerrit.o-ran-sc.org/r/ric-plt/xapp-frame.git v0.4.6
+replace gerrit.o-ran-sc.org/r/ric-plt/xapp-frame => gerrit.o-ran-sc.org/r/ric-plt/xapp-frame.git v0.6.1
replace gerrit.o-ran-sc.org/r/ric-plt/sdlgo => gerrit.o-ran-sc.org/r/ric-plt/sdlgo.git v0.5.0
diff --git a/examples/go.sum b/examples/go.sum
index 4db27b8..f36f60f 100644
--- a/examples/go.sum
+++ b/examples/go.sum
@@ -3,12 +3,20 @@
gerrit.o-ran-sc.org/r/com/golog.git v0.0.1/go.mod h1:b8YB31U8/4iRpABioeSzGi/YMzOQ/Zq7hrJmmXKqlJk=
gerrit.o-ran-sc.org/r/ric-plt/alarm-go.git/alarm v0.4.0 h1:Uvyfuq2jyb1aosy2BEzH1g3pe2gy4sMgpsXlvjVeBzI=
gerrit.o-ran-sc.org/r/ric-plt/alarm-go.git/alarm v0.4.0/go.mod h1:AdEWKtERGvOQy9ybLhyhrb9w9LLVn8i9xzTwoR5n4BY=
+gerrit.o-ran-sc.org/r/ric-plt/alarm-go.git/alarm v0.4.2 h1:XNfkp3PwZ7pfkPszX7NaX6DzToCGjcWTLbIHYqCFNu0=
+gerrit.o-ran-sc.org/r/ric-plt/alarm-go.git/alarm v0.4.2/go.mod h1:AdEWKtERGvOQy9ybLhyhrb9w9LLVn8i9xzTwoR5n4BY=
gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/common v1.0.21 h1:eK9nUZOTMJ/EnMpH9bkWtMgOvCn3u4+PNCb9gu10s6w=
gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/common v1.0.21/go.mod h1:QJ1uPPZosGbhxUWpUpeM5fLqFHdnWTrVnvW2DgyOCes=
+gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/common v1.0.35 h1:TGXHb4DNY8on+ej4S9VUnk2HibIC/5chDy64OE+bQBQ=
+gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/common v1.0.35/go.mod h1:QJ1uPPZosGbhxUWpUpeM5fLqFHdnWTrVnvW2DgyOCes=
gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/entities v1.0.21 h1:PQ/Mu2ol+8Oh/0BqCWWhPlVVoRCg5dQDEGm4+Opp5w4=
gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/entities v1.0.21/go.mod h1:GXiXLz4ORBeIr0FLIbzENRykgh3Po5uPkX2jICxnRF0=
+gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/entities v1.0.35 h1:tkM3yE8UzmuH4nf9TqAmiNBSuIZ2CtcMRH2eBIYIzpQ=
+gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/entities v1.0.35/go.mod h1:G+4sUBMbLfQ+RrGS65U15tKmbnP+/1b5oLTPmMfyfT4=
gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/reader v1.0.21 h1:N3UbqJ9WqC8JEz/TwHHwZwCFAW6VTlZLpD5lnbdD+Y8=
gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/reader v1.0.21/go.mod h1:SQBZLy1HP94i1vQ3y730wGFsrHqZtgPaEkzPgtqBNw0=
+gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/reader v1.0.35 h1:LcxnUUDwsCzYEISKmkjkyYfg/lnLt8ofkPiGK69vNIA=
+gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/reader v1.0.35/go.mod h1:2bSaXTpECbZieB8bMnubTqMwF3n+mMBxlTaAXvcduNg=
gerrit.o-ran-sc.org/r/ric-plt/sdlgo.git v0.5.0 h1:+P3XuWKSaMbzh5PNtrW9gkZlCN0hKrZq+Cn8JetwBys=
gerrit.o-ran-sc.org/r/ric-plt/sdlgo.git v0.5.0/go.mod h1:y2WhrCvdLkAKdH+ySdHSOSehACJkTMyZghCGVcqoZzc=
gerrit.o-ran-sc.org/r/ric-plt/xapp-frame.git v0.0.26 h1:zFsExCZVAX9vTcLEHNsYgxnKDsGREKoVaz/jwRfTTOI=
@@ -17,6 +25,8 @@
gerrit.o-ran-sc.org/r/ric-plt/xapp-frame.git v0.4.1/go.mod h1:29CdUcCrNEqVBjQWAlgeGrYxSWqSZ4e67xzhuSf6BkI=
gerrit.o-ran-sc.org/r/ric-plt/xapp-frame.git v0.4.6 h1:Yhizs1A+0n0TLFxeGZO1YYQy8eBX9UEj4e4PgmK008k=
gerrit.o-ran-sc.org/r/ric-plt/xapp-frame.git v0.4.6/go.mod h1:29CdUcCrNEqVBjQWAlgeGrYxSWqSZ4e67xzhuSf6BkI=
+gerrit.o-ran-sc.org/r/ric-plt/xapp-frame.git v0.6.1 h1:w//eBu78PZNfTgiPD8encOMTfYQUkniNTCoVtQqgE/A=
+gerrit.o-ran-sc.org/r/ric-plt/xapp-frame.git v0.6.1/go.mod h1:bjhhEII07w+zPQzyvqTq84TjKQPa6IkcnSyWB1DfGHo=
github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU=
@@ -124,6 +134,8 @@
github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.3.2 h1:6nsPYzhq5kReh6QImI3k5qWzO4PEbvbIW2cwSfR/6xs=
github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
+github.com/golang/protobuf v1.3.4 h1:87PNWwrRvUSnqS4dlcBU/ftvOIBep4sYuBLlh6rX2wk=
+github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw=
github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
github.com/google/go-cmp v0.3.0 h1:crn/baboCvb5fXaQ0IJ1SGTsTVrWpDsCWC8EGETZijY=