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)pivotal.io>