Deployment and Continous Integration of a Zope/Plone application
Upcoming SlideShare
Loading in...5
×
 

Deployment and Continous Integration of a Zope/Plone application

on

  • 1,197 views

Conference given at PyconFR'13

Conference given at PyconFR'13

Statistics

Views

Total Views
1,197
Views on SlideShare
1,144
Embed Views
53

Actions

Likes
4
Downloads
21
Comments
2

4 Embeds 53

http://www.ivanteoh.com 31
https://twitter.com 14
http://localhost 6
https://www.rebelmouse.com 2

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

CC Attribution-ShareAlike LicenseCC Attribution-ShareAlike License

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Deployment and Continous Integration of a Zope/Plone application Deployment and Continous Integration of a Zope/Plone application Presentation Transcript

  • Deployment & Continuous integration of a Plone/Zope application Julien Pivotto PyconFR’13 October 26, 2013 ;
  • whoami sysadmin @ inuits • open-source defender for 7+ years • devops believer • @roidelapluie on twitter/github • Julien Pivotto Deployment and CI of a Plone/Zope application ;
  • • • • Plone is an Open-Source CMS Written in python Vibrant community Julien Pivotto Deployment and CI of a Plone/Zope application ;
  • • • • Open-Source Web application server Written in Python Used by Plone Julien Pivotto Deployment and CI of a Plone/Zope application ;
  • Plone/Zope application • • • Threads = instances Built using Buildout Modules (eggs) Julien Pivotto Deployment and CI of a Plone/Zope application ;
  • The mission • • • • Several Zope/Plone applications Scalability Automation Reliability Julien Pivotto Deployment and CI of a Plone/Zope application ;
  • The old days • • • • Manual work Failover HA Supervisord No overview Julien Pivotto Deployment and CI of a Plone/Zope application ;
  • BUT Run buildout on each server/environment • Compilation error in the middle • Pypi is down • Which commit is faulty? • Julien Pivotto Deployment and CI of a Plone/Zope application ;
  • The goal • • • • • Less failure during builds More testing Puppetize all the things Reproduce all the builds More env: dev, test, demo, prod Julien Pivotto Deployment and CI of a Plone/Zope application ;
  • Infrastructure changes • DRBD for PostgreSQL ⇒ PostgreSQL 9 native replication • DRBD for files ⇒ GlusterFS for data, RPM for code • Supervisord to launch instances ⇒ Puppet to start services • Pound as reverse proxy ⇒ Haproxy • Internal mirror of pypi Julien Pivotto Deployment and CI of a Plone/Zope application ;
  • Puppetization • • • • From nothing to everything Plone, but also apache, haproxy . . . and anything else Mcollective to orchestrate Julien Pivotto Deployment and CI of a Plone/Zope application ;
  • Development decisions • • • Move away from SVN Write tests Automate them in Jenkins Julien Pivotto Deployment and CI of a Plone/Zope application ;
  • It takes time • • • • Cultural shift Legacy stuff A lot of surprises Compromises between Dev and Ops Julien Pivotto Deployment and CI of a Plone/Zope application ;
  • Jenkins • • • • An open-source CI server More than 600 plugins Flexible Jobs & pipelines Julien Pivotto Deployment and CI of a Plone/Zope application ;
  • Julien Pivotto Deployment and CI of a Plone/Zope application ;
  • Jobs • • • • Reproducible builds Single place to find build logs History of builds Creating (RPM) artifacts Julien Pivotto Deployment and CI of a Plone/Zope application ;
  • Pipeline • • • Build is only part of the process Need to package, deploy, . . . Running tests Julien Pivotto Deployment and CI of a Plone/Zope application ;
  • Tests • • • • • • Running tests on each module Feedback: graphes, mails Code coverage Violations Unit tests zc.recipe.testrunner Julien Pivotto Deployment and CI of a Plone/Zope application ;
  • Translation in Jobs virtualenv --no-site-packages . bin/python bootstrap.py bin/buildout -c jenkins.cfg buildout:eggs-directory= /var/lib/jenkins/buildout-shared-eggs bin/test-all Julien Pivotto Deployment and CI of a Plone/Zope application ;
  • Julien Pivotto Deployment and CI of a Plone/Zope application ;
  • Buildout • • • • Running buildout in a Spec file Creating a RPM Using virtualenv Starting from scratch each time Julien Pivotto Deployment and CI of a Plone/Zope application ;
  • Ops like RPM • • • • • • Easy to deploy anywhere Consistency and dependencies Find where a file comes from Orchestrate with puppet/mcollective Version number Conf does not belong to package Julien Pivotto Deployment and CI of a Plone/Zope application ;
  • Time Julien Pivotto Deployment and CI of a Plone/Zope application ;
  • Deploying Zope • • • • • Building RPM Adding them to a yum repo (with pulp) Cleaning yum cache (with mcollective) Running puppet (with mcollective) dev -> staging -> demo and prod Julien Pivotto Deployment and CI of a Plone/Zope application ;
  • Reports • • • • Jenkins build log Puppet logs Zope instances logs IRC, mails, . . . Julien Pivotto Deployment and CI of a Plone/Zope application ;
  • Role of Puppet • • • • Puppet creates the configuration Update the package Restarts the instances Puppet (hiera) creates password files Julien Pivotto Deployment and CI of a Plone/Zope application ;
  • Database upgrades • • • WIP, no solution chosen yet Postscript in RPM? Commands trigerred by puppet? Julien Pivotto Deployment and CI of a Plone/Zope application ;
  • Logs Zope/Plone: logs files/instances • 10 instances * 2 servers ⇒ 20 log files • Plus apache logs • Plus system logs • Julien Pivotto Deployment and CI of a Plone/Zope application ;
  • The deprecated way • • • tail -f multitail clusterssh Julien Pivotto Deployment and CI of a Plone/Zope application ;
  • Logstash • • • • • An open source tool Manage your logs Input from anywhere Filter Output to anywhere Julien Pivotto Deployment and CI of a Plone/Zope application ;
  • Logstash Julien Pivotto Deployment and CI of a Plone/Zope application ;
  • Plone and Logstash • • • • Plone output to syslog Mangle to add good fields Logstash output to ElasticSearch Kibana3 creates dashboards Julien Pivotto Deployment and CI of a Plone/Zope application ;
  • zope.conf <syslog> address 172.16.28.55:5544 facility local3 format %(asctime)s ZopApp-Server zope[%(process)s]: instance1 [%(levelname)s] %(name)s | %(message)s dateformat %b %d %H:%M:%S level info </syslog> Julien Pivotto Deployment and CI of a Plone/Zope application ;
  • filter { grok { type => "syslog" pattern => ["(?m)<%= "<%" %>{POSINT:syslog_pri}> %{SYSLOGTIMESTAMP:syslog_timestamp} %{SYSLOGHOST:syslog_hostname} %{DATA:syslog_program} (?:[%{POSINT:syslog_pid}])?: %{GREEDYDATA:syslog_message}"] add_field => [ "received_at", "%{@timestamp}" ] add_field => [ "received_from", "%{@source_host}" ] add_tag => "syslog-%{syslog_program}" } } Julien Pivotto Deployment and CI of a Plone/Zope application ;
  • frametitle{zope.conf} filter { grok { tags => ["syslog-zope"] pattern => ["(?m)(?<instance>[a-z0-9]+) [(?<loglevel>[A-Z]+)] (?<loggername>[A-Za-z0-9.]+) | %{GREEDYDATA:logmessage}"] add_tag => "grokked-zope" } mutate { tags => ["grokked-zope"] rename => [ "@source_host", "application" ] replace => [ "@message", "%{logmessage}" ] add_tag => "loggername-%{loggername}" } } Julien Pivotto Deployment and CI of a Plone/Zope application ;
  • Kibana3 • • • • • Plays with ElasticSearch and Logstash Easily build dashboards Share the metric and logs with anyone Filter by time, instance, http code. . . View all the logs at the same place Julien Pivotto Deployment and CI of a Plone/Zope application ;
  • Julien Pivotto Deployment and CI of a Plone/Zope application ;
  • Conclusions This is a sysadmin point of view • Still a lot of work to be done • From a "black box" . . . To a fully automated environment • Not a unique solution • You need to get it working for you . . . in your way • Julien Pivotto Deployment and CI of a Plone/Zope application ;
  • This work is being realized with Affinitic SPRL, Plone developers in Belgium http://affinitic.be Julien Pivotto Deployment and CI of a Plone/Zope application ;
  • Thank you Any question? Julien Pivotto Deployment and CI of a Plone/Zope application ;
  • Contact Julien Pivotto julien@inuits.eu @roidelapluie INUITS bvba INUITS bvba Belgium Belgium +32 473 441 636 +32 473 441 636 https://inuits.eu https://inuits.eu Julien Pivotto Deployment and CI of a Plone/Zope application ;