# Abstract: Builds a container to compile Subscription Manager's code
# Date: 28 May 2019
#
-FROM nexus3.o-ran-sc.org:10004/bldr-ubuntu18-c-go:3-u18.04-nng as submgrprebuild
+
+###########################################################
+#
+###########################################################
+FROM nexus3.o-ran-sc.org:10004/bldr-ubuntu18-c-go:3-u18.04-nng as submgrcore
RUN apt update && apt install -y iputils-ping net-tools curl tcpdump gdb valgrind
WORKDIR /opt/submgr
-RUN mkdir pkg
-
-#
-#
+###########################################################
#
+###########################################################
+FROM submgrcore as submgre2apbuild
+
+
ENV CFLAGS="-DASN_DISABLE_OER_SUPPORT"
ENV CGO_CFLAGS="-DASN_DISABLE_OER_SUPPORT"
RUN cd e2ap && test -z "$(/usr/local/go/bin/gofmt -l pkg/e2ap/e2ap_tests/*.go)"
-FROM submgrprebuild as submgrbuild
+###########################################################
+#
+###########################################################
+FROM submgre2apbuild as submgrbuild
#
#
#
#
#
#
+RUN mkdir pkg
COPY api api
-# "Getting and generating routing managers api client"
+
+ARG RTMGRVERSION=cd7867c8f527f46fd8702b0b8d6b380a8e134bea
+
RUN git clone "https://gerrit.o-ran-sc.org/r/ric-plt/rtmgr" \
+ && git -C "rtmgr" checkout $RTMGRVERSION \
&& cp rtmgr/api/routing_manager.yaml api/ \
&& rm -rf rtmgr
+
RUN mkdir -p /root/go && \
/usr/local/go/bin/swagger generate client -f api/routing_manager.yaml -t pkg/ -m rtmgr_models -c rtmgr_client
RUN test -z "$(/usr/local/go/bin/gofmt -l pkg/xapptweaks/*.go)"
+###########################################################
#
-#
-#
+###########################################################
FROM ubuntu:18.04
RUN apt update && apt install -y iputils-ping net-tools curl tcpdump
description: "Invalid data"
201:
description: "Xapp list received"
- /handles/v1/e2t:
+ /handles/e2t:
post:
tags:
- "handle"
description: "Invalid data"
201:
description: "new e2t instance is considered and platform routes are established"
- /handles/v1/associate-ran-to-e2t:
+ /handles/associate-ran-to-e2t:
post:
tags:
- "handle"
description: "Invalid data"
201:
description: "e2t ran mapping recieved, platform routes"
- /handles/v1/dissociate-ran:
+ /handles/dissociate-ran:
post:
tags:
- "handle"
}
}
xapp.Logger.Info("XAPP-SubReq: failed %s", idstring(err, trans, subs))
- go c.registry.RemoveFromSubscription(subs, trans, 5*time.Second)
+ c.registry.RemoveFromSubscription(subs, trans, 5*time.Second)
}
//-------------------------------------------------------------------
c.rmrSendToXapp("", subs, trans)
}
- go c.registry.RemoveFromSubscription(subs, trans, 5*time.Second)
+ c.registry.RemoveFromSubscription(subs, trans, 5*time.Second)
}
//-------------------------------------------------------------------
return nil
}
- r.mutex.Unlock()
+ go func() {
+ if waitRouteClean > 0 {
+ time.Sleep(waitRouteClean)
+ }
- //
- // Wait some time before really do route updates
- //
- if waitRouteClean > 0 {
- subs.mutex.Unlock()
- time.Sleep(waitRouteClean)
subs.mutex.Lock()
- }
+ defer subs.mutex.Unlock()
+ xapp.Logger.Info("CLEAN %s", subs.String())
- xapp.Logger.Info("CLEAN %s", subs.String())
+ if epamount == 0 {
+ //
+ // Subscription route delete
+ //
+ tmpList := RmrEndpointList{}
+ tmpList.AddEndpoint(trans.GetEndpoint())
+ subRouteAction := SubRouteInfo{tmpList, uint16(seqId)}
+ r.rtmgrClient.SubscriptionRequestDelete(subRouteAction)
- //
- // Subscription route updates
- //
- if epamount == 0 {
- tmpList := RmrEndpointList{}
- tmpList.AddEndpoint(trans.GetEndpoint())
- subRouteAction := SubRouteInfo{tmpList, uint16(seqId)}
- r.rtmgrClient.SubscriptionRequestDelete(subRouteAction)
- } else if subs.EpList.Size() > 0 {
- subRouteAction := SubRouteInfo{subs.EpList, uint16(seqId)}
- r.rtmgrClient.SubscriptionRequestUpdate(subRouteAction)
- }
+ //
+ // Subscription release
+ //
+ r.mutex.Lock()
+ defer r.mutex.Unlock()
- r.mutex.Lock()
- //
- // If last endpoint, release and free seqid
- //
- if epamount == 0 {
- if _, ok := r.register[seqId]; ok {
- xapp.Logger.Debug("RELEASE %s", subs.String())
- delete(r.register, seqId)
- xapp.Logger.Debug("Registry: substable=%v", r.register)
+ if _, ok := r.register[seqId]; ok {
+ xapp.Logger.Debug("RELEASE %s", subs.String())
+ delete(r.register, seqId)
+ xapp.Logger.Debug("Registry: substable=%v", r.register)
+ }
+ r.subIds = append(r.subIds, seqId)
+
+ } else if subs.EpList.Size() > 0 {
+ //
+ // Subscription route updates
+ //
+ subRouteAction := SubRouteInfo{subs.EpList, uint16(seqId)}
+ r.rtmgrClient.SubscriptionRequestUpdate(subRouteAction)
}
- r.subIds = append(r.subIds, seqId)
- }
+
+ }()
return nil
}