Django 应用 Buildbot

Django作者之一 JACOB KAPLAN
所写的buildbot应用在Django系统。

全文总共分为两个部分
1,http://jacobian.org/writing/ci-is-hard/
2,http://jacobian.org/writing/configuration-and-architecture/

作者开源了他hack出的buildbot系统代码:https://github.com/jacobian/django-buildmaster

1,主要介绍了为什么针对Django建立CI系统很繁杂、困难。

  • Django 是一个复杂的系统,有很多的测试用例(当时3000+)
  • 支持太多的Python版本(CPython, Jython, and PyPy)
  • 支持太多的数据库后端(PostgreSQL, MySQL, SQLite, and Oracle)
  • 支持太多的操作系统。。。

为了把全部的测试范围都覆盖,明显需要非常多的机器,即使是虚拟机,也需要很多。。


After a bunch of playing with these requirements, I sketched out a dream system that looked something like this:

We’ve got a bunch of (dormant) VM images for a cloud computing service or platform.
Each image “knows” which kinds of configs it can build. For example, one image might have Python 2.4 and SQLite, while another might have Python 2.7 and PostgreSQL 9.0.
When new requests are made the build master spins up some VMs, hands them build jobs (based on the types of builds the VM can support).
When no more builds are in the queue for a particular VM, the build master shuts down the image and saves us money.

Jacobian针对Django系统的需要做了一个列表,如上。
但当时没有任何系统能够完成需要,buildbot也无能为力。

J只好自己动手,根据buildbot提供的功能集,hack出了一个系统。

J通篇强调一点:buildbot不是一个CI系统,而是一个CI框架,提供了很多的基础功能,但并不是一个完整的解决方案,而是需要自己来根据需要定制。

另,附上一份buildbot自己的bot的配置代码库:
https://github.com/buildbot/metabbotcfg

原文地址:https://www.cnblogs.com/morya/p/4284064.html