Giter VIP home page Giter VIP logo

aos_servicemanager's Introduction

AOS Service Manager

CI codecov Quality Gate Status

Aos Service Manager (SM) is a part of Aos system which resides on the device side and stands for the following tasks:

  • communicate with the communication manager;
  • install, remove, start, stop Aos services;
  • configure Aos services network;
  • configure and monitor Aos services and system resource usage;
  • provide persistent storage and state handling for Aos services.

See architecture document for more details.

Build

Required GO packages

All requires GO packages exist under vendor folder. Content of this folder is created with GO modules:

export GO111MODULE=on
go mod init
go mod vendor

Required native packages

  • libsystemd-dev

Native build

go build

ARM 64 build

Install arm64 toolchain:

sudo apt install gcc-aarch64-linux-gnu

Build:

CC=aarch64-linux-gnu-gcc CGO_ENABLED=1 GOOS=linux GOARCH=arm64 go build

Configuration

SM is configured through a configuration file. The file aos_servicemanager.cfg should be either in current directory or specified with command line option as following:

./aos_servicemanager -c aos_servicemanager.cfg

The configuration file has JSON format described [here] (https://docs.aoscloud.io/bin/view/Home/Architecture/General/Data%20formats/Core%20component%20configurations/Service%20Manager%20configuration/). Example configuration file could be found in misc/config/aos_servicemanager.cfg

To increase log level use option -v:

./aos_servicemanager -c aos_servicemanager.cfg -v debug

System folders and files mount

For each installed service, SM mounts following system folders:

  • /bin
  • /sbin
  • /lib
  • /usr
  • /lib64 - if exists
  • /tmp - this is temporary solution. Each service should has its own tmp folder
  • /etc/ssl - this is temporary solution. Each service should be provided with its own certificates

To configure service network, SM mounts following system files:

  • /etc/hosts
  • /etc/resolv.conf
  • /etc/nsswitch.conf

To override system network configuration, a custom version of the above files can be put to SM working directory under etc folder.

Run

Required packages

SM needs CM and IAM to be running and configured (see CM and IAM) before start.

SM requires following applications to be available in the system or placed in SM working directory:

  • runc or crun - launch service containers

Test required packages

  • [libssl-dev] - headers for TPM simulator
  • [pyftpdlib] - light python ftp server

Required Python3 packages

Following python3 packages are required to launch demo python service:

  • python3-compression
  • python3-crypt
  • python3-enum
  • python3-json
  • python3-misc
  • python3-selectors
  • python3-shell
  • python3-six
  • python3-threading
  • python3-websocket-client

Following python3 packages are required to launch telemetry-emulator:

  • python3-argparse
  • python3-compression
  • python3-datetime
  • python3-json
  • python3-misc
  • python3-netserver
  • python3-selectors
  • python3-shell
  • python3-signal
  • python3-textutils
  • python3-threading

Test

Install all necessary dependencies:

./ci/setup_env.sh

Test all packages:

sudo env "PATH=$PATH" go test ./... -v

aos_servicemanager's People

Contributors

abaks avatar al1img avatar eabramov84 avatar galaxyraiser avatar lkomaryanskiy avatar lorc avatar mlohvynenko avatar mykola-kobets-epam avatar oleh-mykytiuk avatar oleksiimoisieiev avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.