Commit fc6f78ec authored by Kevin Di Lallo's avatar Kevin Di Lallo
Browse files

renamed meep-net-char to meep-net-char-mgr + fixed go module dependency issues

parent 5670fdd8
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -3,10 +3,10 @@ module github.com/InterDigitalInc/AdvantEDGE/go-apps/meep-tc-engine
go 1.12

require (
	github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-bw-sharing v0.0.0
	github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-ctrl-engine-model v0.0.0
	github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-logger v0.0.0
	github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-mg-manager-model v0.0.0
	github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-net-char-mgr v0.0.0
	github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-redis v0.0.0
	github.com/gogo/protobuf v1.2.1 // indirect
	github.com/google/btree v1.0.0 // indirect
@@ -31,9 +31,10 @@ require (
)

replace (
	github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-bw-sharing => ../../go-packages/meep-bw-sharing
	github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-ctrl-engine-model => ../../go-packages/meep-ctrl-engine-model
	github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-logger => ../../go-packages/meep-logger
	github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-mg-manager-model => ../../go-packages/meep-mg-manager-model
	github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-model => ../../go-packages/meep-model
	github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-net-char-mgr => ../../go-packages/meep-net-char-mgr
	github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-redis => ../../go-packages/meep-redis
)
+5 −0
Original line number Diff line number Diff line
@@ -5,8 +5,10 @@ github.com/KromDaniel/rejonson v0.0.0-20180822072824-00b5bcf2b351 h1:1u1XrfCBnY+
github.com/KromDaniel/rejonson v0.0.0-20180822072824-00b5bcf2b351/go.mod h1:HxwfbuElTuGf+/uKZfjJrCnv0BmmpkPJDI7gBwj1KkM=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/flimzy/kivik v1.8.1/go.mod h1:S2aPycbG0eDFll4wgXt9uacSNkXISPufutnc9sv+mdA=
github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I=
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
github.com/go-kivik/couchdb v1.8.1/go.mod h1:5XJRkAMpBlEVA4q0ktIZjUPYBjoBmRoiWvwUBzP3BOQ=
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/gogo/protobuf v1.2.1 h1:/s5zKNz0uPFCZ5hddgPdo2TK2TVrUNMn0OOX8/aZMTE=
@@ -19,10 +21,12 @@ github.com/google/gofuzz v1.0.0 h1:A8PeW59pxE9IoFRqBp37U+mSNaQoZ46F1f0f863XSXw=
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
github.com/googleapis/gnostic v0.2.0 h1:l6N3VoaVzTncYYW+9yOz2LJJammFZGBO13sqgEhpy9g=
github.com/googleapis/gnostic v0.2.0/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY=
github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs=
github.com/gregjones/httpcache v0.0.0-20190212212710-3befbb6ad0cc h1:f8eY6cV/x1x+HLjOp4r72s/31/V2aTUtg5oKRRPf8/Q=
github.com/gregjones/httpcache v0.0.0-20190212212710-3befbb6ad0cc/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA=
github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI=
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
github.com/imdario/mergo v0.3.7/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA=
github.com/json-iterator/go v1.1.6 h1:MrUvLMLTMxbqFJ9kzlvat/rYZqZnW3u4wkLzWTaFwKs=
github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=
github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q=
@@ -40,6 +44,7 @@ github.com/onsi/gomega v1.7.0 h1:XPnZz8VVBHjVsy1vzJmRwIcSwiUO+JFfrv/xGiigmME=
github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
github.com/peterbourgon/diskv v2.0.1+incompatible h1:UBdAOUP5p4RWqPBg048CAvpKN+vxiaj6gdUUzhl4XmI=
github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU=
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/sirupsen/logrus v1.4.1 h1:GL2rEmy6nsikmW0r8opw9JIRScdMF5hA8cOYLH7In1k=
+13 −13
Original line number Diff line number Diff line
@@ -24,10 +24,10 @@ import (
	"sync"
	"time"

	bws "github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-bw-sharing"
	ceModel "github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-ctrl-engine-model"
	log "github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-logger"
	mgModel "github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-mg-manager-model"
	ncm "github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-net-char-mgr"
	redis "github.com/InterDigitalInc/AdvantEDGE/go-packages/meep-redis"

	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@@ -184,7 +184,7 @@ type TcEngine struct {
	scenarioStore *ScenarioStore
	netCharStore  *NetCharStore
	lbRulesStore  *LbRulesStore
	bwSharing     *bws.BwSharing
	netCharMgr    ncm.NetCharMgr

	// Flag & Counters used to indicate when TC Engine is ready to
	tcEngineState     int
@@ -269,18 +269,18 @@ func Init() (err error) {
	}
	log.Info("Connected to LB Rules Store redis DB")

	// Create new Bandwidth Sharing instance
	tce.bwSharing, err = bws.NewBwSharing("default", redisAddr, updateOneFilterRule, applyOneFilterRule)
	// Create new Network Characteristics Manager instance
	tce.netCharMgr, err = ncm.NewNetChar("default", redisAddr)
	if err != nil {
		log.Error("Failed to create a bwSharing object. Error: ", err)
		log.Error("Failed to create a netChar object. Error: ", err)
		return err
	}

	// Configure & Start BW Sharing
	tce.bwSharing.UpdateControls()
	err = tce.bwSharing.Start()
	// Configure & Start Net Char Manager
	tce.netCharMgr.Register(updateOneFilterRule, applyOneFilterRule)
	err = tce.netCharMgr.Start()
	if err != nil {
		log.Error("Failed to start BW Sharing. Error: ", err)
		log.Error("Failed to start Net Char Manager. Error: ", err)
		return err
	}

@@ -1136,7 +1136,7 @@ func applyNetCharRules() {
			filterInfo.LatencyCorrelation = COMMON_CORRELATION
			value = netCharTable[i][j][PACKET_LOSS]
			filterInfo.PacketLoss = value
			//throughput is always updated to make sure a value will be set in the DB is bwSharing is not active at the time of setting the value in the DB
			//throughput is always updated to make sure a value will be set in the DB is netChar is not active at the time of setting the value in the DB
			value = netCharTable[i][j][THROUGHPUT]
			filterInfo.DataRate = value
			needUpdateFilter := false
@@ -1200,11 +1200,11 @@ func applyNetCharRules() {
			if needCreate {
				//follows +2 convention since one odd and even number reserved for the same rule (applied and updated one)
				dstElementPtr.NextUniqueNumber += 2
				_ = updateFilterRule(&filterInfo, !tce.bwSharing.IsRunning())
				_ = updateFilterRule(&filterInfo, !tce.netCharMgr.IsRunning())
			} else if needUpdateFilter {
				_ = updateFilterRule(&filterInfo, !tce.bwSharing.IsRunning())
				_ = updateFilterRule(&filterInfo, !tce.netCharMgr.IsRunning())
			} else if needUpdateNetChar {
				_ = updateNetCharRule(&filterInfo, !tce.bwSharing.IsRunning())
				_ = updateNetCharRule(&filterInfo, !tce.netCharMgr.IsRunning())
			}
			indexToNetElemMap[j] = *dstElementPtr
			curNetCharList[j] = *dstElementPtr
+1 −1
Original line number Diff line number Diff line
@@ -97,7 +97,7 @@ func TestSegAlgoStatic(t *testing.T) {
	// 	printFlows(segment)
	// }

	t.Errorf("DONE")
	// t.Errorf("DONE")

}

Loading