Skip to content

Latest commit

 

History

History
133 lines (89 loc) · 3.01 KB

README.md

File metadata and controls

133 lines (89 loc) · 3.01 KB

Go code base for contrail projects

Important principal

Build pre-requistites

The following software is required to build this project:

  • Install git
  • Install go
  • Install dep
  • Install mysql
  • Install fpm, only required if building packages (described below)

Retrieve the code (using go get)

go get github.com/Juniper/contrail

Generate Code

make generate

Templates are stored in tools/templates Template configuraion You can add your template on template_config.yaml.

Schema Files

Note that schema stored here is just a cache for helping development. Developers should make sure download latest schema from http://github.com/Juniper/contrail-api-client

JSON version stored in public/schema.json

Testing

You need to run a local mysql instance running with test configuraion.

It is expected that the root password is 'contrail123', you can set this on an existing installation from the mysql prompt as follows:

MariaDB [(none)]> ALTER USER 'root'@'localhost' IDENTIFIED BY 'contrail123';

Executing the script below, will drop the contrail_test schema if it exists, recreate it and initialise this schema

./tools/reset_db.sh

At this point the tests can be executed

make test

API Server

You can run API server using this command.

go run cmd/contrail/main.go server -c packaging/apisrv.yml

Keystone Support

API Server supports Keystone V3 authentication and RBAC. API Server has minimal Keystone API V3 support for standalone usecase. see a configuraion example in tools/test_config.yml

Binary

Dep, RPM and Binaries are stored in release page.

See releases

commands

  • contrail command for running intent api server/intent compiler etc
Contrail command

Usage:
  contrail [flags]
  contrail [command]

Available Commands:
  help        Help about any command
  server      Start API Server

Flags:
  -c, --config string   Configuraion File
  -h, --help            help for contrail

Use "contrail [command] --help" for more information about a command.
  • contrailutil utility command for help developments
Contrail Utility Command

Usage:
  contrailutil [flags]
  contrailutil [command]

Available Commands:
  generate    generate code from schema
  help        Help about any command
  package     make a dep and rpm package

Flags:
  -h, --help   help for contrailutil

Packaging

Build the packages

make package