中文

foundationConsolePy is Python backend microservices collection for AnyBackup. It serves as backend services layer of AnyBackup, designed to provide disaster recovery management, cluster management, authentication, key management, and deployment management capabilities.
foundationConsolePy is the Python backend service collection for AnyBackup V9, providing disaster recovery management, cluster management, authentication and authorization, key management, deployment management, and other core capabilities.
- Microservice Architecture: 8 independent microservices with clear responsibilities and easy extensibility
- High Availability Design: Supports VIP failover and automatic service failover
- Distributed Cluster: Service discovery and configuration management based on Etcd
- Multi-tenant Support: Complete tenant isolation and permission management
- Secure and Reliable: Key management, data encryption, audit logging
foundationConsolePy/
├── service/ # Microservice directory
│ ├── service_AuthService/ # Authentication service
│ ├── service_CommonService/ # Common resource management service
│ ├── service_ClusterService/ # Cluster management service
│ ├── service_ClusterMgmService/ # Cluster operation management service
│ ├── service_DeploymentService/ # Deployment management service
│ ├── service_KMSService/ # Key management service
│ └── service_SvrMgmService/ # Server management service
├── scripts/ # Build scripts directory
├── common/ # Common build framework
│ └── buildframework/apollo/ # Apollo build framework
├── LICENSE # License file
├── Makefile # Build entry
├── README.md # English README
└── README.zh-CN.md # Chinese README
| Module |
Path |
Description |
Module README |
| AuthService |
service/service_AuthService/ |
Authentication service providing user authentication, multi-tenant management, RBAC, LDAP/OAuth2 integration |
README |
| CommonService |
service/service_CommonService/ |
Common resource management service providing client management, virtualization platform integration, cloud storage management |
README |
| ClusterService |
service/service_ClusterService/ |
Cluster management service providing node management, service discovery, configuration management, VIP failover |
README |
| ClusterMgmService |
service/service_ClusterMgmService/ |
Cluster operation management service providing performance monitoring, alert management, log management, fault diagnosis |
README |
| DeploymentService |
service/service_DeploymentService/ |
Deployment management service providing package management, remote deployment, client upgrade, plugin management |
README |
| KMSService |
service/service_KMSService/ |
Key management service providing master key management, automatic key rotation, third-party KMS integration |
README |
| SvrMgmService |
service/service_SvrMgmService/ |
Server management service providing server node management, resource monitoring, health check |
README |
| Apollo Build Framework |
common/buildframework/apollo/ |
Apollo build framework providing unified build toolchain and CMake modules |
N/A |
| Component |
Version |
Description |
| OS |
CentOS 7+ / Ubuntu 18.04+ |
Linux x86_64 |
| Python |
3.6+ |
Runtime environment |
| PostgreSQL |
10+ |
Primary database (or MySQL 5.7+) |
| MySQL |
5.7+ |
Alternative database |
| Etcd |
3.x+ |
Service discovery and configuration center |
| NATS |
2.x+ |
Message queue (optional) |
| Systemd |
- |
Process management |
| Component |
Version |
Description |
| OS |
CentOS 7+ / Ubuntu 18.04+ |
Linux environment recommended |
| Python |
3.6+ |
Development language |
| pip |
Latest |
Package manager |
| pytest |
6.x+ |
Testing framework |
| pytest-cov |
- |
Test coverage tool |
| Apache Thrift |
0.13+ |
RPC framework compiler |
- Ensure
foundationLibrary and foundationCMake repositories are in same parent directory as this project
- Install Python 3.6+ and pip
# Generate dependencies from foundationLibrary to ab_deps
make deps
# Or specify foundationLibrary path
make deps FOUNDATION=/path/to/foundationLibrary
# Build all services
make build
# Build specific service
make build SERVICE=service_AuthService
Build artifacts are located in each service's ci/package/Linux_el7_x64/Release directory.
# Install dependencies
pip install -r requirements.txt
# Enter service directory
cd service/service_AuthService/src
# Initialize database
python manage.py migrate --settings=AuthService.settings
# Start service
python manage.py run_server --settings=AuthService.settings
- Follow PEP 8 Python coding conventions
- Use Django ORM for database operations
- Use Thrift for service interface definitions
- All service operations must be logged
# Run unit tests
pytest ./service/service_AuthService --ds=AuthService.settings
# Generate coverage report
pytest ./service/service_AuthService --ds=AuthService.settings \
--cov=./service/service_AuthService \
--cov-report=html
| Service |
Thrift Port |
Description |
| AuthService |
10001 |
Authentication service |
| CommonService |
10002 |
Common resource management |
| ClusterService |
10003 |
Cluster management |
| ClusterMgmService |
10004 |
Cluster operation management |
| DeploymentService |
10005 |
Deployment management |
| KMSService |
10006 |
Key management |
| SvrMgmService |
10007 |
Server management |