Giter Club home page Giter Club logo

bk-paas's Introduction

license Release Version PRs Welcome

(English Documents Available)

所属蓝鲸智云主版本 V6,当前该项目停止更新,仅维护功能

蓝鲸智云PaaS平台是一个开放式的开发平台,让开发者可以方便快捷地创建、开发、部署和管理SaaS应用。

本次开源的是蓝鲸智云PaaS平台社区版(BlueKing PaaS Community Edition),它提供了应用引擎、前后台开发框架、API网关、调度引擎、统一登录、公共组件等模块,帮助用户快速、低成本、免运维地构建支撑工具和运营系统(统称为SaaS应用),它为一个SaaS应用从创建到部署,再到后续的维护管理提供了完善的自动化和自助化服务,从而使开发者可以集中精力关注SaaS应用的逻辑开发。

蓝鲸智云PaaS平台源码包含:

  • PaaS(paas-ce/paas): 包含4大服务(python [Django])
    • login: 蓝鲸统一登录服务
    • paas: 蓝鲸开发者中心&web工作台
    • esb: 蓝鲸API网关
    • appengine: 蓝鲸应用引擎
  • PaaSAgent(paas-ce/paasagent): 蓝鲸应用引擎Agent(golang [labstack/echo])
  • LessCode: 蓝鲸运维开发平台,提供了前端页面在线可视化拖拽组装、配置编辑、源码生成、二次开发等能力,详细介绍

蓝鲸智云PaaS平台产品的发展路线图

类别 当前状态 开源状态 开源地址 所属蓝鲸智云主版本 发布时间
PaaS3.0 主线版本,更新维护中 已开源 https://github.com/tencentblueking/blueking-paas V7 2022年
PaaS2.0 停止更新,仅维护功能 已开源 https://github.com/tencent/bk-paas V6 2019年
PaaS1.0 停止维护 未开源 2012年

模块列表 PaaS2.0(停止更新,仅限维护) PaaS3.0(活跃开源项目)
esb: 蓝鲸API网关 集成在主仓库(paas-ce/paas/esb) 独立成一个产品,APIGateway
login: 蓝鲸统一登录服务 集成在主仓库(paas-ce/paas/login) 独立成一个产品,统一登录用户管理
paas: 蓝鲸开发者中心 集成在主仓库(paas-ce/paas) 独立成一个产品,PaaS-开发者中心
paas: web工作台 集成在主仓库(paas-ce/paas) 独立成一个产品,将“工作台”优化为桌面
LessCode: 蓝鲸运维开发平台 集成在主仓库 lesscode-master 分支 独立成一个产品,运维开发平台

V6.0及以前研发的SaaS,如何迁移到V7.0呢?

PaaS平台的“开发者中心”提供“一键迁移”功能,仅支持将蓝鲸官方“Python开发框架”研发的SaaS,其他类型的SaaS迁移方案正在测试中(敬请期待,后续将更新至官网)。


PaaS平台各版本的功能差异有哪些?

功能 PaaS2.0 PaaS3.0
平台、应用集群最小规模 平台(1台服务器)/应用(1台服务器)
可混用
无高可用
平台(1台服务器)/应用(1台服务器)
可混用
底层技术 原生docker kubernetes
应用集群扩展性 手动 自动调用集群节点扩展
应用扩展性 手动,繁琐 调整副本数自动扩展
应用类型 主要 web 类应用 支持不同编程语言、复杂应用架构
支持编程语言 Python(PHP、Java 不成熟) Python、Go、Node.JS
支持镜像部署 有 (可以支持任意编程语言)
支持应用源码仓库 svn,Git svn、Git(支持 Oauth 授权)
支持自定义进程启动命令
支持应用多模块管理及部署
在线查看进程实时日志
在线停止进程
支持进程间通信设置
在线调整进程实例数
部署限制(仅管理员可部署)
实时查看应用 CPU/内存 资源信息 有(二期,基于 BCS)
支持Webconsole
支持访问方式 仅子路径,特殊方式配置独立域名 子路径 + 独立子域名
支持独立域名
MySQL 增强服务 有, 只对 S-Mart 应用提供
Redis 增强服务
RabbitMQ 增强服务
bkrepo 增强服务

Overview

Features

  • 开发者中心:提供自助化、自动化服务,支持快速、低成本、免运维地构建SaaS应用
  • 统一用户登录体系:支持用户及角色管理,支持对接企业内部登录体系(对接说明
  • 开发框架:提供统一的SaaS应用开发框架, 提升开发效率
  • API网关:支持两种接入模式(在线自助接入和组件编码接入)的企业级服务总线,方便开发者对接企业内已有系统的API服务
  • 多环境部署:支持多环境部署SaaS应用, 方便开发者进行测试验证及生产环境发布
  • 可插拔式应用:支持蓝鲸S-mart应用上传部署, 方便蓝鲸S-mart应用部署移植 更多应用
  • 运维开发平台:支持前端页面在线可视化拖拽组装、配置编辑、源码生成、二次开发等能力(详细介绍

Experience

Getting started

Roadmap

Support

BlueKing Community

  • BK-CI:蓝鲸持续集成平台是一个开源的持续集成和持续交付系统,可以轻松将你的研发流程呈现到你面前。
  • BK-BCS:蓝鲸容器管理平台是以容器技术为基础,为微服务业务提供编排管理的基础服务平台。
  • BK-PaaS:蓝鲸PaaS平台是一个开放式的开发平台,让开发者可以方便快捷地创建、开发、部署和管理SaaS应用。
  • BK-SOPS:标准运维(SOPS)是通过可视化的图形界面进行任务流程编排和执行的系统,是蓝鲸体系中一款轻量级的调度编排类SaaS产品。
  • BK-CMDB:蓝鲸配置平台是一个面向资产及应用的企业级配置管理平台。
  • TencentBlueKing/iam-python-sdk / TencentBlueKing/iam-go-sdk:蓝鲸权限中心SDK

Contributing

如果你有好的意见或建议,欢迎给我们提 Issues 或 Pull Requests,为蓝鲸开源社区贡献力量。关于分支/issue及PR, 请查看 CONTRIBUTING

腾讯开源激励计划 鼓励开发者的参与和贡献,期待你的加入。

License

基于 MIT 协议, 详细请参考LICENSE

我们承诺未来不会更改适用于交付给任何人的当前项目版本的开源许可证(MIT 协议)。

bk-paas's People

Contributors

alex-smile avatar canway-obama avatar ielgnaw avatar jamesgetx avatar jiayuan929 avatar molly0755 avatar nannan00 avatar sundytt avatar wenjaron avatar wklken avatar xiexianbin 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  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 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

bk-paas's Issues

paas部署应用失败,

PaaS/PaaSAgent版本(The versions used):
PaaS:3.2.521
PaaSAgent:3.3.19

发生了什么(What happened):
部署应用时,页面只输出了部署失败,查看/data/paas/paas_agent/logs/agent.log显示
2019/08/20 13:43:35 job.go:263: cmd.Start error fork/exec /data/paas/paas_agent/paas_agent/etc/build/virtualenv/saas/buildsaas: no such file or directory

期望是什么(What you expected to happen):
我都是按照文档部署了,弄了三天了,一大堆问题,希望能协助解决一下

如何复现(How to reproduce it):

相关的日志详情(访问日志及应用日志: paas.log/login.log/esb.log/esb_api.log)和截图等(Log & Screenshot):
2019/08/20 13:43:35 http.go:73: RunJob start ... ...
2019/08/20 13:43:35 job.go:263: cmd.Start error fork/exec /data/paas/paas_agent/paas_agent/etc/build/virtualenv/saas/buildsaas: no such file or directory

备注(Anything else we need to know):

PaaS控制面板用户管理链接404

BUG反馈还是需求提交(Is this a BUG REPORT or FEATURE REQUEST)? (choose one):
BUG

PaaS/PaaSAgent版本(The versions used):
3.2.521

发生了什么(What happened):
在PaaS的应用面板中点击用户管理,出现404,应该是端口不对

期望是什么(What you expected to happen):
正常跳转到用户管理

如何复现(How to reproduce it):
开源PaaS部署好之后,首先访问http://www.bking.com:8001/platform/,然后在右侧的常用链接中点击用户管理。

相关的日志详情(访问日志及应用日志: paas.log/login.log/esb.log/esb_api.log)和截图等(Log & Screenshot):

[15/Aug/2019 10:03:16] "GET /login/accounts/user/list/ HTTP/1.1" 404 3915

备注(Anything else we need to know):

用户认证报错

在搭建好开源bk-paas后,又部署了标准化运维,现在访问标准化运维报错如下:
image
查看标准化运维日志如下:
image
查看esb日志如下:
image
查看login日志如下:
image
发现 bk_username 经过esb传给login后内容没有了。
请问是esb是哪里配置不对吗?

调用企业微信API, 状态码返回是200, 返回的内容是报错!

调用企业微信API接口, 返回的status_code是200, 但是content返回的内容是有问题的,错误的信息如下:
{‘message’: “Component request third-party system [weixin_qy] error: [get_token] error: status_code: 404, Error Message: Third-party system does not find this interface”}

Smart应用缺失环境变量管理入口

背景描述:

  • 目前开源版已经支持环境变量功能, 我的应用目前二级页面左侧导航有环境变量入口
  • 而smart应用, 由于目前没有相应入口, 所以无法查看及新增环境变量
  • 目前smart应用入口只有: 基本信息 / 发布记录 两项
  • 需要复用环境变量模板

需求:

  • 为smart应用增加入口
    image

docker容器化部署: 支持rabbitmq+paas_agent+nginx

目前基础版镜像, 只能体验login/开发者中心/esb, 无法体验应用部署过程

需要:

  1. 将rabbitmq打入镜像, 做初始化
  2. 将paas_agent打入镜像, 可以管控所有应用
  3. 将nginx打入镜像, 以暴露应用访问

目标: smart应用等上传部署的saas, 可以正常部署

能否提供一个快速体验的docker版本?

BUG反馈还是需求提交(Is this a BUG REPORT or FEATURE REQUEST)? (choose one):

PaaS/PaaSAgent版本(The versions used):

发生了什么(What happened):

期望是什么(What you expected to happen):

如何复现(How to reproduce it):

相关的日志详情(访问日志及应用日志: paas.log/login.log/esb.log/esb_api.log)和截图等(Log & Screenshot):

备注(Anything else we need to know):

我的应用-应用管理-基本信息-开发语言变更

页面位置: 我的应用 - 应用管理 - 基本信息 - 开发语言

问题描述: 目前显示 Python(Django 1.8), 而最新的5.1(devops_support分支), 使用的新的开发框架(2.0.0), 其Django版本是1.11

所以这里需要更新, 去掉 Django字样

截图:

image

开源版paas部署部分saas后无限登录

BUG反馈还是需求提交(Is this a BUG REPORT or FEATURE REQUEST)? (choose one):
BUG反馈

PaaS/PaaSAgent版本(The versions used):
开源版

发生了什么(What happened):
开源paas部署完成后,可以正常加载开发样例、开发框架以及smart应用市场下载的开源组件,但是其中带有社区版字眼的组件,只能将V4的部署成功,而且部署成功后,进入该saas时,会无限登录,而其他非社区版的saas则可以正常使用。

期望是什么(What you expected to happen):
希望开源版的paas可以成功加载故障治愈、日志检索、节点管理等在smart市场只包含社区版字眼的saas,例如这种:
image

如何复现(How to reproduce it):
每次进入该saas时

相关的日志详情(访问日志及应用日志: paas.log/login.log/esb.log/esb_api.log)和截图等(Log & Screenshot):
bk_fta_solutions.log 以bk_fta_solutions为例
image

备注(Anything else we need to know):
若需使用开源版的paas,想问一下您这边是建议自己部署还是从社区版迁移,谢谢。

用户管理接口

BUG反馈还是需求提交(Is this a BUG REPORT or FEATURE REQUEST)? (choose one):
FEATURE REQUEST

PaaS/PaaSAgent版本(The versions used):

发生了什么(What happened):
用户名存在无法创建用户-》 所以我选择更新用户-》更新用户需要用户ID
没有API接口可以获取包含用户ID的信息

期望是什么(What you expected to happen):
我希望能用接口创建用户,或者修改用户信息

如何复现(How to reproduce it):

相关的日志详情(访问日志及应用日志: paas.log/login.log/esb.log/esb_api.log)和截图等(Log & Screenshot):

备注(Anything else we need to know):

S-mart 应用管理优化

1、S-mart应用列表,进入应用二级信息页面 增加返回操作
2、S-mart应用增加环境变量管理功能
3、UI优化:对齐
image

Smart应用新增二级导航

背景:

开源版smart应用, 目前没有二级导航页面; 无法像[我的应用] 一样, 提供每个应用的左侧导航;

需求:

增加smart应用的二级导航, 将 [基本信息]/[发布记录]/[环境变量]以及上传版本/发布/下架等 放入二级导航

可以参考[我的应用]的做法

以下截图为企业版smart应用的界面, 供参考

image

./globals.env: line 36: HAS_DNS_SERVER: command not found

BUG反馈还是需求提交(Is this a BUG REPORT or FEATURE REQUEST)? (choose one):

bug
PaaS/PaaSAgent版本(The versions used):

5.0.4
发生了什么(What happened):
运行程序时出现./globals.env: line 36: HAS_DNS_SERVER: command not found

期望是什么(What you expected to happen):

如何解决
如何复现(How to reproduce it):

在install 下运行./bkcec start redis 或mysql时
相关的日志详情(访问日志及应用日志: paas.log/login.log/esb.log/esb_api.log)和截图等(Log & Screenshot):
image

备注(Anything else we need to know):

部署文件上传失败无提示

BUG反馈还是需求提交(Is this a BUG REPORT or FEATURE REQUEST)? (choose one):
BUG反馈

PaaS/PaaSAgent版本(The versions used):
5.1

发生了什么(What happened):
部署新应用上传文件时,500错误,页面还是正在上传且没有提示

期望是什么(What you expected to happen):
提示错误并且可以再次上传

如何复现(How to reproduce it):
磁盘空间不足导致上传失败

相关的日志详情(访问日志及应用日志: paas.log/login.log/esb.log/esb_api.log)和截图等(Log & Screenshot):
image
在服务器署结果

2020-02-22 10:10:08 89   INFO   uploading file /data/src/official_saas/bk_monitor_V2.5.122.tar.gz, url:http://paas.bk.com:80/saas/upload/bk_monitor/, data: {'csrfmiddlewaretoken': '***'} ...
2020-02-22 10:10:10 93   ERROR  upload faild:<html>
<head><title>500 Internal Server Error</title></head>
<body>
<center><h1>500 Internal Server Error</h1></center>
<hr><center>nginx/1.16.1</center>
</body>
</html>

备注(Anything else we need to know):

关于使用paas平台的想法

关于paas开发使用技术的技术资料希望可以分享,提高我们对paas的熟悉时间。
建议增加项目总略图, 针对项目或者模块进行摘要,便于用户熟悉和开发扩展。

节点管理 nginx server配置保存异常

bk完整app版本号:5.0.4
部署方式:单机完全安装
部署配置:16c32g500g
异常app:【bk_nodeman】
异常app部署版本号:bk_nodeman_V1.1.12
异常问题:
问题1:

  1. 节点管理,右上角点击 nginx serever 配置,填写ip:port 点击保存报错,错误如下:
    image
  2. 基于1咨询了QQ群给我答复是未填写耗时时间导致,继续填写超时时间后点击保存,依然报错;
  3. 基于2继续咨询QQ群给我答复是没有点击立即配置,继续点击立即配置,依然报错;

问题2:

  1. 业务列表展示了已经停用了的业务名称"蓝鲸",该业务在配置管理平台状态为停用;
    image

个人分析:
问题1和2,应该是bug导致.

《极速体验》无法启动服务

按照《极速体验》文档下载docker镜像并创建容器,测试无法访问,进入容器发现服务未启动,端口未监听。尝试执行了一下supervisor的脚本,发现MySQL没法启动。再看了下supervisor的日志,一直在反复启动MySQL。

报错信息如下:

/paas # /etc/mysql_startup.sh
[i] MySQL directory already present, skipping creation
[i] Sleeping 5 sec
[i] start running mysqld
2019-12-23  3:39:21 140537689283464 [Note] /usr/bin/mysqld (mysqld 10.2.22-MariaDB-log) starting as process 9933 ...
2019-12-23  3:39:21 140537689283464 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2019-12-23  3:39:21 140537689283464 [Note] InnoDB: Uses event mutexes
2019-12-23  3:39:21 140537689283464 [Note] InnoDB: Compressed tables use zlib 1.2.11
2019-12-23  3:39:21 140537689283464 [Note] InnoDB: Using Linux native AIO
2019-12-23  3:39:21 140537689283464 [Note] InnoDB: Number of pools: 1
2019-12-23  3:39:21 140537689283464 [Note] InnoDB: Using SSE2 crc32 instructions
2019-12-23  3:39:21 140537689283464 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
2019-12-23  3:39:21 140537689283464 [Note] InnoDB: Completed initialization of buffer pool
2019-12-23  3:39:21 140537464744680 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
2019-12-23  3:39:21 140537689283464 [ERROR] InnoDB: Header page consists of zero bytes in datafile: ./ibdata1, Space ID:0, Flags: 0. Please refer to http://dev.mysql.com/doc/refman/5.7/en/innodb-troubleshooting-datadict.html for how to resolve the issue.
2019-12-23  3:39:21 140537689283464 [ERROR] InnoDB: Corrupted page [page id: space=0, page number=0] of datafile './ibdata1' could not be found in the doublewrite buffer.
2019-12-23  3:39:21 140537689283464 [ERROR] InnoDB: Plugin initialization aborted with error Data structure corruption
2019-12-23  3:39:22 140537689283464 [Note] InnoDB: Starting shutdown...
2019-12-23  3:39:22 140537689283464 [ERROR] Plugin 'InnoDB' init function returned error.
2019-12-23  3:39:22 140537689283464 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2019-12-23  3:39:22 140537689283464 [ERROR] mysqld: Got error 'Size of control file is smaller than expected' when trying to use aria control file '/var/lib/mysql/aria_log_control'
2019-12-23  3:39:22 140537689283464 [ERROR] Plugin 'Aria' init function returned error.
2019-12-23  3:39:22 140537689283464 [ERROR] Plugin 'Aria' registration as a STORAGE ENGINE failed.
2019-12-23  3:39:22 140537689283464 [Note] Plugin 'FEEDBACK' is disabled.
2019-12-23  3:39:22 140537689283464 [ERROR] Could not open mysql.plugin table. Some plugins may be not loaded
2019-12-23  3:39:22 140537689283464 [ERROR] Unknown/unsupported storage engine: InnoDB
2019-12-23  3:39:22 140537689283464 [ERROR] Aborting

希望提供自定义 supervisor 启动的进程的能力

BUG反馈还是需求提交(Is this a BUG REPORT or FEATURE REQUEST)? (choose one):

需求提交

PaaS/PaaSAgent版本(The versions used):

V3.2.2

发生了什么(What happened):

目前 S-mart 应用部署时无法自定义 supervisor 启动的进程

期望是什么(What you expected to happen):

希望开放自定义 supervisor 启动的进程的能力

单独部署的paas以及cmdb,使用paas跳转cmdb后跳转回用户管理页面

BUG反馈还是需求提交(Is this a BUG REPORT or FEATURE REQUEST)? (choose one):

PaaS/PaaSAgent版本(The versions used):
PaaS 3.2.2

发生了什么(What happened):
image
点击关联的cmdb,可以正常跳转到login页面
image
输入用户名密码后直接跳转到了用户管理页面
image
直接登陆cmdb的页面与上述操作结果一样
可以正常跳转到paas的login页面,输入用户密码后跳转用户管理页面
cmdb_webserver配置如下
image

期望是什么(What you expected to happen):
希望登陆后可以正常跳转回cmdb页面

如何复现(How to reproduce it):

相关的日志详情(访问日志及应用日志: paas.log/login.log/esb.log/esb_api.log)和截图等(Log & Screenshot):

备注(Anything else we need to know):

smart应用部署成功,但访问时nginx报504timeout

BUG反馈还是需求提交(Is this a BUG REPORT or FEATURE REQUEST)? (choose one):
需求提交

PaaS/PaaSAgent版本(The versions used):
最新开源代码

发生了什么(What happened):
访问部署成功的smart应用时报nginx504

期望是什么(What you expected to happen):
希望可以正常访问smart应用

如何复现(How to reproduce it):
每次访问已部署的smart应用

相关的日志详情(访问日志及应用日志: paas.log/login.log/esb.log/esb_api.log)和截图等(Log & Screenshot):
paas的nginx配置文件:
image
paasagent的nginx配置文件:
image

备注(Anything else we need to know):
这个是按照官方提供的示例nginx配置文件配置的,但是我这边是单机部署,后来我参考了一下社区版的配置,将paas的nginxconf中的192.168.1.2改为了本机的内网ip,将paasagent的nginxconf也改为监听本机的内网ip,此时不再报504而是会报404

设置环境变量后启动仍是development server

BUG反馈还是需求提交(Is this a BUG REPORT or FEATURE REQUEST)? (choose one):

PaaS/PaaSAgent版本(The versions used):

发生了什么(What happened):

期望是什么(What you expected to happen):

如何复现(How to reproduce it):

相关的日志详情(访问日志及应用日志: paas.log/login.log/esb.log/esb_api.log)和截图等(Log & Screenshot):

备注(Anything else we need to know):

部署smart应用失败

BUG反馈还是需求提交(Is this a BUG REPORT or FEATURE REQUEST)? (choose one):
BUG反馈

PaaS/PaaSAgent版本(The versions used):
最新的开源版本

发生了什么(What happened):
部署smart应用失败

期望是什么(What you expected to happen):
部署smart应用成功

如何复现(How to reproduce it):
部署任意一个smart应用时会出现

相关的日志详情(访问日志及应用日志: paas.log/login.log/esb.log/esb_api.log)和截图等(Log & Screenshot):
paas.log
image
paas_gunicorn.log
image
appengine_gunicorn.log
image
agent.log
image

备注(Anything else we need to know):
据我所知,部署smartapp成功的三个条件,paas的4大模块运行成功(nginx+gunicorn),正式服务器激活成功,rabbitmq激活成功,以上条件均已满足,rabbitmq是自行安装并且可以正常使用,版本也和社区版中的保持了一致

paas服务运行失败 KeyError: 255

环境:
python -V
Python 2.7.16

cat /etc/centos-release
CentOS Linux release 8.1.1911 (Core)

下面是运行login时的错误信息:
(venv) [vagrant@node01 login]$ python manage.py makemigrations
System check identified some issues:

WARNINGS:
?: (1_8.W001) The standalone TEMPLATE_* settings were deprecated in Django 1.8 and the TEMPLATES dictionary takes precedence. You must put the values of the following settings into your default TEMPLATES dict: TEMPLATE_CONTEXT_PROCESSORS.
Migrations for 'bkaccount':
0010_auto_20200414_0142.py:
- Alter field code on bkrole
- Alter field time_zone on userinfo

(venv) [vagrant@node01 login]$ python manage.py migrate
System check identified some issues:

WARNINGS:
?: (1_8.W001) The standalone TEMPLATE_* settings were deprecated in Django 1.8 and the TEMPLATES dictionary takes precedence. You must put the values of the following settings into your default TEMPLATES dict: TEMPLATE_CONTEXT_PROCESSORS.
Traceback (most recent call last):
File "manage.py", line 19, in
execute_from_command_line(sys.argv)
File "/data/venv/lib/python2.7/site-packages/django/core/management/init.py", line 354, in execute_from_command_line
utility.execute()
File "/data/venv/lib/python2.7/site-packages/django/core/management/init.py", line 346, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/data/venv/lib/python2.7/site-packages/django/core/management/base.py", line 394, in run_from_argv
self.execute(*args, **cmd_options)
File "/data/venv/lib/python2.7/site-packages/django/core/management/base.py", line 445, in execute
output = self.handle(*args, **options)
File "/data/venv/lib/python2.7/site-packages/django/core/management/commands/migrate.py", line 93, in handle
executor = MigrationExecutor(connection, self.migration_progress_callback)
File "/data/venv/lib/python2.7/site-packages/django/db/migrations/executor.py", line 19, in init
self.loader = MigrationLoader(self.connection)
File "/data/venv/lib/python2.7/site-packages/django/db/migrations/loader.py", line 47, in init
self.build_graph()
File "/data/venv/lib/python2.7/site-packages/django/db/migrations/loader.py", line 191, in build_graph
self.applied_migrations = recorder.applied_migrations()
File "/data/venv/lib/python2.7/site-packages/django/db/migrations/recorder.py", line 59, in applied_migrations
self.ensure_schema()
File "/data/venv/lib/python2.7/site-packages/django/db/migrations/recorder.py", line 49, in ensure_schema
if self.Migration._meta.db_table in self.connection.introspection.table_names(self.connection.cursor()):
File "/data/venv/lib/python2.7/site-packages/django/db/backends/base/base.py", line 162, in cursor
cursor = self.make_debug_cursor(self._cursor())
File "/data/venv/lib/python2.7/site-packages/django/db/backends/base/base.py", line 135, in _cursor
self.ensure_connection()
File "/data/venv/lib/python2.7/site-packages/django/db/backends/base/base.py", line 130, in ensure_connection
self.connect()
File "/data/venv/lib/python2.7/site-packages/django/db/backends/base/base.py", line 119, in connect
self.connection = self.get_new_connection(conn_params)
File "/data/venv/lib/python2.7/site-packages/django/db/backends/mysql/base.py", line 276, in get_new_connection
conn = Database.connect(**conn_params)
File "/data/venv/lib/python2.7/site-packages/pymysql/init.py", line 88, in Connect
return Connection(*args, **kwargs)
File "/data/venv/lib/python2.7/site-packages/pymysql/connections.py", line 657, in init
self.connect()
File "/data/venv/lib/python2.7/site-packages/pymysql/connections.py", line 850, in connect
self._get_server_information()
File "/data/venv/lib/python2.7/site-packages/pymysql/connections.py", line 1085, in _get_server_information
self.server_charset = charset_by_id(lang).name
File "/data/venv/lib/python2.7/site-packages/pymysql/charset.py", line 34, in by_id
return self._by_id[id]
KeyError: 255

安装过程中 pip install -r requirements.txt报错 error: cast between incompatible function types

这是个bug报告,在安装paas过程中,执行 pip install -r requirements.txt命令,在uWSGI步骤报错:

*** uWSGI compiling server core ***
[thread 1][x86_64-linux-gnu-gcc -pthread] core/utils.o
[thread 2][x86_64-linux-gnu-gcc -pthread] core/protocol.o
[thread 3][x86_64-linux-gnu-gcc -pthread] core/socket.o
[thread 0][x86_64-linux-gnu-gcc -pthread] core/logging.o
[thread 2][x86_64-linux-gnu-gcc -pthread] core/master.o
[thread 0][x86_64-linux-gnu-gcc -pthread] core/master_utils.o
[thread 3][x86_64-linux-gnu-gcc -pthread] core/emperor.o
[thread 2][x86_64-linux-gnu-gcc -pthread] core/notify.o
core/emperor.c: In function ‘uwsgi_emperor_vassal_start’:
core/emperor.c:991:15: error: cast between incompatible function types from ‘void (*)(struct uwsgi_instance )’ to ‘int ()(void )’ [-Werror=cast-function-type]
pid = clone((int (
)(void *)) uwsgi_emperor_spawn_vassal, stack + PTHREAD_STACK_MIN, SIGCHLD | uwsgi.emperor_clone, (void *) n_ui);
^
[thread 2][x86_64-linux-gnu-gcc -pthread] core/mule.o
[thread 0][x86_64-linux-gnu-gcc -pthread] core/subscription.o
[thread 1][x86_64-linux-gnu-gcc -pthread] core/stats.o
[thread 2][x86_64-linux-gnu-gcc -pthread] core/sendfile.o
[thread 2][x86_64-linux-gnu-gcc -pthread] core/async.o
cc1: all warnings being treated as errors


Failed building wheel for uWSGI
Running setup.py clean for uWSGI
Running setup.py bdist_wheel for PyYAML ... done
Stored in directory: /home/hatech/.cache/pip/wheels/ad/56/bc/1522f864feb2a358ea6f1a92b4798d69ac783a28e80567a18b
Running setup.py bdist_wheel for django-bootstrap-form ... done
Stored in directory: /home/hatech/.cache/pip/wheels/28/98/3b/25275ae47e7c779faeb0e6326d7873b0f72cb5e5b743b4b573
Running setup.py bdist_wheel for Markdown ... done
Stored in directory: /home/hatech/.cache/pip/wheels/d5/0a/9e/cf4ae0888c3bc8b3739fd54b37893f47418f680c20ec7b0485
Running setup.py bdist_wheel for static3 ... done
Stored in directory: /home/hatech/.cache/pip/wheels/c3/d0/4b/a415104b0303aa18d566463b02d1eacb8f43bc3d29a6dc4574
Successfully built dj-static mako pycrypto PyYAML django-bootstrap-form Markdown static3
Failed to build uWSGI
Installing collected packages: django, static3, dj-static, MarkupSafe, mako, pycrypto, chardet, idna, certifi, urllib3, requests, gunicorn, uWSGI, elasticsearch, pymysql, redis, PyYAML, Pillow, greenlet, gevent, pytz, enum34, jinja2, django-bootstrap-form, Markdown, pygments, funcsigs, pbr, six, mock
Running setup.py install for uWSGI ... error
Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;file='/tmp/pip-build-GjrCw4/uWSGI/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record /tmp/pip-XGAOP_-record/install-record.txt --single-version-externally-managed --compile --user --prefix=:
running install
using profile: buildconf/default.ini
detected include path: ['/usr/lib/gcc/x86_64-linux-gnu/8/include', '/usr/local/include', '/usr/lib/gcc/x86_64-linux-gnu/8/include-fixed', '/usr/include/x86_64-linux-gnu', '/usr/include']
Patching "bin_name" to properly install_scripts dir
detected CPU cores: 4
configured CFLAGS: -O2 -I. -Wall -Werror -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -fno-strict-aliasing -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -DUWSGI_HAS_IFADDRS -DUWSGI_LOCK_USE_MUTEX -DUWSGI_EVENT_USE_EPOLL -DUWSGI_EVENT_TIMER_USE_TIMERFD -DUWSGI_EVENT_FILEMONITOR_USE_INOTIFY -DUWSGI_VERSION=""2.0.13.1"" -DUWSGI_VERSION_BASE="2" -DUWSGI_VERSION_MAJOR="0" -DUWSGI_VERSION_MINOR="13" -DUWSGI_VERSION_REVISION="1" -DUWSGI_VERSION_CUSTOM="""" -DUWSGI_YAML -DUWSGI_SSL -DUWSGI_XML -DUWSGI_XML_EXPAT -DUWSGI_PLUGIN_DIR=""."" -DUWSGI_DECLARE_EMBEDDED_PLUGINS="UDEP(python);UDEP(gevent);UDEP(ping);UDEP(cache);UDEP(nagios);UDEP(rrdtool);UDEP(carbon);UDEP(rpc);UDEP(corerouter);UDEP(fastrouter);UDEP(http);UDEP(ugreen);UDEP(signal);UDEP(syslog);UDEP(rsyslog);UDEP(logsocket);UDEP(router_uwsgi);UDEP(router_redirect);UDEP(router_basicauth);UDEP(zergpool);UDEP(redislog);UDEP(mongodblog);UDEP(router_rewrite);UDEP(router_http);UDEP(logfile);UDEP(router_cache);UDEP(rawrouter);UDEP(router_static);UDEP(sslrouter);UDEP(spooler);UDEP(cheaper_busyness);UDEP(symcall);UDEP(transformation_tofile);UDEP(transformation_gzip);UDEP(transformation_chunked);UDEP(transformation_offload);UDEP(router_memcached);UDEP(router_redis);UDEP(router_hash);UDEP(router_expires);UDEP(router_metrics);UDEP(transformation_template);UDEP(stats_pusher_socket);" -DUWSGI_LOAD_EMBEDDED_PLUGINS="ULEP(python);ULEP(gevent);ULEP(ping);ULEP(cache);ULEP(nagios);ULEP(rrdtool);ULEP(carbon);ULEP(rpc);ULEP(corerouter);ULEP(fastrouter);ULEP(http);ULEP(ugreen);ULEP(signal);ULEP(syslog);ULEP(rsyslog);ULEP(logsocket);ULEP(router_uwsgi);ULEP(router_redirect);ULEP(router_basicauth);ULEP(zergpool);ULEP(redislog);ULEP(mongodblog);ULEP(router_rewrite);ULEP(router_http);ULEP(logfile);ULEP(router_cache);ULEP(rawrouter);ULEP(router_static);ULEP(sslrouter);ULEP(spooler);ULEP(cheaper_busyness);ULEP(symcall);ULEP(transformation_tofile);ULEP(transformation_gzip);ULEP(transformation_chunked);ULEP(transformation_offload);ULEP(router_memcached);ULEP(router_redis);ULEP(router_hash);ULEP(router_expires);ULEP(router_metrics);ULEP(transformation_template);ULEP(stats_pusher_socket);"
*** uWSGI compiling server core ***
core/utils.o is up to date
core/protocol.o is up to date
core/socket.o is up to date
core/logging.o is up to date
core/master.o is up to date
core/master_utils.o is up to date
[thread 1][x86_64-linux-gnu-gcc -pthread] core/emperor.o
core/notify.o is up to date
core/mule.o is up to date
core/subscription.o is up to date
core/stats.o is up to date
core/sendfile.o is up to date
core/async.o is up to date
[thread 2][x86_64-linux-gnu-gcc -pthread] core/master_checks.o
[thread 3][x86_64-linux-gnu-gcc -pthread] core/fifo.o
[thread 0][x86_64-linux-gnu-gcc -pthread] core/offload.o
core/emperor.c: In function ‘uwsgi_emperor_vassal_start’:
core/emperor.c:991:15: error: cast between incompatible function types from ‘void (*)(struct uwsgi_instance )’ to ‘int ()(void )’ [-Werror=cast-function-type]
pid = clone((int (
)(void *)) uwsgi_emperor_spawn_vassal, stack + PTHREAD_STACK_MIN, SIGCHLD | uwsgi.emperor_clone, (void *) n_ui);
^
cc1: all warnings being treated as errors
[thread 2][x86_64-linux-gnu-gcc -pthread] core/io.o

----------------------------------------

Command "/usr/bin/python -u -c "import setuptools, tokenize;file='/tmp/pip-build-GjrCw4/uWSGI/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record /tmp/pip-XGAOP_-record/install-record.txt --single-version-externally-managed --compile --user --prefix=" failed with error code 1 in /tmp/pip-build-GjrCw4/uWSGI/

centos8登录报错

centos8登录报错

sudo docker run -d --name="bk-paas" -p 8000-8003:8000-8003 ccr.ccs.tencentyun.com/bk.io/paas-standalone:latest

==> /var/log/paas.log <==
[10/Oct/2019 11:09:58] code 400, message Bad request syntax ('\xff\xf4\xff\xfd\x06')
[10/Oct/2019 11:09:58]

login get_all_user接口优化

(1)login/bkaccount/models.py 中 BkUser表以property方式返回了role(以连表查询方式)
(2)login/bkaccount/manager.py 中BkUserManager封装了对BkUser表的操作,其中_get_user_info、_get_user_info_v2、get_user_info、get_user_info_v2、get_all_user、get_all_users_v2、get_batch_user_with_dict、get_batch_users_with_dict_v2 直接或间接调用查询了user role
(3)login/bkaccount/urls.py中get_user、get_all_user、get_batch_user都调用了对应的BkUserManager的方法

导致批量查询用户时, 数据库查询量过大, 应该修改为批量查询

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.