Developer Guide

Building SuperGloo from source


Install them all with the following:

mkdir -p ${GOPATH}/src/

# Dep
go get -u

# protoc
unameOut="$(uname -s)"
case "${unameOut}" in

curl -OL${ARCHIVE} && \
    unzip ${ARCHIVE} -d protoc3 && \
    sudo mv protoc3/bin/* /usr/local/bin/ && \
    sudo mv protoc3/include/* /usr/local/include/

# Solo-Kit protoc plugin
mkdir -p ${GOPATH}/src/ && \
    cd ${GOPATH}/src/ && \
    git clone && \
    cd solo-kit && \
        dep ensure -v && \
    make install-plugin

# make sure $GOPATH/bin is part of your path
export PATH=${PATH}:${GOPATH}/bin/

mkdir -p ${GOPATH}/src/ && \
    cd ${GOPATH}/src/ && \
    git clone && \
    cd supergloo && make init # set up pre-commit githook to enforce Go formatting and imports


cd ${GOPATH}/src/ && \
make supergloo

This will create a supergloo binary for you in the top level directory.



Cluster setup:

# start cluster
minikube start --memory=8192 --cpus=4 --kubernetes-version=v1.10.0
# deploy helm/tiller
helm init

Run tests:

ginkgo -r [Directory]

Updating API

The API is auto-generated from the protos in the api directory. After making changes, run make generated-code -B to re-generate.

Adding Features

Extending SuperGloo can be done by adding additional Syncers to an Event Loop. SuperGloo is built with code generated by Solo-Kit which provides a skeleton for writing event-based systems.

Take a look at pkg/setup/setup.go to see how syncers are registered to the main event loop in SuperGloo.

In order to add a syncer, it needs to implement the interface

type TranslatorSyncer interface {
    Sync(context.Context, *TranslatorSnapshot) error

The Sync function is responsible for performing some action in response to a change in either user configuration, or some piece of discovered information. The whole input state for the Sync function is contained in the TranslatorSnapshot, defined in pkg/api/v1/

To extend the functionality of SuperGloo, simply initialize your Syncer and add it to the array of syncers in setup.go