Acumos C++ client Developer Guide

Overview

This developper guide is intended to provide information for developpers who want to contribute to the acumos-c-client development.

Architecture and Design

In Acumos a model is packed as a dockerized microservice exposing which is specified using Google protobuf. In order to achieve that, the modeler must write a short C++ program that attaches the trained model with the generated gRPC stub in order to build an executable that contains the gRPC webserver as well as the trained model. This executable will then be started in the docker container.

High-Level Flow

../../../_images/Architecture.png

Class Diagrams

Class diagramm cpp client

../../../_images/Class_diagram_cpp_client.png

Class diagramm run microservice

../../../_images/Class_diagramm_run_microservice.png

Sequence Diagrams

Sequnce diagramm cpp client

../../../_images/Class_diagramm_run_microservice.png

Technology and Frameworks

  1. C++ 11
  2. gcc 7.4

Project Resources

Provide gerrit, Jira info, JavaDoc (javadoc.acumos.org) if relevant, link to REST API documentation, etc. For example:

  • Gerrit repo: acumos-c-client https://gerrit.acumos.org/r/q/project:acumos-c-client
  • Jira : Jira componenent name : acumos-c-client

Development Setup

Classical C++ development environment is required with at least C++ 11 and gcc 7.4

How to Run

Please have a look on Tutorial section of the Acumos C++ Client User Guide

How to Test

A test is available in the user guide

CLI Onboarding

For cli onboarding, you have to set two environment variables ACUMOS_HOST and ACUMOS_PORT. In acumos_host you have to write name of your acumos instance. Rest of things for api url is inserted by python script and your resultant url look like this.

Push URL: https://my.acumos.instance.org:443/onboarding-app/v2/models
Auth URL: https://my.acumos.instance.org:443/onboarding-app/v2/auth

Microservice generation and uploading license are also dependent on user. You provides the user response to option method. In cpp cli onboarding, use _push_model because zip model bundle is already created and you have provide the path to dump directory.

option = Options(create_microservice=_create_microservice, license=_license)
session_._push_model(self.dump_dir, self._push_api, self._auth_api, option, 2, None)

Design of CLI Onboarding

Onboarding Manager is responsible for creating bundle and for push model. This class consist of two public methods. First method is create_bundle which takes the object of bundle_information as parameter and return zip bundle. The bundle_information have following attributes. model_name is the name of model, proto_file path to the protobuf file, data_dir it is directory where data is placed, lib_dir path to the library directory, executable path to the executable file for microservice generation and dump it is directory where zip bundle is present. If there exists no dump directory then system will generate it automatically. Second method is push_model, it takes the object of model_information and bundle_information. The model_information have following attributes, host_name is the name of host where we submit the model, port the port number, (You can find the right host_name and port in the “ON-BOARDING MODEL” page of your Acumos instance) _USER_NAME and _PASSWORD is required for authentication. These UserName and password are the same as you used to authenticate yourself on Acumos. create_microservice is a boolean variable to control microservice generation during onboarding and license path of license (optional). The push_api and auth_api is required for cli onboarding. The method push_model create an object of cli_onboarding and call the method submit_model with both object bundle_information and model_information. All the information is taken separately via cpp_client and passed to the module manager. Purpose of creating this design is to use it separately as module. The input can also be fixed it in script so that the module can be run automatically.