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.
Currently, this project is POC stage so any external/internal API or design subject to change up to community discussion.
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.
# 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
make generate
make install
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
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
Run all tests with coverage:
make test
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.
Setup Gerrit account. Sign CLA.
Install git-review tool.
pip install git-review
Send review to Gerrit:
git review
See: Documentation index