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.
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
- libsystemd-dev
go 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
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
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.
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:
- [libssl-dev] - headers for TPM simulator
- [pyftpdlib] - light python ftp server
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
Install all necessary dependencies:
./ci/setup_env.sh
Test all packages:
sudo env "PATH=$PATH" go test ./... -v