
Security News
The Changelog Podcast: Practical Steps to Stay Safe on npm
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.
CN-Infra (cloud-native infrastructure) is a Golang platform for building cloud-native microservices. Although it was originally intended for development/implementation of custom management/control plane agents for cloud-native Virtual Network Functions (VNFs), it can be used to develop any microservice.
Each management/control plane app built on top of the CN-Infra platform is basically a set of modules called "plugins" in CN-Infra lingo, where each plugin provides a very specific/focused functionality. Some plugins are provided by the CN-Infra platform itself, some are written by the app's implementors. In other words, the CN-Infra platform itself is implemented as a set of plugins that together provide the platform's functionality, such as logging, health checks, messaging (e.g. Kafka), a common front-end API and back-end connectivity to various KV data stores (Etcd, Cassandra, Redis, ...), and REST and gRPC APIs.
The architecture of the CN-Infra platform is shown in the following figure.

The CN-Infra platform consists of a Core that provides plugin lifecycle management (initialization and graceful shutdown of plugins) and a set of platform plugins. Note that the figure shows not only CN-Infra plugins that are a part of the CN-Infra platform, but also app plugins that use the platform. CN-Infra platform plugins provide APIs that are consumed by app plugins. App plugins themselves may provide their own APIs consumed by external clients.
The platform is modular and extensible. Plugins supporting new functionality (e.g. another KV store or another message bus) can be easily added to the existing set of CN-Infra platform plugins. Moreover, CN-Infra based apps can be built in layers: a set of app plugins together with CN-Infra plugins can form a new platform providing APIs/services to higher layer apps. This approach was used in the VPP Agent - a management/control agent for VPP based software data planes.,
Extending the code base does not mean that all plugins end up in all apps - app writers can pick and choose only those platform plugins that are required by their app; for example, if an app does not need a KV store, the CN-Infra platform KV data store plugins would not be included in the app. All plugins used in an app are statically linked into the app.
A CN-Infra plugin is typically implemented as a library providing the plugin's functionality/APIs wrapped in a plugin wrapper. A CN-Infra library can also be used standalone in 3rd party apps that do not use the CN-Infra platform. The plugin wrapper provides lifecycle management for the plugin component.
Platform plugins in the current CN-Infra release provide functionality in one of the following functional areas:
The following code shows the initialization/start of a simple agent application built on the CN-Infra platform. The code for this example can be found here.
func main() {
flavor := &rpc.FlavorRPC{}
agent := core.NewAgent(flavor)
err := core.EventLoopWithInterrupt(agent, nil)
if err != nil {
os.Exit(1)
}
}
You can run this example code by using pre-build Docker images:
For quick start with the VPP Agent, you can use pre-build Docker images with the Agent and VPP on Dockerhub.
Run ETCD and Kafka on your host (e.g. in Docker using this procedure).
Run cn-infra example simple-agent.
docker pull ligato/dev-cn-infra
docker run -it --name dev-cn-infra --rm ligato/dev-cn-infra
GoDoc can be browsed online.
If you are interested in contributing, please see the contribution guidelines.
FAQs
Unknown package
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.

Security News
Experts push back on new claims about AI-driven ransomware, warning that hype and sponsored research are distorting how the threat is understood.

Security News
Ruby's creator Matz assumes control of RubyGems and Bundler repositories while former maintainers agree to step back and transfer all rights to end the dispute.