Re: Stemcells, Garden, and rootfs: how are these related?

Amit Kumar Gupta

Hi J K,

To add to what Nick said:

You can think of Garden as a generic API for something that creates
containers and runs processes in them, and can be backed by various
different backend implementations, e.g. garden-linux or garden-windows. It
leaves the responsibility of what it means to actually create a container
to the backend, but provides an interface for interacting with containers
and container processes as logical resources.

At a high level, a container consists of a root file system image, a set of
resource constraints, and some commands to run inside the container. Cloud
Foundry is able to take your raw application source code and build it
inside a container. The root file system used for the container that
builds your code is the "rootfs". So for the build process, the standard
"cflinuxfs2" rootfs is used to create the container, then your code is
injected and compiled, and the resulting asset is extracted. Next, when
Cloud Foundry runs your application, it again creates a container starting
from the rootfs image, injects your built code, and runs it.

The "create a container and run xyz" responsibility belongs to Garden, so
the relationship between garden and the rootfs is that Cloud Foundry finds
a Garden process somewhere and instructs it to use a particular rootfs to
use to create a container out of it.

A single application developer wants to push their code to Cloud Foundry
and have it run the code in some container. But an instance of the Cloud
Foundry platform can support many (e.g. hundreds of thousands) application
developers all doing the same thing. An operator managing an instance of
Cloud Foundry needs to take Cloud Foundry software itself and have it be
deployed and run by something. The toolchain for this is called BOSH.

BOSH typically operates on VMs in a virtualized infrastructure like AWS of
vSphere. BOSH can run Cloud Foundry, or any number of different
distributed software services, on top of virtualized infrastructure.
Analogous to the rootfs which is a common base layer image for all
applications running on Cloud Foundry, a stemcell is a common base VM image
for all services deployed by BOSH (e.g. each of the components comprising
Cloud Foundry itself).

The documentation Nick has linked you to can give you more detailed
information about these concepts, as well as the reasoning behind them.


On Wed, May 18, 2016 at 4:53 PM, Nicholas Calugar <ncalugar(a)>

Hi JK,

I don't work on any of these parts of Cloud Foundry but I can give a very
basic overview:

[1] rootfs: the filesystem used for applications deployed on Cloud
Foundry. The current default is cflinuxfs2, based on Ubuntu 14.04

[2] garden: "A rich golang client and server for container creation and
management with pluggable backends for linux, windows and The Open
Container Initiative Spec". Garden is running on the Diego cells where
Cloud Foundry applications are run.

[3] stemcells: The base image for VMs deployed by bosh.

Highly recommend staring with the Cloud Foundry documentation: You can also "kick the tires" by trying
one of the hosted versions of Cloud Foundry:



On Wed, May 18, 2016 at 1:00 PM, J K <falconwing(a)> wrote:


I'm learning about Cloud Foundry's ideas of how to organize applications
and how it works under the covers. At the moment I'm having a little
trouble understanding the relationship between a few ideas in CF: "rootfs",
"Garden", and "stem cells".

Can someone explain:

(1) their understanding of what these ideas are; and
(2) how they are related?

Thank you!

Join to automatically receive all group messages.