Internal API to access the database for Diego.
Switch branches/tags
Nothing to show
Clone or download
jvshahid Change the case of enum values to be ALL_CAPS
Ruby doesn't like the lower case enums and the protobuf style guideline show
that this is the preferred style.

[#161194270]

closes #34
Latest commit 6f0fad8 Oct 19, 2018
Permalink
Failed to load latest commit information.
cmd/bbs Remove an unused function Oct 18, 2018
controllers Simplify the event ordering logic by using an event score Oct 12, 2018
converger Update handlers/controllers for suspect lrp support Jul 20, 2018
db emit db metrics every 60 seconds Oct 17, 2018
doc Introduce new DesiredLRPs/Tasks retrieval endpoints Oct 15, 2018
encryption Remove default config from BBS Sep 12, 2018
encryptor Update SendDuration signature to include EmitGaugeOption. Dec 12, 2017
events emit instance events Sep 25, 2018
fake_bbs emit instance events Sep 25, 2018
format Add a way to specify all asset downloads declaratively for LRPs & tasks Aug 23, 2018
guidprovider treat expired actual lrps the same as regular lrps for convergence Aug 11, 2017
handlers Create a deep copy when down converting DesiredLRP from v2 to v0 Oct 17, 2018
metrics Generate canonical import path package.go file for metricfakes Oct 17, 2018
migration Fix misleading test in migration manager May 29, 2018
models Change the case of enum values to be ALL_CAPS Oct 19, 2018
scripts Fix error in make_migration.sh Apr 2, 2018
serviceclient correctly return locket error if BBS is not looking at consul presences Aug 29, 2017
taskworkpool treat expired actual lrps the same as regular lrps for convergence Aug 11, 2017
test_helpers Use deep equal matcher in desired LRP tests Aug 23, 2018
.gitignore Make logger the first argument. Jul 17, 2015
LICENSE Update LICENSE and NOTICE Feb 23, 2017
NOTICE Update LICENSE and NOTICE Feb 23, 2017
README.md Remove unused errors from API / protobuf defs Mar 2, 2018
bbs_suite_test.go BBS Client only returns Error_Timeout if the request timed out Jan 29, 2018
client.go Update the client to use the new endpoints Oct 15, 2018
client_test.go Improve BBS client_test.go Jun 11, 2018
package.go Enforce canonical import path Feb 6, 2017
routes.go Add more deprecation comments to make it easier to find them in the f… Oct 15, 2018

README.md

BBS Server GoDoc

Note: This repository should be imported as code.cloudfoundry.org/bbs.

API to access the database for Diego.

A general overview of the BBS is documented here.

API

To interact with the BBS from outside of Diego, use the methods provided on the Client interface.

Components within Diego may use the full InternalClient interface to modify internal state.

Code Generation

The protobuf models in this repository require version 3.5 or later of the protoc compiler.

OSX

On Mac OS X with Homebrew, run the following to install it:

brew install protobuf

Linux

  1. Download a zip archive of the latest protobuf release from here.
  2. Unzip the archive in /usr/local.
  3. chmod a+x /usr/local/bin/protoc to make sure you can use the binary.

If you already have an older version of protobuf installed, you must uninstall it first by running brew uninstall protobuf

Install the gogoproto compiler by running:

go install github.com/gogo/protobuf/protoc-gen-gogoslick

Run go generate ./... from the root directory of this repository to generate code from the .proto files as well as to generate fake implementations of certain interfaces for use in test code.

Generating ruby models for BBS models

The following documentation assume the following versions:

  1. protoc > v3.0.0
  2. ruby protobuf gem > 3.6.12

Run the following commands from the models directory to generate .pb.rb files for the BBS models:

  1. gem install protobuf
  2. cp $(which protoc-gen-ruby){,2}
  3. protoc -I$GOPATH/src --proto_path=. --ruby2_out=/path/to/ruby/files *.proto

Note Replace /path/to/ruby/files with the desired destination of the .pb.rb files. That directory must exist before running this command.

Note The above steps assume that github.com/gogo/protobuf/gogoproto/gogo.proto is on the GOPATH.

Note Since protoc v3 now ships with a ruby generator, the built-in generator will mask the gem's binary. This requires a small hack in order to be able to use the protobuf gem, the hack is simply to rename the protobuf gem's binary to be ruby2 and ask protoc to generate ruby2 code which will force it to use the binary. For more information please read this github issue

SQL

See the instructions in Running the Experimental SQL Unit Tests for testing against a SQL backend

See Migrations for information about writing database migrations.