Skip to content

Commit

Permalink
Merge pull request #1358 from ondrej-fabry/release-2.1.1
Browse files Browse the repository at this point in the history
Release 2.1.1
  • Loading branch information
VladoLavor authored May 27, 2019
2 parents 400e6c3 + 94965b5 commit 9f328f7
Show file tree
Hide file tree
Showing 15 changed files with 162 additions and 53 deletions.
23 changes: 22 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
## Release Notes

- [v2.1.0](#v2.1.0)
- [v2.1.1](#v2.1.1)
- [v2.0.0](#v2.0.0)
- [v2.0.1](#v2.0.1)
- [v2.0.2](#v2.0.2)
Expand Down Expand Up @@ -42,11 +43,31 @@ RELEASE CHANGELOG TEMPLATE:
### Documentation
-->


<a name="v2.1.1"></a>
# [2.1.1](https://github.com/ligato/vpp-agent/compare/v2.1.0...v2.1.1) (2019-04-05)

### Compatibility
- **VPP 19.04** (`stable/1904`, recommended)
- **VPP 19.01** (backward compatible)

### Bug Fixes
* Fixed IPv6 detection for Linux interfaces (#1355).
* Fixed config file names for ifplugin in VPP & Linux (#1341).
* Fixed setting status publishers from env var: `VPP_STATUS_PUBLISHERS`.

### Improvements
* The start/stop timeouts for agent can be configured using env vars: `START_TIMEOUT=15s` and `STOP_TIMEOUT=5s`, with values parsed as duration.
* ABF was added to the `ConfigData` message for VPP (#1356).

### Docker Images
* Images now install all compiled .deb packages from VPP (including `vpp-plugin-dpdk`).

<a name="v2.1.0"></a>
# [2.1.0](https://github.com/ligato/vpp-agent/compare/v2.0.2...v2.1.0) (2019-05-09)

### Compatibility
- **VPP 19.04** (`v19.04-6-g6f05f724f`, recommended)
- **VPP 19.04** (`stable/1904`, recommended)
- **VPP 19.01** (backward compatible)
- cn-infra v2.1
- Go 1.11
Expand Down
94 changes: 52 additions & 42 deletions api/models/vpp/vpp.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions api/models/vpp/vpp.proto
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ package vpp;

option go_package = "github.com/ligato/vpp-agent/api/models/vpp;vpp";

import "models/vpp/abf/abf.proto";
import "models/vpp/acl/acl.proto";
import "models/vpp/interfaces/interface.proto";
import "models/vpp/interfaces/state.proto";
Expand All @@ -21,6 +22,7 @@ message ConfigData {
repeated interfaces.Interface interfaces = 10;

repeated acl.ACL acls = 20;
repeated abf.ABF abfs = 21;

repeated l2.BridgeDomain bridge_domains = 30;
repeated l2.FIBEntry fibs = 31;
Expand Down
2 changes: 2 additions & 0 deletions api/models/vpp/vpp_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
package vpp

import (
"github.com/ligato/vpp-agent/api/models/vpp/abf"
"github.com/ligato/vpp-agent/api/models/vpp/acl"
"github.com/ligato/vpp-agent/api/models/vpp/interfaces"
"github.com/ligato/vpp-agent/api/models/vpp/ipsec"
Expand All @@ -28,6 +29,7 @@ import (
type (
// ACL
ACL = vpp_acl.ACL
ABF = vpp_abf.ABF

// Interfaces
Interface = vpp_interfaces.Interface
Expand Down
13 changes: 13 additions & 0 deletions cmd/agentctl/utils/db_read_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import (
"github.com/gogo/protobuf/proto"

"github.com/ligato/cn-infra/db/keyval"
abf "github.com/ligato/vpp-agent/api/models/vpp/abf"
acl "github.com/ligato/vpp-agent/api/models/vpp/acl"
interfaces "github.com/ligato/vpp-agent/api/models/vpp/interfaces"
ipsec "github.com/ligato/vpp-agent/api/models/vpp/ipsec"
Expand Down Expand Up @@ -102,6 +103,8 @@ func (ed EtcdDump) ReadDataFromDb(db keyval.ProtoBroker, key string,
switch {
case strings.HasPrefix(key, acl.ModelACL.KeyPrefix()):
ed[agent], err = readACLConfigFromDb(db, vd, key)
case strings.HasPrefix(key, abf.ModelABF.KeyPrefix()):
ed[agent], err = readABFConfigFromDb(db, vd, key)
case strings.HasPrefix(key, interfaces.ModelInterface.KeyPrefix()):
ed[agent], err = readInterfaceConfigFromDb(db, vd, key)
case strings.HasPrefix(key, l2.ModelBridgeDomain.KeyPrefix()):
Expand Down Expand Up @@ -165,6 +168,16 @@ func readACLConfigFromDb(db keyval.ProtoBroker, vd *VppData, key string) (*VppDa
return vd, err
}

func readABFConfigFromDb(db keyval.ProtoBroker, vd *VppData, key string) (*VppData, error) {
abf := &abf.ABF{}

found, _, err := readDataFromDb(db, key, abf)
if found && err == nil {
vd.Config.VppConfig.Abfs = append(vd.Config.VppConfig.Abfs, abf)
}
return vd, err
}

func readInterfaceConfigFromDb(db keyval.ProtoBroker, vd *VppData, key string) (*VppData, error) {
int := &interfaces.Interface{}

Expand Down
9 changes: 8 additions & 1 deletion cmd/vpp-agent/app/vpp_agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,16 @@ func New() *VPPAgent {

ifplugin.DefaultPlugin.Watcher = watchers
ifplugin.DefaultPlugin.NotifyStates = ifStatePub
ifplugin.DefaultPlugin.PublishStatistics = writers
puntplugin.DefaultPlugin.PublishState = writers

// No stats publishers by default, use `vpp-ifplugin.conf` config
// ifplugin.DefaultPlugin.PublishStatistics = writers
ifplugin.DefaultPlugin.DataSyncs = map[string]datasync.KeyProtoValWriter{
"etcd": etcdDataSync,
"redis": redisDataSync,
"consul": consulDataSync,
}

// connect IfPlugins for Linux & VPP
linux_ifplugin.DefaultPlugin.VppIfPlugin = &ifplugin.DefaultPlugin
ifplugin.DefaultPlugin.LinuxIfPlugin = &linux_ifplugin.DefaultPlugin
Expand Down
36 changes: 32 additions & 4 deletions cmd/vpp-agent/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,12 @@ package main

import (
"fmt"
"log"
"os"
"time"

"github.com/ligato/cn-infra/agent"
"github.com/ligato/cn-infra/logging"
log "github.com/ligato/cn-infra/logging/logrus"

"github.com/ligato/vpp-agent/cmd/vpp-agent/app"
)
Expand All @@ -35,6 +36,14 @@ const logo = ` __
`

var (
startTimeout = agent.DefaultStartTimeout
stopTimeout = agent.DefaultStopTimeout
// FIXME: global flags are not currently compatible with config package (flags are parsed in NewAgent)
//startTimeout = flag.Duration("start-timeout", agent.DefaultStartTimeout, "Timeout duration for starting agent.")
//stopTimeout = flag.Duration("stop-timeout", agent.DefaultStopTimeout, "Timeout duration for stopping agent.")
)

var debugging func() func()

func main() {
Expand All @@ -47,14 +56,33 @@ func main() {
vppAgent := app.New()
a := agent.NewAgent(
agent.AllPlugins(vppAgent),
agent.StartTimeout(startTimeout),
agent.StopTimeout(stopTimeout),
)

if err := a.Run(); err != nil {
log.DefaultLogger().Fatal(err)
logging.DefaultLogger.Fatal(err)
}
}

func init() {
log.DefaultLogger().SetOutput(os.Stdout)
log.DefaultLogger().SetLevel(logging.DebugLevel)
logging.DefaultLogger.SetOutput(os.Stdout)
logging.DefaultLogger.SetLevel(logging.DebugLevel)
// Setup start/stop timeouts for agent
if t := os.Getenv("START_TIMEOUT"); t != "" {
dur, err := time.ParseDuration(t)
if err != nil {
log.Fatalf("Invalid duration (%s) for start timeout!", t)
} else {
startTimeout = dur
}
}
if t := os.Getenv("STOP_TIMEOUT"); t != "" {
dur, err := time.ParseDuration(t)
if err != nil {
log.Fatalf("Invalid duration (%s) for stop timeout!", t)
} else {
stopTimeout = dur
}
}
}
4 changes: 2 additions & 2 deletions docker/dev/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ RUN \
# copy configs
COPY \
docker/dev/etcd.conf \
docker/dev/vpp-plugin.conf \
docker/dev/linux-plugin.conf \
docker/dev/vpp-ifplugin.conf \
docker/dev/linux-ifplugin.conf \
docker/dev/logs.conf \
./

Expand Down
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions docker/prod/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ COPY --from=devimg \
# copy configs
COPY \
etcd.conf \
vpp-plugin.conf \
linux-plugin.conf \
vpp-ifplugin.conf \
linux-ifplugin.conf \
/opt/vpp-agent/dev/

COPY vpp.conf /etc/vpp/vpp.conf
Expand Down
File renamed without changes.
File renamed without changes.
26 changes: 26 additions & 0 deletions plugins/configurator/dump.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"golang.org/x/net/context"

rpc "github.com/ligato/vpp-agent/api/configurator"
vpp_abf "github.com/ligato/vpp-agent/api/models/vpp/abf"
vpp_acl "github.com/ligato/vpp-agent/api/models/vpp/acl"
vpp_interfaces "github.com/ligato/vpp-agent/api/models/vpp/interfaces"
vpp_ipsec "github.com/ligato/vpp-agent/api/models/vpp/ipsec"
Expand All @@ -14,6 +15,7 @@ import (
vpp_punt "github.com/ligato/vpp-agent/api/models/vpp/punt"
iflinuxcalls "github.com/ligato/vpp-agent/plugins/linux/ifplugin/linuxcalls"
l3linuxcalls "github.com/ligato/vpp-agent/plugins/linux/l3plugin/linuxcalls"
abfvppcalls "github.com/ligato/vpp-agent/plugins/vpp/abfplugin/vppcalls"
aclvppcalls "github.com/ligato/vpp-agent/plugins/vpp/aclplugin/vppcalls"
ifvppcalls "github.com/ligato/vpp-agent/plugins/vpp/ifplugin/vppcalls"
ipsecvppcalls "github.com/ligato/vpp-agent/plugins/vpp/ipsecplugin/vppcalls"
Expand All @@ -28,6 +30,7 @@ type dumpService struct {

// VPP Handlers
aclHandler aclvppcalls.ACLVppRead
abfHandler abfvppcalls.ABFVppRead
ifHandler ifvppcalls.InterfaceVppRead
natHandler natvppcalls.NatVppRead
l2Handler l2vppcalls.L2VppAPI
Expand Down Expand Up @@ -58,6 +61,11 @@ func (svc *dumpService) Dump(context.Context, *rpc.DumpRequest) (*rpc.DumpRespon
svc.log.Errorf("DumpAcls failed: %v", err)
return nil, err
}
dump.VppConfig.Abfs, err = svc.DumpAbfs()
if err != nil {
svc.log.Errorf("DumpAbfs failed: %v", err)
return nil, err
}
dump.VppConfig.IpsecSpds, err = svc.DumpIPSecSPDs()
if err != nil {
svc.log.Errorf("DumpIPSecSPDs failed: %v", err)
Expand Down Expand Up @@ -130,6 +138,24 @@ func (svc *dumpService) DumpAcls() ([]*vpp_acl.ACL, error) {
return acls, nil
}

// DumpAbfs reads the ACL-based forwarding and returns data read as an *AbfResponse. If the reading ends up with
// an error, only the error is send back in the response
func (svc *dumpService) DumpAbfs() ([]*vpp_abf.ABF, error) {
var abfs []*vpp_abf.ABF
if svc.abfHandler == nil {
return nil, errors.New("abfHandler is not available")
}
abfPolicy, err := svc.abfHandler.DumpABFPolicy()
if err != nil {
return nil, err
}
for _, abfDetails := range abfPolicy {
abfs = append(abfs, abfDetails.ABF)
}

return abfs, nil
}

// DumpInterfaces reads interfaces and returns them as an *InterfaceResponse. If reading ends up with error,
// only error is send back in response
func (svc *dumpService) DumpInterfaces() ([]*vpp_interfaces.Interface, error) {
Expand Down
Loading

0 comments on commit 9f328f7

Please sign in to comment.