Git Product home page Git Product logo

Comments (17)

ondrej-fabry avatar ondrej-fabry commented on September 23, 2024

The vpp-agent-ctl app simply puts the model (in your case tap interface) filled with the data to the Etcd. If the vpp-agent is running or started after this it should read the data from the Etcd or be notified about the change and execute relevant commands needed to create interface in VPP.

Here's document showing the data flow: https://github.com/ligato/vpp-agent/blob/master/docs/Deployment.md#key-value-data-store-for-nb-north-bound

from the document:

deployment_with_data_store

In your case you could say that:

  • Control Plane APP is the vpp-agent-ctl
  • Data Store is the Etcd
  • and rest is vpp-agent + VPP

If you don't want to use Etcd and want to run everything in single application, you could use the Embedded deployment.
You can find several examples that use this method, for example: https://github.com/ligato/vpp-agent/blob/master/examples/localclient_vpp/plugins/main.go

from vpp-agent.

zurrehma avatar zurrehma commented on September 23, 2024

@ondrej-fabry while looking at the above example of embedded deployment,after initializing my example plugin and here while putting my initial configuration, this line


is sending me here https://github.com/ligato/vpp-agent/blob/master/clientv1/vpp/data_resync_api.go
and from there i am sending data to this
type Interfaces_Interface struct {

this struct in case of memif Interface.
my question is where and how from data after dumping into these structs are going?

from vpp-agent.

ondrej-fabry avatar ondrej-fabry commented on September 23, 2024

my question is where and how from data after dumping into these structs are going?

To be honest, I'm not really sure what you're asking here.

Just to summarize, when using embedded deployment (localclient) the data is going in the following flow:

  1. Created and filled model using clientv1 DSL
  2. Data is then committed and propagated to watchers of relevant prefixes
  3. VPP linux plugin is notified about new Resync Event
  4. Resync is processed and dispatched to relevant configurators
  5. Configurators then dump current state from VPP
  6. Dumped state from VPP is compared to northbound configuration (defined from localclient)
  7. All residual config (not defined in NB) is removed from VPP
  8. Config defined in NB and missing in VPP is then configured
    Steps 5-8 are done for each configurator individually.
  9. Resync is done when all configurators finish resync

from vpp-agent.

zurrehma avatar zurrehma commented on September 23, 2024

@ondrej-fabry if i am using key value data store (etcd) then what will be change in above steps?
in my opinion there will be changes before step 3.
step 3,4,5,6,7 and 8 will be same.

from vpp-agent.

ondrej-fabry avatar ondrej-fabry commented on September 23, 2024

That's correct.

from vpp-agent.

zurrehma avatar zurrehma commented on September 23, 2024

@ondrej-fabry why we write these test files ?
can i use them to send data to vpp for testing purpose without using north bound api and proto models?

from vpp-agent.

ondrej-fabry avatar ondrej-fabry commented on September 23, 2024

These tests are testing behaviour of vppcalls handlers and they mock VPP replies as you can see in bdTestSetup, they create handler instance using mock channel:

bdHandler := vppcalls.NewBridgeDomainVppHandler(ctx.MockChannel, ifIndex, log)

from vpp-agent.

zurrehma avatar zurrehma commented on September 23, 2024

@ondrej-fabry how to run this test file ?

from vpp-agent.

ondrej-fabry avatar ondrej-fabry commented on September 23, 2024
$ go test -v -run 'Vpp.*BridgeDomain' ./plugins/vpp/l2plugin/vppcalls

from vpp-agent.

zurrehma avatar zurrehma commented on September 23, 2024

@ondrej-fabry as you have told me earlier that vpp-agent-ctl or every example is a plugin because we first register it with cn-infra.
my question is each plugin of vpp which you have defined here, In which files are you registering these plugins ?

from vpp-agent.

ondrej-fabry avatar ondrej-fabry commented on September 23, 2024

The plugins inside vpp folder are registered in plugin_impl_vpp.go file.

if err = plugin.initIF(ctx); err != nil {
return err
}
if err = plugin.initIPSec(ctx); err != nil {
return err
}
if err = plugin.initACL(ctx); err != nil {
return err
}
if err = plugin.initL2(ctx); err != nil {
return err
}
if err = plugin.initL3(ctx); err != nil {
return err
}
if err = plugin.initL4(ctx); err != nil {
return err
}
if err = plugin.initSR(ctx); err != nil {
return err
}

from vpp-agent.

zurrehma avatar zurrehma commented on September 23, 2024

@ondrej-fabry when i run go test via this command
go test -v -run 'Vpp.*BridgeDomain' ./plugins/vpp/l2plugin/vppcalls
why it gives me this error?

root@60d852874a4d:~/go/src/github.com/ligato/vpp-agent# go test -v -run 'Vpp.*BridgeDomain' ./plugins/vpp/l2plugin/vppcalls
plugins/vpp/l2plugin/vppcalls/arp_term_vppcalls.go:22:2: cannot find package "git.fd.io/govpp.git/api" in any of:
	/usr/local/go/src/git.fd.io/govpp.git/api (from $GOROOT)
	/go/src/git.fd.io/govpp.git/api (from $GOPATH)
plugins/vpp/l2plugin/vppcalls/arp_term_vppcalls.go:23:2: cannot find package "github.com/ligato/cn-infra/logging" in any of:
	/usr/local/go/src/github.com/ligato/cn-infra/logging (from $GOROOT)
	/go/src/github.com/ligato/cn-infra/logging (from $GOPATH)
plugins/vpp/l2plugin/vppcalls/arp_term_vppcalls.go:24:2: cannot find package "github.com/ligato/cn-infra/logging/measure" in any of:
	/usr/local/go/src/github.com/ligato/cn-infra/logging/measure (from $GOROOT)
	/go/src/github.com/ligato/cn-infra/logging/measure (from $GOPATH)
plugins/vpp/l2plugin/vppcalls/arp_term_vppcalls.go:25:2: cannot find package "github.com/ligato/cn-infra/utils/addrs" in any of:
	/usr/local/go/src/github.com/ligato/cn-infra/utils/addrs (from $GOROOT)
	/go/src/github.com/ligato/cn-infra/utils/addrs (from $GOPATH)
root@60d852874a4d:~/go/src/github.com/ligato/vpp-agent# 

from vpp-agent.

ondrej-fabry avatar ondrej-fabry commented on September 23, 2024

Did you by any chance alter contents of vendor directory? What go version are you running?

from vpp-agent.

zurrehma avatar zurrehma commented on September 23, 2024

@ondrej-fabry i want to know that where this function is implemented?
I have asked the above question because here in point 1 you have said :
Created and filled model using clientv1 DSL.

The clientv1 DSL has no interface such as this name here.

from vpp-agent.

VladoLavor avatar VladoLavor commented on September 23, 2024

@zurrehma the function is implemented here. Notice that there are two folders in the clientv1 package - vpp, and linux. The vpp package contains only vpp calls, the linux package contains linux and vpp calls (a kind of extension of the vpp clientv1).

from vpp-agent.

zurrehma avatar zurrehma commented on September 23, 2024

@ondrej-fabry , suppose i have written a new plugin, and want to integrate it with clientv1/vpp.
To my understanding following will be done in case of local-client:
1: implementing interface signature here .
2: implementing above interface signature functionality here.
When this will be done and whenever this function will be invoked, after this line invocation this will now be the job of "github.com/ligato/cn-infra/db/keyval" because txn is of keyval.ProtoTxn type.
now my question are:
1: is my perceiving is right?
2: Do we have to write some code in cn-infra/db/keyval part because our txn is of that type?

from vpp-agent.

ondrej-fabry avatar ondrej-fabry commented on September 23, 2024

Closing as this issue is obsolete for Agent v2.

from vpp-agent.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.