ConfigMap parameter handling change 74/5674/1
authorAnssi Mannila <anssi.mannila@nokia.com>
Thu, 18 Feb 2021 10:36:59 +0000 (12:36 +0200)
committerAnssi Mannila <anssi.mannila@nokia.com>
Thu, 18 Feb 2021 10:37:12 +0000 (12:37 +0200)
Change-Id: Ibbcf52b3aad237c8aff3d1c9f66bfa72185645d3
Signed-off-by: Anssi Mannila <anssi.mannila@nokia.com>
docs/user-guide.rst
go.sum
pkg/control/control.go

index 603d1e0..5977110 100755 (executable)
@@ -67,9 +67,10 @@ Architecture
       header when E2 Termination sends the subscribed message to xApp. When xApp wants to delete the subscription, the same sequence number
       must be included in the ASN.1 encoded RIC Subscription Delete Request message sent to Subscription Manager.
 
-      Subscription Manager allocates RIC Requestor ID. Currently the ID value is always 123. In merge case subscription is created only for
-      the first requestor. RAN gets the Request of the xApp who makes the first subscription. RAN uses Subscription Manager allocated Requestor
-      ID in all RIC Indication messages it sends to RIC for the subscription.
+      Subscription Manager allocates and substitutes RIC Requestor ID for E2 interface communication. Currently the ID value is always 123.
+      RAN gets the Request of the xApp who makes the first subscription. RAN uses Subscription Manager allocated Requestor ID in all RIC
+      Indication messages it sends to RIC for the subscription.  Subscription Manager returns the same RIC Requestor ID in response message
+      to xApp as was in the request. In merge case subscription is created only for the first requestor.
 
       TransactionId (Xid) in RMR message header is used to track messages between xApp and Subscription Manager. xApp allocates it. Subscription
       Manager returns TransactionId received from xApp in response message to xApp. xApp uses it to map response messages to request messages
@@ -285,6 +286,36 @@ Metrics
                - SDLReadFailure: The total number of SDL read failures
                - SDLRemoveFailure: The total number of SDL read failures
 
+Configurable parameters
+-----------------------
+ Subscription Manager has following configurable parameters.
+   - Retry timeout for RIC Subscription Request message
+      - e2tSubReqTimeout_ms: 2000 is the default value
+
+   - Retry timeout for RIC Subscription Delete Request message
+      - e2tSubDelReqTime_ms: 2000 is the default value
+
+   - Waiting time for RIC Subscription Response and RIC Subscription Delete Response messages
+      - e2tRecvMsgTimeout_ms: 2000 is the default value
+
+   - Try count for RIC Subscription Request message   
+      - e2tMaxSubReqTryCount: 2 is the default value
+
+   - Try count for RIC Subscription Delete Request message   
+      - e2tMaxSubDelReqTryCount: 2 is the default value
+   
+   - Are subscriptions read from database in Subscription Manager startup
+      - readSubsFromDb: "true"  is the default value
+ The parameters can be changed on the fly via Kubernetes Configmap. Default parameters values are defined in Helm chart
+
+ Use following command to open Subscription Manager's Configmap in Nano editor. Firts change parameter and then store the
+ change by pressing first Ctrl + o. Close editor by pressing the Ctrl + x. The change is visible in Subscription Manager's
+ log after some 20 - 30 seconds.
+ .. code-block:: none
+
+  KUBE_EDITOR="nano" kubectl edit cm configmap-ricplt-submgr-submgrcfg -n ricplt
 
 REST interface for debugging and testing
 ----------------------------------------
diff --git a/go.sum b/go.sum
index 501ad6d..b7a9e85 100644 (file)
--- a/go.sum
+++ b/go.sum
@@ -5,6 +5,8 @@ gerrit.o-ran-sc.org/r/com/golog.git v0.0.2 h1:Ix6SgFuzd6yW6Ur6+qDlGhDO65UYs8PiIk
 gerrit.o-ran-sc.org/r/com/golog.git v0.0.2/go.mod h1:A7hUL52YQSO4dFIZNcj76XQ09C9PftAe3LyL7kqBnok=
 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/alarm-go.git/alarm v0.5.0 h1:OKDsIDlttbaoHwleyjflIWVZPgPvYbDhim6gWF0zf5E=
+gerrit.o-ran-sc.org/r/ric-plt/alarm-go.git/alarm v0.5.0/go.mod h1:AdEWKtERGvOQy9ybLhyhrb9w9LLVn8i9xzTwoR5n4BY=
 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.35 h1:tkM3yE8UzmuH4nf9TqAmiNBSuIZ2CtcMRH2eBIYIzpQ=
@@ -21,6 +23,8 @@ gerrit.o-ran-sc.org/r/ric-plt/xapp-frame.git v0.5.12 h1:z5LWpefAw7JjKn3WSQ4+/f0P
 gerrit.o-ran-sc.org/r/ric-plt/xapp-frame.git v0.5.12/go.mod h1:bjhhEII07w+zPQzyvqTq84TjKQPa6IkcnSyWB1DfGHo=
 gerrit.o-ran-sc.org/r/ric-plt/xapp-frame.git v0.6.7 h1:lTURRbfaV0kPcplGF7jyowRXoUkNknRzd7Y51ZPs5PI=
 gerrit.o-ran-sc.org/r/ric-plt/xapp-frame.git v0.6.7/go.mod h1:fpHeoGISAkz6bNfgZtq8Ycg9i9KdGgUBP2jLs6TGk2g=
+gerrit.o-ran-sc.org/r/ric-plt/xapp-frame.git v0.6.8 h1:6gVWfd89wzo7w1rE2INGnIJGj6GXj2xAgas70o75tak=
+gerrit.o-ran-sc.org/r/ric-plt/xapp-frame.git v0.6.8/go.mod h1:MRTeTBLROgTA2t91SXYjTbRsxoOhMMvvkK/ChLVRZUU=
 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=
index ac142eb..59a840e 100755 (executable)
@@ -51,7 +51,6 @@ func idstring(err error, entries ...fmt.Stringer) string {
        if err != nil {
                retval += filler + "err(" + err.Error() + ")"
                filler = " "
-
        }
        return retval
 }
@@ -97,7 +96,6 @@ func init() {
 
 func NewControl() *Control {
 
-       ReadConfigParameters()
        transport := httptransport.New(viper.GetString("rtmgr.HostAddr")+":"+viper.GetString("rtmgr.port"), viper.GetString("rtmgr.baseUrl"), []string{"http"})
        rtmgrClient := RtmgrClient{rtClient: rtmgrclient.New(transport, strfmt.Default)}
 
@@ -108,8 +106,6 @@ func NewControl() *Control {
        tracker := new(Tracker)
        tracker.Init()
 
-       //subscriber := xapp.NewSubscriber(viper.GetString("subscription.host"), viper.GetInt("subscription.timeout"))
-
        c := &Control{e2ap: new(E2ap),
                registry: registry,
                tracker:  tracker,
@@ -117,12 +113,12 @@ func NewControl() *Control {
                //subscriber: subscriber,
                Counters: xapp.Metric.RegisterCounterGroup(GetMetricsOpts(), "SUBMGR"),
        }
+       c.ReadConfigParameters("")
 
        // Register REST handler for testing support
        xapp.Resource.InjectRoute("/ric/v1/test/{testId}", c.TestRestHandler, "POST")
 
        go xapp.Subscription.Listen(c.SubscriptionHandler, c.QueryHandler, c.SubscriptionDeleteHandler)
-       //go c.subscriber.Listen(c.SubscriptionHandler, c.QueryHandler)
 
        if readSubsFromDb == "false" {
                return c
@@ -144,7 +140,7 @@ func NewControl() *Control {
 //-------------------------------------------------------------------
 //
 //-------------------------------------------------------------------
-func ReadConfigParameters() {
+func (c *Control) ReadConfigParameters(f string) {
 
        // viper.GetDuration returns nanoseconds
        e2tSubReqTimeout = viper.GetDuration("controls.e2tSubReqTimeout_ms") * 1000000
@@ -203,6 +199,7 @@ func (c *Control) ReadyCB(data interface{}) {
 
 func (c *Control) Run() {
        xapp.SetReadyCB(c.ReadyCB, nil)
+       xapp.AddConfigChangeListener(c.ReadConfigParameters)
        xapp.Run(c)
 }