Django Infrastructure @ UGent
Kevin Van Wilder
Why We Set Up the Django Infrastructure
As an Alternative to Plomino
● Rapid application development
● yet Reliable, Maintainable, Scaleable
● Better at Handling Large Loads
● Seperate Applications from Portal Site
Source Code Infrastructure
Git Repositories
Each project has 2 repositories
● site-<projectname>.git
○ Django Source Code
○ Business Logic of the application
● pkg-<projectname>.git
○ Debian Package Source Code
○ Installation Logic of the application
Each repository has a specific code structure.
○ Why? Automation!
Git Flow
http://nvie.com/posts/a-successful-git-branching-model/
Server Infrastructure
Load Balancer
djprd
Web + App
djprd1
Web + App
djprd2
...
DB
Overview Production Infrastructure
Managed by
Developers
Managed by Jenkins Pipeline & Puppet
Load Balancer
djprd
Web + App
djprd1
Web + App
djprd2
DB
framboo
s
Load Balancer
djqas
Web + App
djqas1
Web + App
djqas2
Web + App
djtst1
Web + App
djdev1
Complete Infrastructure
“Web + App” Servers
Puppetized
Continuous Deployment via Jenkins
Each server contains all the apps
Load Balanced
Database
framboos.ugent.be
Maar migratiemogelijkheden naar:
● PostgreSQL
● MySQL
● SQLite
● Oracle
Support Tools
Version Overview
Supporting Tools
Supporting Tools
Other Tools
Ansible
Maintenance Task Orchestration
● db syncs
● process restarts
● etc
Continuous Deployment Pipeline
Jenkins
Project Specific
Buildsteps
Project Independent Buildsteps
Build Unit Test
Acceptance
Test
Package Deploy TST
Deploy QAS
Deploy PRD
Onderwijstips
Kwalifacts
Telefoonboek
UGent Mobile
Abstract Jenkins Pipeline
Abstract Jenkins Pipeline
Build
Unit Test
Acceptance
Test
Package
Deploy TST
Deploy QAS
Deploy PRD
Start Project
Build The only part of the pipeline that is specific to a project
Starts execution of the pipeline
Calls the “Build” job with the project-specific parameters:
PROJECT_NAME
PACKAGE_NAME
To add a new project pipeline, simply...
Duplicate this job
Change the values of the parameters
Abstract Jenkins Pipeline
Build
Unit Test
Acceptance
Test
Package
Deploy TST
Deploy QAS
Deploy PRD
Start Project
Build
Build
Clones the Git code for the web application
Unit Test
Finds all the written unit tests and executes them
Acceptance Test
Currently not yet implemented.
Finds all the written acceptance tests and executes them
Package
Clones the Git code for the debian package
Copies over the tested source code
Builds a Debian Package
Abstract Jenkins Pipeline
Package
Deploy TST
Deploy QAS
Deploy PRD
Start Project
Build
Deploy TST
Built packages are automatically deployed to Testing
Deploy QAS
Manual trigger for deployment to Quality Assurance
Can only be triggered if successful deploy to TST
Deploy PRD
Manual trigger for deployment to Production
Can only be triggered if successful deploy to QAS
Build
Unit Test
Acceptance
Test
Future
Future
Asynchronous Messaging (RabbitMQ)
Caching
Response Caching (Varnish)
Low-Level Caching (Memcached)
Acceptance Testing (Selenium)
Seperate database for each environment
More Monitoring (Graphite)
Kevin Van Wilder
@KevinVanWilder
Open Source Consultant
INUITS
Duboisstraat 50 - 2060 Antwerp
http://www.inuits.eu
QUESTIONS ?

UGent Django Infrastructure