Git Product home page Git Product logo

garden's Introduction

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

A rich golang client and server for container creation and management with pluggable backends for linux, windows and The Open Container Initiative Spec.

Build Status Coverage Status

Garden is a platform-agnostic Go API for container creation and management, with pluggable backends for different platforms and runtimes. This package contains the canonical client, as well as a server package containing an interface to be implemented by backends.

If you're just getting started, you probably want to begin by setting up one of the backends listed below. If you want to use the Garden client to manage containers, see the Client API section.

Backends

Backends implement support for various specific platforms. So far, the list of backends is as follows:

Client API

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

Example use

Error checking ignored for brevity.

Import these packages:

"github.com/cloudfoundry-incubator/garden"
"github.com/cloudfoundry-incubator/garden/client"
"github.com/cloudfoundry-incubator/garden/client/connection"

Create a client:

gardenClient := client.New(connection.New("tcp", "127.0.0.1:7777"))

Create a container:

container, _ := gardenClient.Create(garden.ContainerSpec{})

Run a process:

buffer := &bytes.Buffer{}
process, _ := container.Run(garden.ProcessSpec{
  User: "alice",
  Path: "echo",
  Args: []string{"hello from the container"},
}, garden.ProcessIO{
  Stdout: buffer,
  Stderr: buffer,
})
exitCode := process.Wait()
fmt.Println(buffer.String())

Development

Prerequisites

  • go
  • git (for garden and its dependencies)
  • mercurial (for some other dependencies not using git)

Running the tests

Assuming go is installed and $GOPATH is set:

mkdir -p $GOPATH/src/github.com/cloudfoundry-incubator
cd $GOPATH/src/github.com/cloudfoundry-incubator
git clone [email protected]:cloudfoundry-incubator/garden
cd garden
go get -t -u ./...
go install github.com/onsi/ginkgo/ginkgo
ginkgo -r

garden's People

Contributors

andyzh avatar d avatar dgoddard avatar emalm avatar frodenas avatar glestaris avatar glyn avatar goonzoid avatar jmnarloch avatar johannespetzold avatar julz avatar marcschunk avatar mariash avatar maxbrunsfeld avatar mheath avatar mhoran avatar mikegehard avatar mokiat avatar onsi avatar pietern avatar slimyang avatar stefanschneider avatar suhlig avatar sykesm avatar thansmann avatar tom025 avatar totherme avatar tushar-dadlani avatar vito avatar xoebus avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.