Skip to content
This open source mModelShare microservice created by the mimik team is an example cross-platform solution for sharing machine learning models across devices.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
deploy
src
.eslintrc
.gitignore
README.md
config.json
package-lock.json
package.json
webpack.config.js

README.md

mModelShare

This open source mModelShare microservice created by the mimik team is an example cross-platform solution for sharing machine learning models across devices. More specifically, this edgeSDK microservice has the following functionality:

  1. Uploading the information about the machine learning model on your device to the mModelShare's local database.

  2. Retrieving the information regarding specific machine learning models from local database.

  3. Retrieving machine learning models from other devices.

Releases & Deployment

For latest update: https://developer.mimik.com/docs/microservices/deploy

How to obtain the built-version of this microservice?

Please visit the releases section of this GitHub page to download the ready-to-deploy container image file of this microservice.

How to deploy this microservice on edgeSDK?

  1. Please make sure that you have downloaded the latest edgeSDK and it is running correctly on your targeted development platform.

  2. Please check that you have performed all the following prerequisite steps to setup you edgeSDK on your targeted platform:

    1. Register yourself on mimik's developer portal and add your application information to the portal to get authorization of edgeSDK access. Note: For information about Redirect URL, please go to link.

      Attention: Please safe keep your App-ID and Redirect URL for OAuth authorization later on.

    2. Get your edgeSDK access token from following OAuth tool of your targeted platform:

      Please read this on how to use the OAuth tool: Instruction on How to use the OAuth tool.

      OAuthtool application for Windows
      OAuthtool application for MacOs
      OAuthtool application for Linux

      Attention: Please safe keep your edgeSDK access token for later deployment use.

    3. If you have not downloaded the latest built version of the microservice at here, please download it now.
  1. Now you are ready to deploy this microservice on the edgeSDK, please run the following command on the bash terminal:

    Note: For Windows user, please download Cygwin or Git Bash to perform this.

    Attention: Please run the following commend under the same directory of your downloaded microservice file.

    The following curl command is for deploying this microservice to the edgeSDK:

    curl -i -H 'Authorization: Bearer **Replace withYourToken**' -F "image=@modelshare-v1.tar" http://localhost:8083/mcm/v1/images

    The following curl command is for specifying the environment variable:

    curl -i -H 'Authorization: Bearer **ReplacewithYourToken**' -d '{"name": "model-v1", "image": "model-v1", "env": {"MCM.BASE_API_PATH": "/modelshare/v1", "uMDS": "http://127.0.0.1:8083/mds/v1"} }' http://localhost:8083/mcm/v1/containers

  2. The output of the above command will return status code of 200 after the deployment is successful.

  3. Now you can read about the APIs in this microservice and check their functionalities on SwaggerHub.

How to build a microservice

Tools that you need:

Steps to build:

  1. Clone the microservice project from GitHub somewhere accessible on your home directory. This guide will start from the Downloads folder

    cd ~/Downloads

    git clone https://github.com/mimikgit/mModelShare.git

  2. Navigate to the directory of the cloned repository.

  3. Install dependencies:

    npm install

  4. Next run build script:

    npm run-script build

  5. Verify that index.js is copied under /build directory.

    Attention: You will need to have the root permission to perform the following task.

  6. Change owner group of the build script in the deploy directory

    sudo chmod a+x deploy/build.sh

  7. Run build script to create an image for the container under deploy directory:

    cd deploy/ && ./build.sh

  8. Verify that a tar file of mimik container image is created as modelshare-v1.tar under deploy directory

  9. Now you can redirect back to the deployment section and deploy your newly built microservice.

Source Code Navigation

This Repository Folders

- src/     the main source code for the microservice
- build/   the compiled javascript (after running build scripts)
- deploy/  image file for the container

For more details about the src/ directory, please visit the README file under the src/ directory.

You can’t perform that action at this time.