Giter Site home page Giter Site logo

waylonwhynot / lightning-ops Goto Github PK

View Code? Open in Web Editor NEW

This project forked from zhengyansheng/lightning-ops

0.0 0.0 0.0 3.2 MB

以 `Python` 语言,采用 django-rest-framework 框架实现后端API开发

License: GNU General Public License v3.0

Shell 0.13% JavaScript 31.02% Python 45.27% CSS 22.98% Makefile 0.07% HTML 0.54%

lightning-ops's Introduction

lightning-ops

环境依赖

版本依赖

  • Python 3.6+
  • Django 3.1+
  • MySQL 5.7+
  • Redis 3.2+

模块介绍

  • 用户管理
  • LDAP登陆
  • API权限
  • 服务树
  • CMDB
  • 作业平台
  • 流量调度

项目目录结构

$ tree -L 1
.
├── LICENSE
├── Makefile   # 命令行快捷方式
├── README.md  # 说明文档
├── apps       # 项目app
├── base       # 基础库
├── common     # 通用工具函数
├── config     # 配置文件
├── data       # 上传的图片/脚本等
├── docs       # 文档
├── logs       # 日志目录
├── manage.py  # 默认命令行脚本入口文件
├── middleware # 项目中间件
├── ops        # 项目目录 
├── requirements.txt # 项目依赖的第三方包
├── start.sh   # 启动脚本
├── static     # 项目静态文件目录
└── stop.sh    # 停止脚本

部署

  • 克隆代码
$ git clone [email protected]:zhengyansheng/lightning-ops.git 
  • 虚拟环境
$ cd /opt/
$ cd lightning-ops
$ python3.6 -m venv .venv
$ source .venv/bin/activate
$ pip install --upgrade pip
$ pip install -r requirements.txt
# yum install openldap-devel python-ldap
  • 同步数据库
$ make migrate 
  • 启动服务
$ make run 
$ ./start.sh
  • supervisor
[program:lightning-ops]
directory=/opt/lightning-ops
command=/opt/lightning-ops/.venv/bin/gunicorn ops.wsgi:application -b 0.0.0.0:9000 -w 4 -k gthread
autostart=true
autorestart=true
redirect_stderr=true
stdout_logfile=/opt/lightning-ops/logs/supervisor.log
startsecs=0
  • systemd 支持
cat >/usr/lib/systemd/system/lightning-ops.service<<\EOF
[Unit]
Description='The lightning-ops server'
After=network.target

[Service]
Type=forking
PrivateTmp=true
Restart=on-failure
PIDFile=/run/gunicorn.pid
ExecStart=/opt/lightning-ops/.venv/bin/gunicorn -c /opt/lightning-ops/config/gunicorn.conf.py ops.wsgi:application --pid /run/gunicorn.pid
ExecReload=/bin/kill -s HUP $MAINPID
ExecStop=/bin/kill -s TERM $MAINPID

[Install]
WantedBy=multi-user.target
EOF
# systemctl daemon-reload
# systemctl enable lightning-ops
# systemctl restart lightning-ops
# systemctl status lightning-ops

lightning-ops's People

Contributors

lancger avatar zhengyansheng avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.