Skip to content

Latest commit

History

67 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

infrastructure-deploy

The idea of the project is to create full-stack exampleproject to share with community knowledge and vision how can be CI infrastructure be developt (from scratch) for medium/big size open/closed/hybrid source projects.

Our vision of good CI-infrastructure or the values of our project:

  • Invest now to have provit in the long-term
  • Infrastructure as a service
  • Flexibility to change
  • Easy to support
  • Modularity of infrastructure. Each part of our CI-project can be changed with another "block" with no ir minimal investment.
  • Python as one and only language
  • Maximum re-use of public supported tools and frameworks

Table of analyzed and used software

DomainProductProsConsComment
CIBuildbotMore freedom and power
No UI to configure
Higher costs at the start
No sub-service to collect artifacts
Open Source
TeamCity
JenkinsOpen Source
Travis CIFree for Open Source
Is a service

Only for Github-hosted repositories
VirtualizationQEMU
Docker
VMWareEasy to useHigh cost
Open VZ

Effective resource management

Only for linux
KVM

Win/Lin

Effective and usefull

Need knowledge about Unix systems
Xen

Win/Lin

Good optimization

Open source

LXC

Linux

Very effective in small builds

Not for Windows
ProvisioningAnsibledoes not require installation of agents on managed nodes; ow threshold of entry; Modules can be written in almost any language;The web interface allows you to customize users, teams and equipment, use scripts; script language is pretty simple;Installing Python version 2.4 or higher; good documentation;Lacked client support for Windows The web interface is not automatically linked to an existing Ansible installation;
TBD
"Frontend"
(repository, issues tracker,
communication, review,
collaboration)
GitHubStandart de-facto
GitlabMore features as in GithubOn Windows does not use pure Windows env (Cygwin)
Gerrit + JiraOutdated. Poor social features.
Web ServerNGNXDocumentation and support
Modularity
Centralized configuration
Administrators are responsible for security
Has proxy server
Processes only static contentWill be used for artifacts sharing. Link: https://stackshare.io/stackups/apache-httpd-vs-microsoft-iis-vs-nginx
ApacheDocumentation and support
Modularity
Distributed configuration
Processes dynamic and static content
Distributed configuration
Users are responsible for security
MonitoringZabbix

Active community support

Good documentation

SNMP

Agents

1 database

Web UI can not be expanded

Icinga 2compatible with Nagios, easy to integrate, parallel processessometimes need to develop your own modules, poor documentation, complex for small systems
Build SystemTBD
Test SystemRobot Framework
Self-written
TBD

On host OS (Ubuntu 18.04)

  • Install host OS manually on your machine
sudo apt-get install openssh-server mc net-tools nginx screen
sudo apt install python3-pip
# take nginx configuration from our repository
# you can read more about nginx configuration here: http://docs.buildbot.net/current/manual/configuration/www.html?highlight=proxy#reverse-proxy-configuration
sudo nano /etc/nginx/nginx.conf
service nginx restart
# Add new user
sudo adduser infra-deploy #without adding to sudoers
users #check list of users
  • Install QEMU which will be used for virtualization
sudo apt-get install qemu-kvm qemu virt-manager virt-viewer libvirt-bin

Installation of Ansible on Ubuntu host

Install Ansible:

sudo apt-get update
sudo apt-get install software-properties-common
sudo apt-add-repository --yes --update ppa:ansible/ansible
sudo apt-get install ansible

Test Ansible installation:

# Run this by name this file hello_world.yml and run the following in the same directory
# ansible-playbook hello_world.yml -i 'local,' --connection=local
- hosts:
- local
tasks:
- name: Hello World!
shell: echo "Hi! Ansible is working."
- name: Create a directory
file: path=hello_world state=directory

On virtual machines

Install packages:

# General packages
sudo apt-get install python3-pip git
sudo apt-get install mc htop
# Buildbot packages
# On master
sudo pip3 install buildbot==1.5 buildbot-console-view==1.5 buildbot-www==1.5
# On worker
sudo pip3 install buildbot-worker==1.5
sudo pip3 install gitpython==2.1.5 tenacity==4.5.0 txrequests txgithub service_identity

Create Buildbot master (on VM for master):

buildbot create-master master

Add auto load of master:

#copy buildbot-master.service file to the machine https://github.com/GoAlexander/infrastructure-deploy/tree/master/etc/systemd/system
sudo systemctl restart buildbot-master
#check status
sudo systemctl status buildbot-master
#if all is ok enable unit
sudo systemctl enable buildbot-master

Create Buildbot worker (on VM for worker):

buildbot-worker create-worker --umask=0o2 "worker" "192.168.122.157:9000" "your_worker_name" "your_worker_pass"

Credits

Big thanks for the ideas, support and inspiration to:

  • Alexander Zhogov
  • Oleg Makarov
  • Eugeny Ponomarev
  • Dmitry Lobanov

About

Create modular, scalable CI infrastructure based on Buildbot

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages