24
Django Infrastructure @ UGent Kevin Van Wilder

UGent Django Infrastructure

  • Upload
    kevinvw

  • View
    150

  • Download
    2

Embed Size (px)

Citation preview

Page 1: UGent Django Infrastructure

Django Infrastructure @ UGentKevin Van Wilder

Page 2: UGent Django Infrastructure

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

Page 3: UGent Django Infrastructure

Source Code Infrastructure

Page 4: UGent Django 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!

Page 5: UGent Django Infrastructure

Git Flow

http://nvie.com/posts/a-successful-git-branching-model/

Page 6: UGent Django Infrastructure

Server Infrastructure

Page 7: UGent Django Infrastructure

Load Balancerdjprd

Web + Appdjprd1

Web + Appdjprd2

...

DB

Overview Production Infrastructure

Page 8: UGent Django Infrastructure

Managed by Developers

Managed by Jenkins Pipeline & Puppet

Load Balancerdjprd

Web + Appdjprd1

Web + Appdjprd2

DBframboo

s

Load Balancerdjqas

Web + Appdjqas1

Web + Appdjqas2

Web + Appdjtst1

Web + Appdjdev1

Complete Infrastructure

Page 9: UGent Django Infrastructure

“Web + App” Servers

PuppetizedContinuous Deployment via JenkinsEach server contains all the appsLoad Balanced

Page 10: UGent Django Infrastructure

Database

framboos.ugent.beMaar migratiemogelijkheden naar:● PostgreSQL● MySQL● SQLite● Oracle

Page 11: UGent Django Infrastructure

Support Tools

Page 12: UGent Django Infrastructure

Version Overview

Page 13: UGent Django Infrastructure

Supporting Tools

Page 14: UGent Django Infrastructure

Supporting Tools

Page 15: UGent Django Infrastructure

Other Tools

AnsibleMaintenance Task Orchestration● db syncs● process restarts● etc

Page 16: UGent Django Infrastructure

Continuous Deployment Pipeline

Page 17: UGent Django Infrastructure

Jenkins

Page 18: UGent Django Infrastructure

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

Page 19: UGent Django Infrastructure

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

Page 20: UGent Django Infrastructure

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

Page 21: UGent Django Infrastructure

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

Page 22: UGent Django Infrastructure

Future

Page 23: UGent Django Infrastructure

Future

Asynchronous Messaging (RabbitMQ)Caching

Response Caching (Varnish)Low-Level Caching (Memcached)

Acceptance Testing (Selenium)Seperate database for each environmentMore Monitoring (Graphite)

Page 24: UGent Django Infrastructure

Kevin Van Wilder@KevinVanWilderOpen Source Consultant

INUITSDuboisstraat 50 - 2060 Antwerphttp://www.inuits.eu

QUESTIONS ?