mimik Developer Documentation

Understanding edgeEngine Images and edgeEngine Containers

Purpose

The purpose of this document is to provide a conceptual explanation of the edgeEngine Images and edgeEngine Containers.

Intended Readers

The intended readers of this document are software developers, system engineers, application architects, deployment personnel and other technical professionals who want to understand the details of working with edgeEngine Images and edgeEngine Containers.

What You Will Learn from this Document

After reading this document you will:

  • Understand the form and function of an edgeEngine Image
  • Understand the form and function of an edgeEngine Container
  • Understand how the edgeEngine Runtime uses an edgeEngine Image to create an edgeEngine Container

What You Need to Know Before You Start

In order to get full benefit from reading this document, you need to have an understanding the edgeEngine Runtime and how it supports microservices

Understanding edgeEngine Images

In order for a microservice to deployed onto a node running the edgeEngine Runtime, the code that defines that microservice must first exist as a custom Node.JS project. This Node.JS code is considered the edgeEngine Image.

edgeEngine Image and Container
Figure 1: An edgeEngine Image is the template for an edgeEngine Container

You can think of an edgeEngine as the template that is used to create an edgeContainer.

Typically the way the you'll deploy an edgeEngine Image is to clone down from a source control repository such as GitHub the custom Node.JS project for the edgeEngine image. Then, you'll run a set of npm commands that will generate the .tar file that is the physical representation of the edgeEngine Image. The npm commands you'll execute are special to custom Node.JS projects for edgeEngine microservices. These details of the command and deployment sequence are shown in the tutorial, Creating Your First Microservice.

Once the edgeEngine Image is created, it needs to be deployed onto an edgeEngine node. You'll use the mimik Command Line tool to deploy and register the edgeEngine Image on the edgeEngine node of interest. The command you'll use to deploy the edgeEngine Image is:

mimik-edge-cli image deploy --image=<YOUR_IMAGE_PATH> --token=<EDGE_ACCESS_TOKEN>

Understanding edgeEngine Containers

Once an edgeEngine Image is deployed on a node, you'll deploy the edgeEngine Container using the another mimik Command Line tool command. But, before you deploy the edgeEngine Container you need to create a file named, start.json. The file, start.json has the configuration information that the mimik Command Line tool needs to get the container up and running.

Listing 1 below show an example of a start.json file.

{
"name": "<MICROSERVICE NAME>",
"image": "<TAR FILE NAME>",
"env": {
"MCM.BASE_API_PATH": "<YOUR_API_PATH>",
"MCM.WEBSOCKET_SUPPORT": "true",
"<ENV_VAR_NAME>": "<ENV_VAR_VALUE>"
}
}

Listing 1: An example of a start.json file that has container configuration settings

The particulars of configuring the start.json file are discussed in the tutorial, , Creating Your First Microservice.

Once the file, start.json is configured, you use the mimik Command Line tool to deploy the container, using the following command:

mimik-edge-cli container deploy --payload start.json --token=<EDGE_ACCESS_TOKEN>

The important thing to remember about all of this is that an edgeEngine Image defines the template upon which an edgeEngine Container will be created. Thea physical representation of the edgeEngine Image is a .tar file you will build from a custom edgeEngine Node.JS project. Once the .tar file is created you'll use it to create the edgeEngine container that hosts your custom microservice that will run on an edgeEngine node.