Skip to content
This repository has been archived by the owner on Oct 29, 2021. It is now read-only.

Commit

Permalink
Migrate vpp-icmp to vpp v3
Browse files Browse the repository at this point in the history
Signed-off-by: Nikolay Nikolaev <nnikolay@vmware.com>
  • Loading branch information
Nikolay Nikolaev committed Mar 8, 2020
1 parent 72f2059 commit 6967168
Show file tree
Hide file tree
Showing 6 changed files with 91 additions and 7 deletions.
5 changes: 4 additions & 1 deletion examples/vpp-icmp/vppagent-client/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ RUN CGO_ENABLED=0 GOOS=linux go build -ldflags '-extldflags "-static"' -o /go/bi

FROM ${VPP_AGENT} as runtime
COPY --from=build /go/bin/vppagent-client /bin/vppagent-client
RUN rm /opt/vpp-agent/dev/etcd.conf; echo 'Endpoint: "0.0.0.0:9113"' > /opt/vpp-agent/dev/grpc.conf; echo "disabled: true" > /opt/vpp-agent/dev/linux-plugin.conf; echo "disabled: true" > /opt/vpp-agent/dev/telemetry.conf
COPY ./examples/vpp-icmp/vppagent-client/etc/ /etc/
COPY ./examples/vpp-icmp/vppagent-client/etc/supervisord/supervisord.conf /opt/vpp-agent/dev/supervisor.conf
RUN rm /opt/vpp-agent/dev/etcd.conf; \
echo 'Endpoint: "localhost:9113"' > /opt/vpp-agent/dev/grpc.conf ; \
echo "disabled: true" > /opt/vpp-agent/dev/telemetry.conf; \
echo "disabled: true" > /opt/vpp-agent/dev/linux-plugin.conf
10 changes: 5 additions & 5 deletions examples/vpp-icmp/vppagent-client/cmd/vppagent.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ import (
"path"
"time"

"github.com/ligato/vpp-agent/api/configurator"
"github.com/ligato/vpp-agent/api/models/vpp"
vpp_interfaces "github.com/ligato/vpp-agent/api/models/vpp/interfaces"
"github.com/networkservicemesh/networkservicemesh/controlplane/api/connection/mechanisms/memif"
"go.ligato.io/vpp-agent/v3/proto/ligato/configurator"
"go.ligato.io/vpp-agent/v3/proto/ligato/vpp"
vpp_interfaces "go.ligato.io/vpp-agent/v3/proto/ligato/vpp/interfaces"

"github.com/grpc-ecosystem/grpc-opentracing/go/otgrpc"
"github.com/networkservicemesh/networkservicemesh/controlplane/api/connection"
Expand Down Expand Up @@ -59,7 +59,7 @@ func CreateVppInterface(nscConnection *connection.Connection, baseDir, vppAgentE
},
}

client := configurator.NewConfiguratorClient(conn)
client := configurator.NewConfiguratorServiceClient(conn)

logrus.Infof("Sending DataChange to vppagent: %v", dataChange)

Expand Down Expand Up @@ -99,7 +99,7 @@ func Reset(vppAgentEndpoint string) error {

defer func() { _ = conn.Close() }()

client := configurator.NewConfiguratorClient(conn)
client := configurator.NewConfiguratorServiceClient(conn)

logrus.Infof("Resetting vppagent...")

Expand Down
38 changes: 38 additions & 0 deletions examples/vpp-icmp/vppagent-client/etc/govpp/govpp.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Enable or disable feature to measure binary API call duration. Measured time is shown directly in log (info level).
# Measurement is taken also for certain procedures, like resync of plugin startup. Turned off by default.
trace-enabled: false

# Path to a Unix-domain socket through which configuration requests are sent to VPP.
# Used if connect-via-shm is set to false and env. variable GOVPPMUX_NOSOCK is not defined.
# Default is "/run/vpp-api.sock".
binapi-socket-path: /run/vpp-api.sock

# If enabled, govpp will access VPP for configuration requests via the shared memory
# instead of through the socket.
connect-via-shm: false

# Custom shared memory prefix for VPP. Not used by default.
# Relevant only when govpp uses shared memory to send configuration requests to VPP
# (connect-via-shm is enabled or env. variable GOVPPMUX_NOSOCK is defined)
# shm-prefix: <prefix>

# Socket path for reading VPP status, default is "/run/vpp/stats.sock"
stats-socket-path: /run/vpp/stats.sock

# If VPP lost connection, this flag allows to automatically run the whole resync procedure
# for all registered plugins after reconnection.
resync-after-reconnect: false

# Binary API requests failed because of the temporary VPP disconnect can be re-tried. Field defines number of
# retry attempts. Default is zero, meaning the feature is disabled.
retry-request-count: 0

# Defines timeout between binary API retry attempts in case some of them fails. Default value is 500ms.
# If retry-request-count is set to zero, the field has no effect.
retry-request-timeout: 500000000

# Defines max number of attempts GoVPPMux tries to reach the VPP (default is 3 attempts).
retry-connect-count: 30

# Defines time in nanoseconds between VPP connection retries (default is 1 second).
retry-connect-timeout: 1000000000
5 changes: 4 additions & 1 deletion examples/vpp-icmp/vppagent-endpoint/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ RUN CGO_ENABLED=0 GOOS=linux go build -ldflags '-extldflags "-static"' -o /go/bi

FROM ${VPP_AGENT} as runtime
COPY --from=build /go/bin/vppagent-endpoint /bin/vppagent-endpoint
RUN rm /opt/vpp-agent/dev/etcd.conf; echo 'Endpoint: "0.0.0.0:9113"' > /opt/vpp-agent/dev/grpc.conf; echo "disabled: true" > /opt/vpp-agent/dev/linux-plugin.conf; echo "disabled: true" > /opt/vpp-agent/dev/telemetry.conf
COPY ./examples/vpp-icmp/vppagent-endpoint/etc/ /etc/
COPY ./examples/vpp-icmp/vppagent-endpoint/etc/supervisord/supervisord.conf /opt/vpp-agent/dev/supervisor.conf
RUN rm /opt/vpp-agent/dev/etcd.conf; \
echo 'Endpoint: "localhost:9113"' > /opt/vpp-agent/dev/grpc.conf ; \
echo "disabled: true" > /opt/vpp-agent/dev/telemetry.conf; \
echo "disabled: true" > /opt/vpp-agent/dev/linux-plugin.conf
2 changes: 2 additions & 0 deletions examples/vpp-icmp/vppagent-endpoint/cmd/endpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ func main() {
logrus.Panicf("%v", err)
}

logrus.Infof(">>>>>>>>>>> Starting the Endpoint")

if err := nsmEndpoint.Start(); err != nil {
logrus.Panicf("Error starting the endpoint: %v", err)
}
Expand Down
38 changes: 38 additions & 0 deletions examples/vpp-icmp/vppagent-endpoint/etc/govpp/govpp.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Enable or disable feature to measure binary API call duration. Measured time is shown directly in log (info level).
# Measurement is taken also for certain procedures, like resync of plugin startup. Turned off by default.
trace-enabled: false

# Path to a Unix-domain socket through which configuration requests are sent to VPP.
# Used if connect-via-shm is set to false and env. variable GOVPPMUX_NOSOCK is not defined.
# Default is "/run/vpp-api.sock".
binapi-socket-path: /run/vpp-api.sock

# If enabled, govpp will access VPP for configuration requests via the shared memory
# instead of through the socket.
connect-via-shm: false

# Custom shared memory prefix for VPP. Not used by default.
# Relevant only when govpp uses shared memory to send configuration requests to VPP
# (connect-via-shm is enabled or env. variable GOVPPMUX_NOSOCK is defined)
# shm-prefix: <prefix>

# Socket path for reading VPP status, default is "/run/vpp/stats.sock"
stats-socket-path: /run/vpp/stats.sock

# If VPP lost connection, this flag allows to automatically run the whole resync procedure
# for all registered plugins after reconnection.
resync-after-reconnect: false

# Binary API requests failed because of the temporary VPP disconnect can be re-tried. Field defines number of
# retry attempts. Default is zero, meaning the feature is disabled.
retry-request-count: 0

# Defines timeout between binary API retry attempts in case some of them fails. Default value is 500ms.
# If retry-request-count is set to zero, the field has no effect.
retry-request-timeout: 500000000

# Defines max number of attempts GoVPPMux tries to reach the VPP (default is 3 attempts).
retry-connect-count: 30

# Defines time in nanoseconds between VPP connection retries (default is 1 second).
retry-connect-timeout: 1000000000

0 comments on commit 6967168

Please sign in to comment.