Giter Club home page Giter Club logo

incepiton-mysql's Introduction

Incepiton Mysql

🍎 A web platform designed for MySQL Inception.

⚓ 基于Inception的SQL自动化审核平台。

Travis Travis Travis Travis Travis Travis Travis

功能一览

登陆

登陆流程分两种,一种对接企业内部的OpenLDAP,实现账号统一管理。另一种是直接走数据库。两种方式的选择通过config.py中的LDAP_ON_OFF控制

权限管理

分三种角色。Dev,开发人;Audit,审核人;Admin,管理员

Dev功能

  • 数据库实例查看、申请、取消
  • 工单查看、申请、取消、修改
  • 工单状态、数目可视化展示

Audit功能

  • 数据库实例查看、分配、撤销
  • 工单查看、取消、驳回、执行、定时执行
  • 支持 pt-online-schema-change 工具,大表可进行 online DDL操作
  • SQL执行进度实时获取,中途可停止,需手动清除触发器和临时表

Admin功能

  • 数据库实例添加、修改、删除
  • 用户添加、修改、删除

邮件通知

重要功能介绍

支持分表操作

分表操作

自动审核

发起SQL上线,由Inception自动审核,自动审核成功后,提交至Audit。

自动审核结果

审核人操作

审核人操作

SQL执行进度实时获取

只有走pt-osc修改大表时,才会显示执行进度。具体多大的表走pt-osc,可以通过 Inception 来配置,具体参考 Inception文档进度获取

定时任务

定时任务可设置、取消 定时任务

工单图表

图表

回滚操作

回滚

资源状态说明

  • 0:Success,成功
  • 1:Pending,未处理
  • 2:Dev Cancelled,开发人取消
  • 3:Audit Cancelled,审核人取消

工单状态说明

  • 0:Success,成功
  • 1:Pending, 带人工审核
  • 2:Check Failed,自动审核失败
  • 3:Executing,执行中
  • 4:Error,执行异常
  • 5:Dev Cancelled,开发人取消
  • 6:Audit Cancelled,审核人取消
  • 7:Audit Rejected,审核人驳回
  • 8:Timer,定时任务

部分开发说明

  1. Inception编译安装,请使用 bison 2.6 以下版本

  2. 请注意 Python3 和 Python2 编码不同

  3. 对接OpenLDAP,使用了flask-simpleLDAP扩展,为了兼容 python3,有一处源码需要修改,__init.__py 第153行,按如下修改 ldap

  4. 为了兼容 Inception 返回的信息,pyMysql 需要修改两处源码。

  • python3使用的pyMysql模块里并未兼容inception返回的server信息,因此需要添加 2

  • python3的pyMysql模块会向inception发送SHOW WARNINGS语句,导致inception返回一个"Must start as begin statement"错误。 1

  1. Celery 最新版本即4.1.0 存在时区设置BUG,具体详见TimeZone Bug,具体就是设置了 Asia/Shanghai,ETA 执行的时间比正常东八区时间又多了8个小时,不过我已经在代码里处理过了。官方会在下个版本修复。

使用说明

  • 创建表结构
python manage.py shell
db.create_all()
  • 创建用户

如果是走OpenLDAP的话,不需要手动创建用户,会自动同步到数据库中。

不走OpenLDAP,用户需要创建。角色的分配需要admin用户登陆之后修改。

创建方式一: 适用于普通用户,直接可以从登陆页面的注册链接进行注册

创建方式二: admin用户和普通用户,以创建test用户为例

python manage.py create_user --name test --password test --email [email protected]
  • 启动 Celery

Celery 需要使用 broker 和 backend, 我这里都采用了 redis。具体 Celery 的使用 查看Celery文档

    celery worker -A celery_runner --logleve=info --statedb=/tmp/worker.state

注意上面的 --statedb=/tmp/worker.state,撤销的定时任务均被 Celery 保存在里面,所以最好不要丢失。

  • 部署

Flask部署方式请参考部署

  • 本地测试
python manage.py runserver --threaded

不再维护

该项目已不再维护。

incepiton-mysql's People

Contributors

tianny avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

incepiton-mysql's Issues

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.