mimik Developer Documentation

Installing edgeEngine and the mimik-edge-cli Tool on a Linux System or MacOS

Objective

The objective of this tutorial is to demonstrate how to install the edgeEngine Runtime and the mimik-edge-cli tool on a computer running the Linux operating system, a Raspberry Pi computer running the Raspian operating system, or on a computer running macOS. The edgeEngine Runtime is the essential component that allows a computer to join an edgeEngine cluster and run an edge microservice.

The mimik-edge-cli tool is an application that you use at the command line to do work with edgeEngine Runtime.

Intended Readers

The intended readers of this document are software developers and system administrators that will be working with microservices running under edgeEngine within a cluster of edge-enabled devices.

In order to get the full benefit of this tutorial, the intended readers should be familiar with the following:

  • a basic understanding of the fundamentals of the edgeEngine Runtime. (You can read the key concepts behind the edgeEngine Runtime here).
  • Working at the command line in a terminal window.
  • using the wget command
  • the basics of working with Node.js®
  • installing Node.js® packages using npm
  • working with git source control management

What You'll Be Doing

In this tutorial, you be shown how to install the edgeEngine Runtime on a computer running Linux. Also, you'll be shown how to install the edgeEngine Runtime on a Raspberry Pi computer running the Raspbian operating system and on a computer running macOS.

Once the edgeEngine Runtime is installed, you'll install the mimik-edge-cli tool and use it to execute a simple command against the edgeEngine Runtime.

Technical Prerequisites

This tutorial has the following prerequisites.

  • If you're planning to install the edgeEngine Runtime on Linux, you'll need access to a Linux computer that running Ubuntu 18.04 or Ubuntu 20.04.2. Also, that computer needs to have wget, Node.js®, npm and git installed.
  • If you're planning to install the edgeEngine Runtime on Raspberry Pi, you'll need access to a Linux Raspberry Pi computer running the Raspian operating system. That computer needs to have wget, Node.js®, npm and git installed.
  • If you're planning to install the edgeEngine Runtime on a computer running macOS, that computer needs to have wget, Node.js®, npm and git installed. (You can read instructions on how to install wget on a computer running macOS here.)

Installing the edgeEngine Runtime on Linux

In this set of instructions, you're going to install the edgeEngine Runtime on a Linux computer.

Step 1: Download the latest version of edgeEngine Runtime for Linux onto the machine in which you plan to install the edgeEngine Runtime. The release versions of the edgeEngine Runtime are listed here.

In this case we'll download the .tar file for edgeEngine Version: 2.3.1 for Linux/Ubuntu like so:

wget https://github.com/edgeEngine/edgeengine-linux/releases/download/v2.3.1/edgeEngine-ubuntu-setup-v2.3.1.tar

Step 2: Extract the contents of the .tar file in the target directory by executing the following command:

tar xvf edgeEngine-ubuntu-setup-v2.3.1.tar

In the example above, we're extracting the file edgeEngine-ubuntu-setup-v2.3.1.tar which will put the contents of the tar file into the directory edgeEngine-ubuntu-setup-v2.3.1

Step 3: Navigate the directory into which the contents of the .tar file was extracted. In this case:

cd edgeEngine-ubuntu-setup-v2.3.1

Step 4: Start the edgeEngine Runtime by executing the script in the file, ./start.sh using the following command:

sh ./start.sh

Be advised: The script, ./start.sh will ask you to provide the machine's administrator password in order to execute the tasks therein.

Executing the shell script will start the edgeEngine Runtime as a process which will send log information to the terminal window on an ongoing basis, similar to the following.

Executing the shell script will start the edgeEngine Runtime as a process which will send log information to the terminal window on an ongoing basis, similar to the following.

[2021-08-31 14:06:42.934] [linux] [info] nodeName: linuxlab
[2021-08-31 14:06:42.934] [System] [info] edge SDK starts ...
Database does not exists .//.edge/.cache/.cert-db, will now create
Opened database successfully
Table created successfully
[2021-08-31 14:06:43.395] [System] [info] [initial_supernode_discovery]: starts
[2021-08-31 14:06:45.425] [System] [info] [initial_supernode_discovery]: supernode found:
d3e44f2121fc4b371f05503dc478c31356d18b7849c5ed406df95e38
192.168.86.36
[2021-08-31 14:06:45.425] [System] [info] serve as supernode
[2021-08-31 14:06:45.426] [System] [info] [request__mts_token] starts
[2021-08-31 14:06:45.651] [System] [info] [api_client_request] correlationId=b2595c44-c8dc-f19d-6fe6-5739b5ccb428@0, method=POST, host=mst.mimik360.com, uri=/mST/v1/oauth/token
[2021-08-31 14:06:45.703] [System] [info] [api_client_response] correlationId=b2595c44-c8dc-f19d-6fe6-5739b5ccb428@0, method=POST, host=mst.mimik360.com, uri=/mST/v1/oauth/token, statusCode=201
[2021-08-31 14:06:45.704] [System] [info] [request__mts_token] ends
[2021-08-31 14:06:45.859] [System] [info] [api_client_request] correlationId=452548f6-bcc4-f664-b141-1c9efee2db34@0, method=POST, host=mds.mimik360.com, uri=/mDS/v1/nodes

The edgeEngine Runtime is now running.

Installing the edgeEngine Runtime on Raspberry Pi and the Raspian operating system

The steps for installing the edgeEngine Runtime on a Raspberry Pi computer running the Raspian operating system are similar to the steps you took when installing the edgeEngine Runtime under Linux as described above here. Only, in the case of installing under Raspian you will use the latest version of the .tar file specific to Raspian.

You'll find the latest release of the edgeEngine Runtime .tar file for Raspian on GitHub here.

Installing the edgeEngine Runtime on macOS

The steps for installing the edgeEngine Runtime on the macOS operating system are similar to the steps you took when installing the edgeEngine Runtime under Linux as described above here. Only, in the case of installing under macOS, you will use the latest version of the .tar file specific to macOS.

You'll find the latest release of the edgeEngine Runtime .tar file for macOS on GitHub here.

Installing the mimik-edge-cli tool

Step 1: Execute the following command in a terminal window of the computer in which you want to install the mimik-edge-cli tool.

npm install -g @mimik/mimik-edge-cli

You will get output in the terminal window similar to the following:

1: /usr/sbin/node-v14.17.5-linux-x64/bin/mimik-edge-cli -> /usr/sbin/node-v14.17.5-linux-x64/lib/node_modules/@mimik/mimik-edge-cli/bin/run
2: + @mimik/mimik-edge-cli@1.1.0
3: added 173 packages from 89 contributors in 10.339s

Step 2: Execute the following command to get the current version of mimik-edge-cli. Executing this command will verify that the program has been installed.

mimik-edge-cli -v

You will get output in the terminal window similar to the following:

@mimik/mimik-edge-cli/1.1.0 linux-x64 node-v14.17.5

Step 3: Execute the following command to test that the edgeEngine Runtime is accessible to mimik-edge-cli:

mimik-edge-cli account get-me

If all is well, you'll get output in the terminal window similar to the following:

accountId:
linkLocalIp: 192.168.86.31
name: mylab
nodeId: e3424338aaf05bdf25e57385bbf62e12d9f7168b3b3cb9c7ab76795f
supernodeTypeName: _mk-v15-4996e4c2442cc796f2c0ddb4e5e1627d._tcp
version: v2.3.1

Congratulations! You've learned how to install the edegEnginer runtime on Linux, Raspian and MacOS. Also you've learned how to install the mimik-edge-cli took and verified that it works against the edgeEngine Runtime.

© 2022 mimik Technology Inc. All Rights Reserved