Code Monkey home page Code Monkey logo

contrail's Introduction

[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, Docker and Docker Compose

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

# move to repo
cd $HOME/go/src/github.com/Juniper/contrail
# make sure put GOBIN to path
export PATH=$PATH:$HOME/go/bin
# or if you defined GOPATH
# cd $GOPATH/src/github.com/Juniper/contrail
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

API documentation

OpenAPI specification file is generated during every run of make generate and it is located in ./public/openapi.json.

You can also run API doc server on local machine using:

make apidoc

The doc will be available on localhost:5000.

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

contrail's People

Contributors

alrighttheresham avatar aosorgin avatar biswajit-mandal avatar cijohnson avatar coderoot avatar dianqiji avatar drapek avatar iosetek avatar katrybacka avatar kbr- avatar madhukar32 avatar mateumann avatar mhines99 avatar mlastawi avatar mlynekt avatar mmithun avatar mprasannajuniper avatar nati avatar pawelzny avatar renkam avatar rrugge avatar sajeeshmat avatar sanju-a avatar shraddhabhise avatar skizhak avatar tilgalas avatar vmahuli avatar vozhyk- avatar wurbanski avatar zhiqiangcui avatar

Watchers

 avatar  avatar

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.