git clone https://github.com/cloudfoundry/garden-runc-release cd garden-runc-release git submodule update --init --recursive
Note: If you are transitioning from garden-linux-release to garden-runc-release, please read the transition doc here.
The easiest way to run Garden-runC is to deploy it with BOSH Lite, a local development environment for BOSH. Once you have set up bosh-lite (follow the instructions in the bosh-lite repo), just deploy like any bosh release, e.g:
cd garden-runc-release # if you're not already there bosh deployment manifests/bosh-lite.yml bosh create release && bosh upload release && bosh deploy
You can retrieve the address of the Garden-runC server by running
It will be
10.244.16.6 if using the provided bosh-lite manifest in manifests/bosh-lite.yml. The server
port defaults to
The easiest way to start creating containers is to use the
gaol command line client.
gaol -t 10.244.16.6:7777 create -n my-container
For more advanced use cases, you'll need to use the Garden client package for Golang.
In order to help us extend Garden-runC, we recommend opening a Github issue to describe the proposed features or changes. We also welcome pull requests.
You can use other distributions or OS X for development since a good chunk of the unit tests work across alternative platforms, and you can run platform specific tests in a VM using Concourse CI.
In order to contribute to the project you should have the following installed:
- Git - Distributed version control system
- Go 1.6 - The Go programming language
- Direnv - Environment management
- Gosub - Gosub is a submodule based dependency manager for Go
- Fly CLI - Concourse CLI
- Virtualbox - Virtualization box
- Vagrant - Portable dev environment
Garden-runC uses git submodules to maintain its dependencies and components. Garden-runC's components currently are:
- Garden found under
src/code.cloudfoundry.org/gardenis the API server and client.
- Guardian found under
src/code.cloudfoundry.org/guardianis the Garden backend.
- Garden Shed found under
src/code.cloudfoundry.org/garden-sheddownloads and manages root filesystems.
src/code.cloudfoundry.org/garden-integration-testsare the cross-backend integration tests of Garden.
$GOPATH to the checked out directory, or use Direnv to do this, as
Running the tests
Concourse CI is used for running Garden-runC tests in a VM. It provides the Fly CLI for Linux and MacOSX. Concourse has a pre-built Vagrant box for VirtualBox. You can create a new instance by executing the following commands:
mkdir concourse-lite cd concourse-lite vagrant init concourse/lite vagrant up
Note: The concourse-lite VM must have at least 6GB of RAM. If it has less than 6GB, you'll start to see tests failing with 'out of disk' errors. The following can be copied to the Vagrantfile to assign the recommended resources:
config.vm.provider "virtualbox" do |v| v.memory = 6144 v.cpus = 4 end
The tests use the Ginkgo BDD testing framework.
Assuming you have configured a Concourse and installed Ginkgo, you can run all
the tests by executing
If you are using Linux based operation system like Ubuntu, you should install Aufs if you want to run tests on your local machine.
sudo apt-get install linux-image-extra-$(uname -r) sudo modprobe aufs
The unit tests can be executed without Concourse CLI by running
command for any of the components:
# Running Garden unit tests cd src/code.cloudfoundry.org/garden ginkgo -r # Running Guardian unit tests cd src/code.cloudfoundry.org/guardian ginkgo -r
The integration tests can be executed in Concourse CI by using Fly CLI and
# Running Guardian tests ./scripts/remote-fly ci/guardian.yml # Running Garden Shed tests ./scripts/remote-fly ci/nested-shed-tests.yml # Running Garden integration tests in Concourse CI ./scripts/remote-fly ci/gats.yml
Write code in a submodule:
cd src/code.cloudfoundry.org/guardian # for example git checkout master git pull # test, code, test.. git commit git push
Commit the changes, run the tests, and create a bump commit:
# from the garden-runc directory ./scripts/test-and-bump # or just ./scripts/bump if you've already run the tests
Execute command in container using runc
- Create a container with handle <handle>
- Log in to the host OS with root privileges
- Enter guardian mount namespace
/var/vcap/packages/guardian/bin/inspector-garden -pid $(pidof guardian) /bin/bash
- Go to container depot directory
- Execute process in container
/var/vcap/packages/runc/bin/runc exec <handle> <command>
Apache License 2.0