developer portal

Documentation

Deploying edge microservice

This section describes a process to deploy your edge microservice. edgeSDK has APIs for managing edge microservice for deployment and runtime. You can check it out at here.

Note: If you are developing for Android or iOS mobile application, please use our Android or iOS wrapper for in-app deployment.

Prerequisites

First, gather the tools that you will need:

  1. Node.js
  2. edgeSDK
  3. edge microservice image (to learn how to build)
  4. edgeSDK OAuth Tool
  5. mimik developer account
  6. edgeSDK is authenticated on your device (to learn how to authenticate edgeSDK on your device)

Step 1. Obtain edge access token

  1. Open OAuth Tool from mimik developer console under Projects.
  2. Select your intended edgeSDK project for deploying your current microservice.
  3. Change device's local IP address to the IP address of the device that current microservice to deploy on.
  4. Click Get edge Access Token and login again in the prompted session.

Step 2. Deploy container image

Run the following command under the same directory of your containerized microservice file to deploy the container to edgeSDK container runtime:

Note: For Windows users, please change the single quote to double quote and vice versa for following CURL commands.

curl -i -H 'Authorization: Bearer <edge Access Token>' -F 'image=@<image file name with file extension>' http://<device ip address>:8083/mcm/v1/images

Step 3. Start deployed microservice

Run the following command to start the container image with your environment variables:

Note: For Windows users, please change the single quote to double quote and vice versa for following CURL commands.

Note: If you want to introduce your custom environment variables, add it to the env object in below commands.

curl -i -H 'Authorization: Bearer <edge Access Token>' -d '{"name": "<microservice name e.g. microservice-v1>", "image": "<name of microservice image without extension e.g. microservice>", "env": {"MCM.BASE_API_PATH": "<base path to call the microservice e.g. /sample/v1 >"} }' http://<your device ip>:8083/mcm/v1/containers

Need more help?

Feel free to contact us on stack overflow or send us a question via our support page if you have any questions.

Was this page helpful?