Widemesh Stacks

A Widemesh Stack builds and keeps its Services synchronized to a version of the source code deployed.

Stack names are unique within environments and are part of the DNS names for the services inside them.

Polyglot Applications

An environment could feature one or more stacks, each Stack deploying source-code based on different programming languages, enabling the creation of polyglot cloud apps.

Example:

  • frontend developed with Node.js
  • backend developed with Ruby

Formulas

Stack builds its source code independently from each other using formulas; Widemesh only supports two types of formula: buildpack and dockerfile with buildpack being the default for all new stacks unless otherwise specified.

To create a stack with buildpack formula:

mesh create stack --buildpack

Learn more about Buildpacks.

To create a stack with dockerfile formula:

mesh create stack --dockerfile

Learn more about Dockerfile.

Same with deployments: mesh deploy --buildpack or mesh deploy --dockerfile.

Intra-DNS Resolution

Each Stack composes part of the DNS resolution of each of its service hostnames, the format for service hostnames is as follows:

<stack-name>-<service-name>

Example: If the Stack is named app then to perform network request to its services web or worker you could use the hostname app-web and app-worker like in curl http://app-web and curl http://app-worker.

Configurations

Stacks groups common configurations for all the services, and these configurations get injected in each service instance via Environment Variables.

To list all the configuration variables in a stack you can use:

mesh stack config list 

Say you want to set an environment variable called MESSAGE:

mesh stack config set MESSAGE="Hello World"

You can also set configurations from a file:

mesh stack config set --file MESSAGE=./message.txt

Piping is also available via stdin:

echo "Hello World" | config set --stdin MESSAGE=-

Note: Configuration variable at stack level affect environment variables across all services in the Stack, so each change to configuration variables causes a restart of all services, so the new environment variable is injected.