Application Manager - 程序管理器
MIT
跨平台
C/C++
软件简介
Application Manager,程序管理器,可以用来替代supervisor和cron-
tab,用来管理计算机上部署的各种类型的程序,支持定视任务,长任务,提供命令行和REST接口。
Setup build environment on Ubuntu
apt-get install g++ git make zlib1g-dev libssl-dev cmake
apt-get install libboost-all-dev libcpprest-dev libjsoncpp-dev libace-dev libgoogle-glog-dev libcctz-dev
REST APIs
# Application Manager
[](LICENSE)


## Introduction
Application Manager is a daemon application to manage different types of sub-
applications(process), each application can be a specific jobs, the app-
manager will make sure all defined applications running on-time with defined
behavior. provide REST APIs for integrate with outside app, provide command-
line to start/stop and register new app easily. Also can be a JWT server.
The internal timer is multi-threaded with high-precision that can be used to
replace Linux cron-tab and supervisor.
![]() Application can define envionment variables Application can define resource (memory & CPU) limitation (cgroup on Linux) SSL support Collect host/app resource usage Remote run shell commands JWT authentication ## Setup build environment on CentOS/Ubuntu/Debian
## Build
## REST APIs
Method | URI | Desc
\---|---|---
GET | /app/$app-name | Get an application infomation
GET | /app/$app-name/testrun?timeout=5 | Test run an application
GET | /app/$app-name/testrun/output?process_uuid=uuidabc | Get the stdout and
stderr for the test run
GET | /app-manager/applications | Get all application infomation
GET | /app-manager/resources | Get host resource usage
GET | /app-manager/config | Get all the configuration
PUT | /app/$app-name | Register a new application
POST| /app/$app-name?action=start | Start an application
POST| /app/$app-name?action=stop | Stop an application
POST| /authenticate | JWT authenticate
DELETE| /app/$app-name | Unregister an application
## How to install
**CentOS**:
If you directly run command line from installation console, there will have
issue on dependency libraries, you need source
/opt/appmanager/script/app.bashrc to get the environment. for the new console
will be OK, the source operation was automaticlly add to /etc/bashrc
**Ubuntu**:
## Show all sub command
## List application[s]
## Display host resource usage
## Display configurations
## Register a new application
## Remove an application
## Start an application
## Stop an application
## Test run an application and get stdout
## Run a shell command and get stdout

## Remote run a shell command

## Usage scenarios
1\. Integrate with package installation script and register startup command to
app manager automaticlly
2\. Install on remote host to execute command remotly and get output (can
build-up web ssh)
3\. Get resource usage (cpu/memory) for each application and host resource
status
## 3rd party deependencies
\- [C++11](http://www.cplusplus.com/articles/cpp11)
\- [ACE](https://github.com/DOCGroup/ACE_TAO)
\- [Microsoft cpprestsdk](https://github.com/Microsoft/cpprestsdk)
\- [boost](https://github.com/boostorg/boost)
\- [jsoncpp](https://github.com/open-source-parsers/jsoncpp)
\- [log4cpp](http://log4cpp.sourceforge.net)
\- [jwt_cpp](https://thalhammer.it/projects/jwt_cpp)
## Design
### Thread model
![]() |
URI |
---|---|
GET | /app/$app-name |
GET | /app-manager/applications |
GET | /app-manager/config |
PUT | /app/$app-name |
POST | /app/$app-name?action=start |
POST | /app/$app-name?action=stop |
DELETE | /app/$app-name |
Show all sub command
$ appc
Commands:
view List application[s]
config Display configurations
start Start a application
stop Stop a application
reg Add a new application
unreg Remove an application
Run 'appc COMMAND --help' for more information on a command.
Usage: appc [COMMAND] [ARG...] [flags]