Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Go Warden

Remove Bandwidth from ContainerInfo

These calls are too expensive for some backends. We may re-introduce
this property when we support more granular Info calls (or if we find
more performant ways to perform bandwidth analysis).

[#88668196]

Signed-off-by: Julian Friedman <julz.friedman@uk.ibm.com>
latest commit d356eb63bd
Alex Ley avade authored julz committed

README.md

                                                 ,-.
                                                  ) \
                                              .--'   |
                                             /       /
                                             |_______|
                                            (  O   O  )
                                             {'-(_)-'}
                                           .-{   ^   }-.
                                          /   '.___.'   \
                                         /  |    o    |  \
                                         |__|    o    |__|
                                         (((\_________/)))
                                             \___|___/
                                        jgs.--' | | '--.
                                           \__._| |_.__/

Warden in Go, because why not.

Backends

Garden provides a platform-neutral API for containerization. Backends implement support for various specific platforms. So far, the list of backends is as follows:

Garden API

The canonical API for Garden is defined as a collection of Go interfaces. See the godoc documentation for details.

For convenience during Garden development, Garden also supports a REST API which may be used to "kick the tyres". The REST API is not supported.

For example, if Garden Linux is deployed to localhost and configured to listen on port 7777, the following commands may be used to kick its tyres:

# list containers (should be empty)
curl http://127.0.0.1:7777/containers

# create a container
curl -H "Content-Type: application/json" \
  -XPOST http://127.0.0.1:7777/containers \
  -d '{"rootfs":"docker:///busybox"}'

# list containers (should list the handle returned above)
curl http://127.0.0.1:7777/containers

# spawn a process
#
# curl will choke here as the protocol is hijacked, but...it probably worked.
curl -H "Content-Type: application/json" \
  -XPOST http://127.0.0.1:7777/containers/${handle}/processes \
  -d '{"path":"sleep","args":["10"]}'

See REST API examples for more.

Testing

Pre-requisites

  • git (for garden and its dependencies on github)
  • mercurial (for some dependencies not on github)

Make a directory to contain go code:

$ mkdir ~/go

Install Go. For example, install gvm and issue:

$ gvm install go1.4.1
$ gvm use go1.4.1

Make sure that your $GOPATH and $PATH are set. For example:

$ export GOPATH=~/go:$GOPATH
$ export PATH=$PATH:~/go/bin

Get garden and its dependencies:

$ go get -t -u github.com/cloudfoundry-incubator/garden
$ cd ~/go/src/github.com/cloudfoundry-incubator/garden
$ go get -t -u ./...

Install ginkgo (used to test garden):

$ go install github.com/onsi/ginkgo/ginkgo

Run the tests:

$ ginkgo -r
Something went wrong with that request. Please try again.