Skip to content

mwringe/kiali

 
 

Repository files navigation

SWS Build Status

Introduction

An SWS application implemented in the Go Programming Language.

Docker Image

SWS is published as a docker image on Docker hub at jmazzitelli/sws

See the LICENSE file.

Building

Note
These build instructions assume you have the following installed on your system: (1) Go Programming Language which must be at least version 1.8, (2) git, (3) Docker, and (4) make. To run SWS on OpenShift after you build it, it is assumed you have a running OpenShift environment available to you. If you do not, you can find a set of instructions on how to set up OpenShift below. To run SWS on Kubernetes after you built it, it is assumed you have a running Kubernetes environment available to you.

To build SWS:

  • Clone this repository inside a GOPATH. These instructions will use the example GOPATH of "/source/go/swift-sunshine/swscore" but you can use whatever you want. Just change the first line of the below instructions to use your GOPATH.

export GOPATH=/source/go/swift-sunshine/sws
mkdir -p $GOPATH
cd $GOPATH
mkdir -p src/github.com/swift-sunshine
cd src/github.com/swift-sunshine
git clone git@github.com:swift-sunshine/swscore
export PATH=${PATH}:${GOPATH}/bin
  • Install dep - the Go dependency management tool that SWS uses to build itself

cd ${GOPATH}/src/github.com/swift-sunshine/swscore
make dep-install
  • Tell dep to install the SWS dependencies

cd ${GOPATH}/src/github.com/swift-sunshine/swscore
make dep-update
  • Build SWS

cd ${GOPATH}/src/github.com/swift-sunshine/swscore
make build
  • At this point you can run the SWS tests

cd ${GOPATH}/src/github.com/swift-sunshine/swscore
make test

Running

Running on OpenShift

Setting up OpenShift

The following section assumes that the user has OpenShift Origin installed.

The OpenShift Origin Documentation will outline all the steps required.

You can alternatively build OpenShift Origin from source and run that. See hack/README.adoc for a quick way to do this using the *-openshift.sh scripts provided by this project.

Building the Docker Image

Create the SWS docker image through the "docker" make target:

cd ${GOPATH}/src/github.com/swift-sunshine/swscore
make docker

Deploying SWS to OpenShift

Note
The following commands assume that the oc command is available in the user’s path and that the user is logged in.

The deploy and undeploy commands are automated in the Makefile. The following will undeploy an old installation of SWS, if available, and deploy a new one:

make openshift-deploy

Undeploying SWS from OpenShift

If you want to remove SWS from your OpenShift environment, you can do so by running the following command:

make openshift-undeploy

Running on Kubernetes

Setting up Kubernetes

The following section assumes that the user has Kubernetes installed.

Building the Docker Image

Create the SWS docker image through the "docker" make target:

cd ${GOPATH}/src/github.com/swift-sunshine/swscore
make docker

Deploying SWS to Kubernetes

Note
The following commands assume that the kubectl command is available in the user’s path and that the user is logged in.

The deploy and undeploy commands are automated in the Makefile. The following will undeploy an old installation of SWS, if available, and deploy a new one:

make k8s-deploy

Undeploying SWS from Kubernetes

If you want to remove SWS from your Kubernetes environment, you can do so by running the following command:

make k8s-undeploy

Running Standalone

Sometimes you may want to run SWS outside of any container environment, perhaps for debugging purposes. To do this, run:

cd ${GOPATH}/src/github.com/swift-sunshine/swscore
make install
make run

The "install" target installs the SWS executable in your GOPATH /bin directory so you can run it outside of the Makefile:

cd ${GOPATH}/src/github.com/swift-sunshine/swscore
make install
${GOPATH}/bin/sws -config <your-config-file>

Environment Variables

Many configuration settings can optionally be set via environment variables. If one of the environment variables below are set, they serve as the default value for its associated YAML configuration setting. The following are currently supported:

Environment Variable Name Description and YAML Setting

FOO_STRING

Description of string here.

foo:
  string: VALUE

FOO_INT

Description of int here.

foo:
  int: VALUE

Additional Notes

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Shell 51.3%
  • Go 38.7%
  • Makefile 10.0%