aos_servicemanager

command module
v0.0.0-...-6c6898a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 29, 2024 License: Apache-2.0 Imports: 29 Imported by: 0

README

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

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
Package alerts provides set of API to send system and services alerts
Package alerts provides set of API to send system and services alerts
Package config provides set of API to provide aos configuration
Package config provides set of API to provide aos configuration
Package launcher provides set of API to controls services lifecycle
Package launcher provides set of API to controls services lifecycle
Package layermanager provides set of API to controls service fs layers
Package layermanager provides set of API to controls service fs layers
Package logging provides set of API to retrieve system and instance log
Package logging provides set of API to retrieve system and instance log
Package networkmanager provides set of API to configure network
Package networkmanager provides set of API to configure network
Package resourcemanager provides set of API to provide access to system resources such as devices, cpu, ram, etc
Package resourcemanager provides set of API to provide access to system resources such as devices, cpu, ram, etc
utils

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL