当前位置:网站首页>SPuG - lightweight automatic operation and maintenance platform
SPuG - lightweight automatic operation and maintenance platform
2022-06-28 00:58:00 【Ink Sky Wheel】
For SMEs , It is troublesome to manage hosts and applications , Application deployment often requires direct connection to the server , Then manually configure the environment 、 Code pull 、 Application construction, deployment and release , It's easy to make mistakes , And time-consuming . A good automatic operation and maintenance platform , Can often greatly save human and material resources , Improve development and deployment efficiency .Spug, It is a lightweight automatic operation and maintenance platform designed for small and medium-sized enterprises .

Spug Automatic operation and maintenance platform
brief introduction
Spug, yes openspug stay Github Open source automatic operation and maintenance platform , Project is located https://github.com/openspug/spug, At the same time Gitee On maintenance , Project is located https://gitee.com/openspug/spug, The current version is v2.3.9.
Spug For small and medium-sized enterprises , nothing Agent, Very light weight , Integrated host management 、 Host batch execution 、 Host online terminal 、 Application release deployment 、 Online task planning 、 Configuration center 、 monitor 、 Alarm and other functions , Easy to use , Flexible function , It can meet the requirements of general application automation deployment .

Spug project
install
Spug Simple deployment , Recommended for production environments Docker Image mount .Spug Provided in Docker hub And images on alicloud , You can pull it directly :
$ docker pull registry.aliyuncs.com/openspug/spug
After downloading the image , Direct operation , Build the container and start :
$ docker run -d --restart=always --name=spug -p 80:80 registry.aliyuncs.com/openspug/spug
By default, the internal of the image is used MySQL database , If there is a need for data persistence , Data mapping can be done :
$ docker run -d --restart=always --name=spug -p 80:80 -v mydata/:/data registry.aliyuncs.com/openspug/spug
then , Create an administrator account :
$ docker exec spug init_spug <username> <password>
$ docker restart spug
here , The service has been deployed , visit http://localhost:80 Can access .
Spug Depend on Python 3.6+, Node.js 12.14+, Redis 3+, Secondary development and deployment can be carried out . First download the project code :
$ git clone https://github.com/openspug/spug data/spug
then , establish Python Running environment :
$ cd data/spug/spug_api
$ python3 -m venv venv$ source venv/bin/activate$ pip install -r requirements.txt -i https://pypi.doubanio.com/simple/
Initialize database , By default SQLite, And create an administrator account :
$ python manage.py initdb
$ python manage.py useradd -u admin -p spug.dev -s -n Administrators
Start the backend API service :
$ python manage.py runserver
Front end use React Of Antd Development , Start after installing dependencies :
$ cd /data/spug/spug_web
$ npm install --registry=https://registry.npm.taobao.org
$ npm start
here , This completes the manual deployment of the development environment .
Example
After deployment ,Spug Mainly in the Web Use in the background .Spug The backstage mainly includes : The workbench 、 The host management 、 Batch execution 、 Application of release 、 Task plan 、 Configuration center 、 The monitoring center 、 Alarm center and system management module .
host , The server that represents the final deployment of the application , adopt SSH The way of public key , And Spug Services interact .Spug You can add and configure hosts in the background , And can execute commands in batches , Convenient for environment configuration, etc :

Host batch execution
Online terminals are provided in the background , Commands can be executed interactively on the host , At the same time, it supports file uploading and downloading , File management through graphical interface .
Spug Basic management of deployment through application . An application , It is a collection of different versions of applications or services that need to be deployed :

Application management
When we need to deploy an application , Release application is required , For target applications , Select publishing environment , as well as Git Version of the warehouse ( Branch , Or tags ), And the target host to be published , Submit a new release .
Spug Provides custom scripts for different stages , To achieve automated deployment :

Automated Deployment scripts
Execute before checking out the code , Is in Spug Server , Before pulling the code , Environment configuration, etc ;
Execute after checking out the code , After pulling the code , Do dependency installation 、 Compile and build ;
Execute before application publishing , On the target host , Stop the old application 、 Operation environment configuration, etc ;
Execute after the application is published , After the project is published to the target host , Start the application, etc .
Spug It also supports planning tasks , You can configure scheduled script tasks , Implement service status check and other work :

Planning tasks
Spug Monitoring center is provided , You can create monitoring tasks , Regularly detect the application status , For example, regularly open the port for detection , Carry out regular connectivity detection for the station :

The monitoring center
When an exception is detected , The system will automatically give an alarm , And by email 、 WeChat 、 Send nails, etc .
Spug Function permissions can also be set in the background , You can manage the permissions of personnel with different responsibilities within the team :

Role permissions
summary
Spug As an automatic operation and maintenance platform , Relatively light , No complex configuration required , You can complete the deployment of the service , And manage and publish applications through simple applications , Complete version management for different deployment projects , Implement an automated publishing process , And version rollback , It also provides a batch script to support multi host configuration , Provide scheduled tasks to realize status detection , Provide automatic alarm system to realize exception management, etc , It basically meets the requirements of automatic deployment , It's worth trying . at present ,Spug The project is still under active development , Project authors are soliciting new features they want to support , Interested developers may wish to participate in open source contributions .
Reference resources
《 Automatic operation and maintenance platform Spug test 》https://www.modb.pro/db/109402
《 nothing Agent Automatic operation and maintenance platform -spug》https://www.modb.pro/db/109401
边栏推荐
猜你喜欢

电商转化率这么抽象,到底是个啥?

Introduction to memory model of JVM

去哪儿网(Qunar) DevOps 实践分享
Latest MySQL advanced SQL statement Encyclopedia

Sword finger offer 61 Shunzi in playing cards

现代编程语言:Rust (铁锈,一文掌握钢铁是怎样生锈的)

Squid proxy server (Web cache layer for cache acceleration)

JVM的内存模型简介

翻译(5): 技术债务墻:一种让技术债务可见并可协商的方法

Ten MySQL locks, one article will give you full analysis
随机推荐
代码整洁之道--函数
打新债注册账户安全吗,会有风险吗?
现代编程语言:Rust (铁锈,一文掌握钢铁是怎样生锈的)
Mongodb- install a mongodb database locally on the windows computer
LabVIEW continuous sampling and limited sampling mode
吸顶方案1
Is it safe for Xiaobai in the stock market to open an account on the Internet?
1696D. Permutation Graph 思维
Logging log usage
The Internet industry has derived new technologies, new models and new types of industries
炼金术(4): 程序员的心智模型
章凡:飞猪基于因果推断技术的广告投后归因
796 div.2 C. managing history thinking
什么是过孔式导电滑环?
Taro--- day2--- compile and run
代码整洁之道--格式
网页鼠标点击特效案例收集(直播间红心同理)
Oracle数据库的启停
Taro---day2---编译运行
SDF学习之扭曲模型