contrail

package module
v0.0.0-...-cbc3a0c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 20, 2018 License: Apache-2.0 Imports: 0 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

[POC] Go code base for Contrail projects

This repository holds Go implementation for Contrail projects. The goal of this project is to realize Go-based implementation & etcd based such as Kubernetes in order to improve performance, scale and ease operation.

We are planning to add following sub components.

  • API Server (Python-based VNC API Server equivalent)
  • Sync (IF-MAP, RabbitMQ related code equivalent but depends on etcd)
  • Agent (SchemaTransformer, Device Manager equivalent)
  • Code generation tool (generateDS equivalent)

Currently, this project is POC stage so any external/internal API or design subject to change up to community discussion.

Development setup

Step1. Install Go and Docker
Step2. Go get Contrail
go get -u github.com/Juniper/contrail

Note that go get -u github.com/Juniper/contrail/cmd/contrailutil fails because we don't commit generated code.

Step3. Install dependencies
make deps
Step4. Generate source code
make generate
Step5. Install Contrail binaries
make install
Step6. Setup test environment
make testenv reset_db

Note that these commands use docker command and depending on your Docker configuration they may require root permissions. See: Docker Documentation

First run

  • Run Contrail process

    contrail -c sample/contrail.yml run
    

    Note that you can overwrite configuration parameters using environment variable with prefix "CONTRAIL_"

    For example CONTRAIL_DATABASE_DEBUG is overwriting database.debug value.

    CONTRAIL_DATABASE_DEBUG=true contrail -c sample/contrail.yml run
    

    Individual processes can be enabled or disabled using the configuration parameters.

  • Run CLI commands

    export CONTRAIL_CONFIG=sample/cli.yml
    
    # Show schema
    contrailcli schema virtual_network
    
    # Sync resources
    contrailcli sync sample/sample_resource.yml
    
    # List resources
    contrailcli list virtual_network --detail
    
    # Delete resources
    contrailcli delete sample/sample_resource.yml
    

    See: CLI Usage

Testing

Run all tests with coverage:

make test

How to contribute

Step1

Setup Gerrit account. Sign CLA.

Step2

Install git-review tool.

pip install git-review
Step3

Send review to Gerrit:

git review

Documentation

See: Documentation index

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
cmd
contrail command
contrailcli command
contrailschema command
contrailutil command
pkg
db
log
Package log facilitates creating of configured Logrus logger.
Package log facilitates creating of configured Logrus logger.
sync
Package sync contains functionality that supplies etcd with data from PostgreSQL or MySQL database.
Package sync contains functionality that supplies etcd with data from PostgreSQL or MySQL database.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL