Skip to content

Commit 9f328f7

Browse files
authored
Merge pull request #1358 from ondrej-fabry/release-2.1.1
Release 2.1.1
2 parents 400e6c3 + 94965b5 commit 9f328f7

File tree

15 files changed

+162
-53
lines changed

15 files changed

+162
-53
lines changed

CHANGELOG.md

+22-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
## Release Notes
66

77
- [v2.1.0](#v2.1.0)
8+
- [v2.1.1](#v2.1.1)
89
- [v2.0.0](#v2.0.0)
910
- [v2.0.1](#v2.0.1)
1011
- [v2.0.2](#v2.0.2)
@@ -42,11 +43,31 @@ RELEASE CHANGELOG TEMPLATE:
4243
### Documentation
4344
-->
4445

46+
47+
<a name="v2.1.1"></a>
48+
# [2.1.1](https://github.com/ligato/vpp-agent/compare/v2.1.0...v2.1.1) (2019-04-05)
49+
50+
### Compatibility
51+
- **VPP 19.04** (`stable/1904`, recommended)
52+
- **VPP 19.01** (backward compatible)
53+
54+
### Bug Fixes
55+
* Fixed IPv6 detection for Linux interfaces (#1355).
56+
* Fixed config file names for ifplugin in VPP & Linux (#1341).
57+
* Fixed setting status publishers from env var: `VPP_STATUS_PUBLISHERS`.
58+
59+
### Improvements
60+
* The start/stop timeouts for agent can be configured using env vars: `START_TIMEOUT=15s` and `STOP_TIMEOUT=5s`, with values parsed as duration.
61+
* ABF was added to the `ConfigData` message for VPP (#1356).
62+
63+
### Docker Images
64+
* Images now install all compiled .deb packages from VPP (including `vpp-plugin-dpdk`).
65+
4566
<a name="v2.1.0"></a>
4667
# [2.1.0](https://github.com/ligato/vpp-agent/compare/v2.0.2...v2.1.0) (2019-05-09)
4768

4869
### Compatibility
49-
- **VPP 19.04** (`v19.04-6-g6f05f724f`, recommended)
70+
- **VPP 19.04** (`stable/1904`, recommended)
5071
- **VPP 19.01** (backward compatible)
5172
- cn-infra v2.1
5273
- Go 1.11

api/models/vpp/vpp.pb.go

+52-42
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/models/vpp/vpp.proto

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ package vpp;
44

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

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

2324
repeated acl.ACL acls = 20;
25+
repeated abf.ABF abfs = 21;
2426

2527
repeated l2.BridgeDomain bridge_domains = 30;
2628
repeated l2.FIBEntry fibs = 31;

api/models/vpp/vpp_types.go

+2
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
package vpp
1616

1717
import (
18+
"github.com/ligato/vpp-agent/api/models/vpp/abf"
1819
"github.com/ligato/vpp-agent/api/models/vpp/acl"
1920
"github.com/ligato/vpp-agent/api/models/vpp/interfaces"
2021
"github.com/ligato/vpp-agent/api/models/vpp/ipsec"
@@ -28,6 +29,7 @@ import (
2829
type (
2930
// ACL
3031
ACL = vpp_acl.ACL
32+
ABF = vpp_abf.ABF
3133

3234
// Interfaces
3335
Interface = vpp_interfaces.Interface

cmd/agentctl/utils/db_read_utils.go

+13
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import (
1717
"github.com/gogo/protobuf/proto"
1818

1919
"github.com/ligato/cn-infra/db/keyval"
20+
abf "github.com/ligato/vpp-agent/api/models/vpp/abf"
2021
acl "github.com/ligato/vpp-agent/api/models/vpp/acl"
2122
interfaces "github.com/ligato/vpp-agent/api/models/vpp/interfaces"
2223
ipsec "github.com/ligato/vpp-agent/api/models/vpp/ipsec"
@@ -102,6 +103,8 @@ func (ed EtcdDump) ReadDataFromDb(db keyval.ProtoBroker, key string,
102103
switch {
103104
case strings.HasPrefix(key, acl.ModelACL.KeyPrefix()):
104105
ed[agent], err = readACLConfigFromDb(db, vd, key)
106+
case strings.HasPrefix(key, abf.ModelABF.KeyPrefix()):
107+
ed[agent], err = readABFConfigFromDb(db, vd, key)
105108
case strings.HasPrefix(key, interfaces.ModelInterface.KeyPrefix()):
106109
ed[agent], err = readInterfaceConfigFromDb(db, vd, key)
107110
case strings.HasPrefix(key, l2.ModelBridgeDomain.KeyPrefix()):
@@ -165,6 +168,16 @@ func readACLConfigFromDb(db keyval.ProtoBroker, vd *VppData, key string) (*VppDa
165168
return vd, err
166169
}
167170

171+
func readABFConfigFromDb(db keyval.ProtoBroker, vd *VppData, key string) (*VppData, error) {
172+
abf := &abf.ABF{}
173+
174+
found, _, err := readDataFromDb(db, key, abf)
175+
if found && err == nil {
176+
vd.Config.VppConfig.Abfs = append(vd.Config.VppConfig.Abfs, abf)
177+
}
178+
return vd, err
179+
}
180+
168181
func readInterfaceConfigFromDb(db keyval.ProtoBroker, vd *VppData, key string) (*VppData, error) {
169182
int := &interfaces.Interface{}
170183

cmd/vpp-agent/app/vpp_agent.go

+8-1
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,16 @@ func New() *VPPAgent {
103103

104104
ifplugin.DefaultPlugin.Watcher = watchers
105105
ifplugin.DefaultPlugin.NotifyStates = ifStatePub
106-
ifplugin.DefaultPlugin.PublishStatistics = writers
107106
puntplugin.DefaultPlugin.PublishState = writers
108107

108+
// No stats publishers by default, use `vpp-ifplugin.conf` config
109+
// ifplugin.DefaultPlugin.PublishStatistics = writers
110+
ifplugin.DefaultPlugin.DataSyncs = map[string]datasync.KeyProtoValWriter{
111+
"etcd": etcdDataSync,
112+
"redis": redisDataSync,
113+
"consul": consulDataSync,
114+
}
115+
109116
// connect IfPlugins for Linux & VPP
110117
linux_ifplugin.DefaultPlugin.VppIfPlugin = &ifplugin.DefaultPlugin
111118
ifplugin.DefaultPlugin.LinuxIfPlugin = &linux_ifplugin.DefaultPlugin

cmd/vpp-agent/main.go

+32-4
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,12 @@ package main
1818

1919
import (
2020
"fmt"
21+
"log"
2122
"os"
23+
"time"
2224

2325
"github.com/ligato/cn-infra/agent"
2426
"github.com/ligato/cn-infra/logging"
25-
log "github.com/ligato/cn-infra/logging/logrus"
2627

2728
"github.com/ligato/vpp-agent/cmd/vpp-agent/app"
2829
)
@@ -35,6 +36,14 @@ const logo = ` __
3536
3637
`
3738

39+
var (
40+
startTimeout = agent.DefaultStartTimeout
41+
stopTimeout = agent.DefaultStopTimeout
42+
// FIXME: global flags are not currently compatible with config package (flags are parsed in NewAgent)
43+
//startTimeout = flag.Duration("start-timeout", agent.DefaultStartTimeout, "Timeout duration for starting agent.")
44+
//stopTimeout = flag.Duration("stop-timeout", agent.DefaultStopTimeout, "Timeout duration for stopping agent.")
45+
)
46+
3847
var debugging func() func()
3948

4049
func main() {
@@ -47,14 +56,33 @@ func main() {
4756
vppAgent := app.New()
4857
a := agent.NewAgent(
4958
agent.AllPlugins(vppAgent),
59+
agent.StartTimeout(startTimeout),
60+
agent.StopTimeout(stopTimeout),
5061
)
5162

5263
if err := a.Run(); err != nil {
53-
log.DefaultLogger().Fatal(err)
64+
logging.DefaultLogger.Fatal(err)
5465
}
5566
}
5667

5768
func init() {
58-
log.DefaultLogger().SetOutput(os.Stdout)
59-
log.DefaultLogger().SetLevel(logging.DebugLevel)
69+
logging.DefaultLogger.SetOutput(os.Stdout)
70+
logging.DefaultLogger.SetLevel(logging.DebugLevel)
71+
// Setup start/stop timeouts for agent
72+
if t := os.Getenv("START_TIMEOUT"); t != "" {
73+
dur, err := time.ParseDuration(t)
74+
if err != nil {
75+
log.Fatalf("Invalid duration (%s) for start timeout!", t)
76+
} else {
77+
startTimeout = dur
78+
}
79+
}
80+
if t := os.Getenv("STOP_TIMEOUT"); t != "" {
81+
dur, err := time.ParseDuration(t)
82+
if err != nil {
83+
log.Fatalf("Invalid duration (%s) for stop timeout!", t)
84+
} else {
85+
stopTimeout = dur
86+
}
87+
}
6088
}

docker/dev/Dockerfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,8 @@ RUN \
9494
# copy configs
9595
COPY \
9696
docker/dev/etcd.conf \
97-
docker/dev/vpp-plugin.conf \
98-
docker/dev/linux-plugin.conf \
97+
docker/dev/vpp-ifplugin.conf \
98+
docker/dev/linux-ifplugin.conf \
9999
docker/dev/logs.conf \
100100
./
101101

File renamed without changes.
File renamed without changes.

docker/prod/Dockerfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ COPY --from=devimg \
4848
# copy configs
4949
COPY \
5050
etcd.conf \
51-
vpp-plugin.conf \
52-
linux-plugin.conf \
51+
vpp-ifplugin.conf \
52+
linux-ifplugin.conf \
5353
/opt/vpp-agent/dev/
5454

5555
COPY vpp.conf /etc/vpp/vpp.conf
File renamed without changes.
File renamed without changes.

plugins/configurator/dump.go

+26
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import (
66
"golang.org/x/net/context"
77

88
rpc "github.com/ligato/vpp-agent/api/configurator"
9+
vpp_abf "github.com/ligato/vpp-agent/api/models/vpp/abf"
910
vpp_acl "github.com/ligato/vpp-agent/api/models/vpp/acl"
1011
vpp_interfaces "github.com/ligato/vpp-agent/api/models/vpp/interfaces"
1112
vpp_ipsec "github.com/ligato/vpp-agent/api/models/vpp/ipsec"
@@ -14,6 +15,7 @@ import (
1415
vpp_punt "github.com/ligato/vpp-agent/api/models/vpp/punt"
1516
iflinuxcalls "github.com/ligato/vpp-agent/plugins/linux/ifplugin/linuxcalls"
1617
l3linuxcalls "github.com/ligato/vpp-agent/plugins/linux/l3plugin/linuxcalls"
18+
abfvppcalls "github.com/ligato/vpp-agent/plugins/vpp/abfplugin/vppcalls"
1719
aclvppcalls "github.com/ligato/vpp-agent/plugins/vpp/aclplugin/vppcalls"
1820
ifvppcalls "github.com/ligato/vpp-agent/plugins/vpp/ifplugin/vppcalls"
1921
ipsecvppcalls "github.com/ligato/vpp-agent/plugins/vpp/ipsecplugin/vppcalls"
@@ -28,6 +30,7 @@ type dumpService struct {
2830

2931
// VPP Handlers
3032
aclHandler aclvppcalls.ACLVppRead
33+
abfHandler abfvppcalls.ABFVppRead
3134
ifHandler ifvppcalls.InterfaceVppRead
3235
natHandler natvppcalls.NatVppRead
3336
l2Handler l2vppcalls.L2VppAPI
@@ -58,6 +61,11 @@ func (svc *dumpService) Dump(context.Context, *rpc.DumpRequest) (*rpc.DumpRespon
5861
svc.log.Errorf("DumpAcls failed: %v", err)
5962
return nil, err
6063
}
64+
dump.VppConfig.Abfs, err = svc.DumpAbfs()
65+
if err != nil {
66+
svc.log.Errorf("DumpAbfs failed: %v", err)
67+
return nil, err
68+
}
6169
dump.VppConfig.IpsecSpds, err = svc.DumpIPSecSPDs()
6270
if err != nil {
6371
svc.log.Errorf("DumpIPSecSPDs failed: %v", err)
@@ -130,6 +138,24 @@ func (svc *dumpService) DumpAcls() ([]*vpp_acl.ACL, error) {
130138
return acls, nil
131139
}
132140

141+
// DumpAbfs reads the ACL-based forwarding and returns data read as an *AbfResponse. If the reading ends up with
142+
// an error, only the error is send back in the response
143+
func (svc *dumpService) DumpAbfs() ([]*vpp_abf.ABF, error) {
144+
var abfs []*vpp_abf.ABF
145+
if svc.abfHandler == nil {
146+
return nil, errors.New("abfHandler is not available")
147+
}
148+
abfPolicy, err := svc.abfHandler.DumpABFPolicy()
149+
if err != nil {
150+
return nil, err
151+
}
152+
for _, abfDetails := range abfPolicy {
153+
abfs = append(abfs, abfDetails.ABF)
154+
}
155+
156+
return abfs, nil
157+
}
158+
133159
// DumpInterfaces reads interfaces and returns them as an *InterfaceResponse. If reading ends up with error,
134160
// only error is send back in response
135161
func (svc *dumpService) DumpInterfaces() ([]*vpp_interfaces.Interface, error) {

0 commit comments

Comments
 (0)