From 429cfe6e2302ee69e067402489660f8e22319eeb Mon Sep 17 00:00:00 2001 From: Juha Hyttinen Date: Tue, 31 Mar 2020 11:23:02 +0300 Subject: [PATCH] Using different versioning scheme Using xapp-frame version with RMR SI95 backend Change-Id: Ic10efca8e391757f4ddde2a4b20efc419cf94157 Signed-off-by: Juha Hyttinen --- Dockerfile | 30 +++++++++++++++++++++++++----- container-tag.yaml | 2 +- go.mod | 4 ++-- go.sum | 13 +++++++------ pkg/control/control.go | 25 +++++++++++++++++++------ 5 files changed, 54 insertions(+), 20 deletions(-) diff --git a/Dockerfile b/Dockerfile index 4e82a9a..b49723c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -54,11 +54,21 @@ RUN export GOBIN=/usr/local/bin/ ; \ && go install github.com/go-delve/delve/cmd/dlv -ARG RMRVERSION=3.5.0 -# Install RMr shared library -RUN wget --content-disposition https://packagecloud.io/o-ran-sc/staging/packages/debian/stretch/rmr_${RMRVERSION}_amd64.deb/download.deb && dpkg -i rmr_${RMRVERSION}_amd64.deb && rm -rf rmr_${RMRVERSION}_amd64.deb -# Install RMr development header files -RUN wget --content-disposition https://packagecloud.io/o-ran-sc/staging/packages/debian/stretch/rmr-dev_${RMRVERSION}_amd64.deb/download.deb && dpkg -i rmr-dev_${RMRVERSION}_amd64.deb && rm -rf rmr-dev_${RMRVERSION}_amd64.deb +# +# RMR +# +ARG RMRVERSION=3.6.2 +ARG RMRLIBURL=https://packagecloud.io/o-ran-sc/staging/packages/debian/stretch/rmr_${RMRVERSION}_amd64.deb/download.deb +ARG RMRDEVURL=https://packagecloud.io/o-ran-sc/staging/packages/debian/stretch/rmr-dev_${RMRVERSION}_amd64.deb/download.deb +RUN wget --content-disposition ${RMRLIBURL} && dpkg -i rmr_${RMRVERSION}_amd64.deb +RUN wget --content-disposition ${RMRDEVURL} && dpkg -i rmr-dev_${RMRVERSION}_amd64.deb +RUN rm -f rmr_${RMRVERSION}_amd64.deb rmr-dev_${RMRVERSION}_amd64.deb + + +RUN mkdir /manifests/ +RUN echo "rmrlib ${RMRVERSION} ${RMRLIBURL}" >> /manifests/versions.txt +RUN echo "rmrdev ${RMRVERSION} ${RMRDEVURL}" >> /manifests/versions.txt +RUN echo "swagger ${SWAGGERVERSION} ${SWAGGERURL}" >> /manifests/versions.txt WORKDIR /opt/submgr @@ -80,6 +90,10 @@ RUN cd 3rdparty/libe2ap && \ cp *.h /usr/local/include/ && \ ldconfig +RUN echo "E2AP ?" >> /manifests/versions.txt +RUN echo "E2SM-gNB-NRT ?" >> /manifests/versions.txt +RUN echo "E2SM-gNB-X2 ?" >> /manifests/versions.txt + COPY e2ap e2ap RUN cd e2ap/libe2ap_wrapper && \ gcc -c ${CFLAGS} -g -fPIC *.c && \ @@ -112,6 +126,8 @@ COPY go.sum go.sum RUN go mod download RUN go mod tidy +RUN cp go.mod go.sum /manifests/ + # # # @@ -131,6 +147,8 @@ RUN mkdir -p /root/go && \ swagger generate client -f api/routing_manager.yaml -t pkg/ -m rtmgr_models -c rtmgr_client +RUN echo "rtmgrapi ${RTMGRVERSION} https://gerrit.o-ran-sc.org/r/ric-plt/rtmgr" >> /manifests/versions.txt + # # # @@ -172,6 +190,8 @@ FROM ubuntu:18.04 RUN apt update && apt install -y iputils-ping net-tools curl tcpdump +COPY --from=submgrbuild /manifests /manifests + COPY run_submgr.sh / COPY --from=submgrbuild /opt/bin/submgr / COPY --from=submgrbuild /usr/local/include /usr/local/include diff --git a/container-tag.yaml b/container-tag.yaml index def39d2..3b9d52b 100644 --- a/container-tag.yaml +++ b/container-tag.yaml @@ -2,4 +2,4 @@ # By default this file is in the docker build directory, # but the location can configured in the JJB template. --- -tag: "4.0.0.5" +tag: "0.4.0" diff --git a/go.mod b/go.mod index 7c1c04b..9ef832e 100644 --- a/go.mod +++ b/go.mod @@ -14,9 +14,9 @@ require ( github.com/stretchr/testify v1.5.1 ) -replace gerrit.o-ran-sc.org/r/ric-plt/sdlgo => gerrit.o-ran-sc.org/r/ric-plt/sdlgo.git v0.2.0 +replace gerrit.o-ran-sc.org/r/ric-plt/sdlgo => gerrit.o-ran-sc.org/r/ric-plt/sdlgo.git v0.5.2 -replace gerrit.o-ran-sc.org/r/ric-plt/xapp-frame => gerrit.o-ran-sc.org/r/ric-plt/xapp-frame.git v0.0.30 +replace gerrit.o-ran-sc.org/r/ric-plt/xapp-frame => gerrit.o-ran-sc.org/r/ric-plt/xapp-frame.git v0.4.5 replace gerrit.o-ran-sc.org/r/com/golog => gerrit.o-ran-sc.org/r/com/golog.git v0.0.1 diff --git a/go.sum b/go.sum index d839f9e..83e29f2 100644 --- a/go.sum +++ b/go.sum @@ -9,10 +9,10 @@ gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/entities v1.0.21 h1:PQ/Mu2ol+8Oh/0B 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/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/sdlgo.git v0.2.0 h1:7edCLIQtk9xCwxTtLRUlXr8wQ6nmr/Mo4ZoqjF3m0NE= -gerrit.o-ran-sc.org/r/ric-plt/sdlgo.git v0.2.0/go.mod h1:2Y8gw2jqj9urI8VFqFQn7BX0J3A852+YrXVV9V8gOt4= -gerrit.o-ran-sc.org/r/ric-plt/xapp-frame.git v0.4.1 h1:ydw6WM3PNOKI0LAEyCKWCJ4LncHMfyHdpvCAHBYwrdE= -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/sdlgo.git v0.5.2 h1:UK7awyRKIkVdokWvvkYvazlg3EWIfMnIqCcJxTnLlDA= +gerrit.o-ran-sc.org/r/ric-plt/sdlgo.git v0.5.2/go.mod h1:y2WhrCvdLkAKdH+ySdHSOSehACJkTMyZghCGVcqoZzc= +gerrit.o-ran-sc.org/r/ric-plt/xapp-frame.git v0.4.5 h1:X3+ZOih65U2oqgk59BY/MAd8HhG+finlMsJmeFyvTuI= +gerrit.o-ran-sc.org/r/ric-plt/xapp-frame.git v0.4.5/go.mod h1:29CdUcCrNEqVBjQWAlgeGrYxSWqSZ4e67xzhuSf6BkI= 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= @@ -118,8 +118,8 @@ github.com/go-openapi/validate v0.19.3 h1:PAH/2DylwWcIU1s0Y7k3yNmeAgWOcKrNE2Q7Ww github.com/go-openapi/validate v0.19.3/go.mod h1:90Vh6jjkTn+OT1Eefm0ZixWNFjhtOH7vS9k0lo6zwJo= github.com/go-openapi/validate v0.19.6 h1:WsKw9J1WzYBVxWRYwLqEk3325RL6G0SSWksuamkk6q0= github.com/go-openapi/validate v0.19.6/go.mod h1:8DJv2CVJQ6kGNpFW6eV9N3JviE1C85nY1c2z52x1Gk4= -github.com/go-redis/redis v6.15.2+incompatible h1:9SpNVG76gr6InJGxoZ6IuuxaCOQwDAhzyXg+Bs+0Sb4= -github.com/go-redis/redis v6.15.2+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8wamY7mA7PouImQ2Jvg6kA= +github.com/go-redis/redis v6.15.3+incompatible h1:NZ0O90AhLSvSrvLZ/S9h7D4kl1mW2PrKyxL7MyBKO2g= +github.com/go-redis/redis v6.15.3+incompatible/go.mod h1:W2YCLaZryXHirdd9QqwkiVUxCQsrx8SbLq9Uqk7JS7A= github.com/go-stack/stack v1.8.0 h1:5SgMzNM5HxrEjV0ww2lTmX6E2Izsfxas4+YHWRs3Lsk= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= @@ -280,6 +280,7 @@ golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190204203706-41f3e6584952/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190321052220-f7bb7a8bee54/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= diff --git a/pkg/control/control.go b/pkg/control/control.go index 51c84e3..98a2474 100755 --- a/pkg/control/control.go +++ b/pkg/control/control.go @@ -103,7 +103,7 @@ func NewControl() *Control { //subscriber: subscriber, } c.XappWrapper.Init("") - go xapp.Subscription.Listen(c.SubscriptionHandler, c.QueryHandler) + go xapp.Subscription.Listen(c.SubscriptionHandler, c.QueryHandler, c.SubscriptionDeleteHandler) //go c.subscriber.Listen(c.SubscriptionHandler, c.QueryHandler) return c } @@ -122,7 +122,7 @@ func (c *Control) Run() { //------------------------------------------------------------------- // //------------------------------------------------------------------- -func (c *Control) SubscriptionHandler(stype models.SubscriptionType, params interface{}) (models.SubscriptionResult, error) { +func (c *Control) SubscriptionHandler(stype models.SubscriptionType, params interface{}) (*models.SubscriptionResponse, error) { /* switch p := params.(type) { case *models.ReportParams: @@ -136,7 +136,11 @@ func (c *Control) SubscriptionHandler(stype models.SubscriptionType, params inte case *models.PolicyParams: } */ - return models.SubscriptionResult{}, fmt.Errorf("Subscription rest interface not implemented") + return &models.SubscriptionResponse{}, fmt.Errorf("Subscription rest interface not implemented") +} + +func (c *Control) SubscriptionDeleteHandler(string) error { + return fmt.Errorf("Subscription rest interface not implemented") } func (c *Control) QueryHandler() (models.SubscriptionList, error) { @@ -231,6 +235,7 @@ func (c *Control) handleXAPPSubscriptionRequest(params *xapptweaks.RMRParams) { return } + //TODO handle subscription toward e2term inside AssignToSubscription / hide handleSubscriptionCreate in it? subs, err := c.registry.AssignToSubscription(trans, subReqMsg) if err != nil { xapp.Logger.Error("XAPP-SubReq: %s", idstring(err, trans)) @@ -263,7 +268,7 @@ func (c *Control) handleXAPPSubscriptionRequest(params *xapptweaks.RMRParams) { } } xapp.Logger.Info("XAPP-SubReq: failed %s", idstring(err, trans, subs)) - c.registry.RemoveFromSubscription(subs, trans, 5*time.Second) + //c.registry.RemoveFromSubscription(subs, trans, 5*time.Second) } //------------------------------------------------------------------- @@ -314,7 +319,8 @@ func (c *Control) handleXAPPSubscriptionDeleteRequest(params *xapptweaks.RMRPara c.rmrSendToXapp("", subs, trans) } - c.registry.RemoveFromSubscription(subs, trans, 5*time.Second) + //TODO handle subscription toward e2term insiged RemoveFromSubscription / hide handleSubscriptionDelete in it? + //c.registry.RemoveFromSubscription(subs, trans, 5*time.Second) } //------------------------------------------------------------------- @@ -369,6 +375,10 @@ func (c *Control) handleSubscriptionCreate(subs *Subscription, parentTrans *Tran xapp.Logger.Debug("SUBS-SubReq: Handling (cached response %s) %s", typeofSubsMessage(subRfMsg), idstring(nil, trans, subs, parentTrans)) } + //Now RemoveFromSubscription in here to avoid race conditions (mostly concerns delete) + if valid == false { + c.registry.RemoveFromSubscription(subs, parentTrans, 5*time.Second) + } parentTrans.SendEvent(subRfMsg, 0) } @@ -393,7 +403,10 @@ func (c *Control) handleSubscriptionDelete(subs *Subscription, parentTrans *Tran } else { subs.mutex.Unlock() } - + //Now RemoveFromSubscription in here to avoid race conditions (mostly concerns delete) + // If parallel deletes ongoing both might pass earlier sendE2TSubscriptionDeleteRequest(...) if + // RemoveFromSubscription locates in caller side (now in handleXAPPSubscriptionDeleteRequest(...)) + c.registry.RemoveFromSubscription(subs, parentTrans, 5*time.Second) parentTrans.SendEvent(nil, 0) } -- 2.16.6