SlideShare una empresa de Scribd logo
1 de 13
Descargar para leer sin conexión
zc.buildout
ricardo newbery
ric@ncryptedcloud.com
a presentation given in november 2013
Donetsk, Ukraine

Sunday, January 5, 14
the problem
• Need a process to build the application
stack, including all dependencies.

• Requirements:
• repeatable and possible to automate
• concise and easy to understand/modify
• not just Python!
Sunday, January 5, 14
alternatives
• app-get, yum, homebrew, etc.
• make, rake, paver, minitage, etc.
• puppet, chef, ansible salt, etc.
• virtualenv
• pip install -r requirements.txt
• fabric
Sunday, January 5, 14
what is buildout?
The Buildout project (zc.buildout) provides support for creating
applications. It provides tools for assembling applications from
multiple parts, Python or otherwise. An application may actually
contain multiple programs, processes, and configuration settings.
The word "buildout" refers to a description of a set of parts and the
software to create and assemble them. It is often used informally to
refer to an installed system based on a buildout definition.
For example, if we are creating an application named "Foo", then
"the Foo buildout" is the collection of configuration and applicationspecific software that allows an instance of the application to be
created. We may refer to such an instance of the application
informally as "a Foo buildout"

Sunday, January 5, 14
buildout benefits
•
•

Centralized specification of the major
dependencies of the software stack, both
Python and non-Python

•

Sunday, January 5, 14

An automated and simple process to build and
maintain a consistent software stack across all
environments (dev/qa/staging/production)

Centralized specification of the configuration
parameters and scripts that define a stack build
a barebones buildout
Two files:
- buildout.cfg
- bootstrap.py
Running the bootstrap script grabs the
zc.buildout library and some minimal
dependencies and creates a “bin/buildout”
script.

Sunday, January 5, 14
buildout.cfg
[buildout]
parts = mydjango
[mydjango]
recipe = zc.recipe.egg
egg = Django

Sunday, January 5, 14
variable interpolation
[buildout]
parts = mydjango
eggs = django
[mydjango]
recipe = zc.recipe.egg
egg = ${buildout:eggs}

Sunday, January 5, 14
extends
(buildout.cfg)

(varnish.cfg)

[buildout]
extends = varnish.cfg
parts += mydjango
eggs =
Django
Pillow

[buildout]
parts = myvarnish

[mydjango]
recipe = zc.recipe.egg
egg = ${buildout:eggs}

Sunday, January 5, 14

[myvarnish]
recipe = zc.recipe.varnish
url = http://...varnish.tar.gz
basic recipes
•
•

collective.recipe.template
Generate a text file from a template
http://pypi.python.org/pypi/collective.recipe.template

•

collective.recipe.cmd
Execute a command line
http://pypi.python.org/pypi/collective.recipe.cmd

•

zc.recipe.cmmi
hexagonit.recipe.cmmi
Two different recipes to download and build a package using configure/make/make-install
http://pypi.python.org/pypi/zc.recipe.cmmi
http://pypi.python.org/pypi/hexagonit.recipe.cmmi

•

Sunday, January 5, 14

zc.recipe.egg
Install Python package distributions as eggs
http://pypi.python.org/pypi/zc.recipe.egg

mr.scripty
Use python to write configuration
http://pypi.python.org/pypi/mr.scripty
more recipes
•

•

mr.developer
A zc.buildout extension to ease the development of projects with multiple packages. Provides some
configuration sugar and scripts to maintain multiple source-controlled packages within a single
buildout.
http://pypi.python.org/pypi/zc.recipe.egg

•

collective.recipe.environment
A zc.buildout recipe to set or look up environment variables
http://pypi.python.org/pypi/collective.recipe.environment

•

cns.recipe.symlink
A zc.buildout recipe to create symlinks (could do the same with collective.recipe.cmd)
http://pypi.python.org/pypi/cns.recipe.symlink

•

Sunday, January 5, 14

collective.recipe.omelette
A zc.buildout recipe to create a unified directory structure of installed packages, symlinking to the
actual contents, in order to ease navigation and developer inspection.
http://pypi.python.org/pypi/collective.recipe.omelette

z3c.recipe.mkdir
A zc.buildout recipe to create directories (could do the same with collective.recipe.cmd)
http://pypi.python.org/pypi/z3c.recipe.mkdir
keep it simple
There are too many buildout recipes out there (850+ on pypi alone!)
Avoid the temptation to create yet another recipe when you can do the same operation by just stringing together
a few of the basic recipes.
For example, these two are functionally equivalent but the one on the right avoids adding yet another abstraction
layer between the semantics of the buildout configuration and the varnish configuration:
[varnish]
recipe = zc.recipe.cmmi
url = ${urls:varnish}

[varnish]
recipe = zc.recipe.cmmi
url = ${urls:varnish}

[varnish-recipe]
recipe = plone.recipe.varnish
daemon = ${varnish:location}/sbin/varnishd
bind = 127.0.0.1:8000
backends = 127.0.0.1:8080
cache-size = 256M

[varnish-config]
recipe = collective.recipe.template
path = etc/varnish.vcl
input = templates/${:path}.in
output = ${buildout:directory}/${:path}
[varnish-runner]
recipe = collective.recipe.template
input = inline:
#!/bin/sh
exec ${varnish:location}/sbin/varnishd 
-f "${varnish-config:output}" 
-P "${buildout:directory}/var/varnish.pid" 
-a 0.0.0.0:${global:varnish-port} 
-s file,"${buildout:directory}/var/
varnish_storage",1G "$@"
output = ${buildout:directory}/bin/varnishd
mode = 755

Sunday, January 5, 14
more...
• http://en.wikipedia.org/wiki/Buildout
• http://pypi.python.org/pypi/zc.buildout
• http://www.buildout.org/

Sunday, January 5, 14

Más contenido relacionado

La actualidad más candente

Capistrano deploy Magento project in an efficient way
Capistrano deploy Magento project in an efficient wayCapistrano deploy Magento project in an efficient way
Capistrano deploy Magento project in an efficient waySylvain Rayé
 
Grunt: the wild boar dev's best friend - WordCamp London 2018
Grunt: the wild boar dev's best friend - WordCamp London 2018Grunt: the wild boar dev's best friend - WordCamp London 2018
Grunt: the wild boar dev's best friend - WordCamp London 2018Marco Chiesi
 
Devenez le plus heureux des Front-end avec Gulp.js
Devenez le plus heureux des Front-end avec Gulp.jsDevenez le plus heureux des Front-end avec Gulp.js
Devenez le plus heureux des Front-end avec Gulp.jsRémy Savard
 
Terminus, the Pantheon command-line interface
Terminus, the Pantheon command-line interfaceTerminus, the Pantheon command-line interface
Terminus, the Pantheon command-line interfaceJon Peck
 
Virtualenv
VirtualenvVirtualenv
VirtualenvWEBdeBS
 
Introduction to puppet - Hands on Session at HPI Potsdam
Introduction to puppet - Hands on Session at HPI PotsdamIntroduction to puppet - Hands on Session at HPI Potsdam
Introduction to puppet - Hands on Session at HPI PotsdamChristoph Oelmüller
 
HTTPS + Let's Encrypt
HTTPS + Let's EncryptHTTPS + Let's Encrypt
HTTPS + Let's EncryptWalter Ebert
 
Docker e postgresql
Docker e postgresqlDocker e postgresql
Docker e postgresqlFernando Ike
 
Installing OpenCV 4 on Ubuntu 18.x
Installing OpenCV 4 on Ubuntu 18.xInstalling OpenCV 4 on Ubuntu 18.x
Installing OpenCV 4 on Ubuntu 18.xNader Karimi
 
Die .htaccess richtig nutzen
Die .htaccess richtig nutzenDie .htaccess richtig nutzen
Die .htaccess richtig nutzenWalter Ebert
 
Towards the perfect Drupal Dev Machine
Towards the perfect Drupal Dev MachineTowards the perfect Drupal Dev Machine
Towards the perfect Drupal Dev MachineKrimson
 
GDG Kraków - Intro to front-end automation using bower.js & grunt.js
GDG Kraków - Intro to front-end automation using bower.js & grunt.jsGDG Kraków - Intro to front-end automation using bower.js & grunt.js
GDG Kraków - Intro to front-end automation using bower.js & grunt.jsDominik Prokop
 
Arbeiten mit distribute, pip und virtualenv
Arbeiten mit distribute, pip und virtualenvArbeiten mit distribute, pip und virtualenv
Arbeiten mit distribute, pip und virtualenvMarkus Zapke-Gründemann
 
Sage 2 19_v5_busby
Sage 2 19_v5_busbySage 2 19_v5_busby
Sage 2 19_v5_busbyBen Busby
 
Docker deploy
Docker deployDocker deploy
Docker deployEric Ahn
 
Plone deployment made easy
Plone deployment made easyPlone deployment made easy
Plone deployment made easyKim Chee Leong
 

La actualidad más candente (20)

Capistrano deploy Magento project in an efficient way
Capistrano deploy Magento project in an efficient wayCapistrano deploy Magento project in an efficient way
Capistrano deploy Magento project in an efficient way
 
Grooscript gr8conf 2015
Grooscript gr8conf 2015Grooscript gr8conf 2015
Grooscript gr8conf 2015
 
Grooscript greach
Grooscript greachGrooscript greach
Grooscript greach
 
Grunt: the wild boar dev's best friend - WordCamp London 2018
Grunt: the wild boar dev's best friend - WordCamp London 2018Grunt: the wild boar dev's best friend - WordCamp London 2018
Grunt: the wild boar dev's best friend - WordCamp London 2018
 
Devenez le plus heureux des Front-end avec Gulp.js
Devenez le plus heureux des Front-end avec Gulp.jsDevenez le plus heureux des Front-end avec Gulp.js
Devenez le plus heureux des Front-end avec Gulp.js
 
Grunt All Day
Grunt All DayGrunt All Day
Grunt All Day
 
Terminus, the Pantheon command-line interface
Terminus, the Pantheon command-line interfaceTerminus, the Pantheon command-line interface
Terminus, the Pantheon command-line interface
 
Virtualenv
VirtualenvVirtualenv
Virtualenv
 
Grooscript and Grails 3
Grooscript and Grails 3Grooscript and Grails 3
Grooscript and Grails 3
 
Introduction to puppet - Hands on Session at HPI Potsdam
Introduction to puppet - Hands on Session at HPI PotsdamIntroduction to puppet - Hands on Session at HPI Potsdam
Introduction to puppet - Hands on Session at HPI Potsdam
 
HTTPS + Let's Encrypt
HTTPS + Let's EncryptHTTPS + Let's Encrypt
HTTPS + Let's Encrypt
 
Docker e postgresql
Docker e postgresqlDocker e postgresql
Docker e postgresql
 
Installing OpenCV 4 on Ubuntu 18.x
Installing OpenCV 4 on Ubuntu 18.xInstalling OpenCV 4 on Ubuntu 18.x
Installing OpenCV 4 on Ubuntu 18.x
 
Die .htaccess richtig nutzen
Die .htaccess richtig nutzenDie .htaccess richtig nutzen
Die .htaccess richtig nutzen
 
Towards the perfect Drupal Dev Machine
Towards the perfect Drupal Dev MachineTowards the perfect Drupal Dev Machine
Towards the perfect Drupal Dev Machine
 
GDG Kraków - Intro to front-end automation using bower.js & grunt.js
GDG Kraków - Intro to front-end automation using bower.js & grunt.jsGDG Kraków - Intro to front-end automation using bower.js & grunt.js
GDG Kraków - Intro to front-end automation using bower.js & grunt.js
 
Arbeiten mit distribute, pip und virtualenv
Arbeiten mit distribute, pip und virtualenvArbeiten mit distribute, pip und virtualenv
Arbeiten mit distribute, pip und virtualenv
 
Sage 2 19_v5_busby
Sage 2 19_v5_busbySage 2 19_v5_busby
Sage 2 19_v5_busby
 
Docker deploy
Docker deployDocker deploy
Docker deploy
 
Plone deployment made easy
Plone deployment made easyPlone deployment made easy
Plone deployment made easy
 

Destacado

ERPCX whitepaper virtual consulting 2011 1
ERPCX whitepaper virtual consulting 2011 1ERPCX whitepaper virtual consulting 2011 1
ERPCX whitepaper virtual consulting 2011 1Herbert Goertz
 
(Broken... use the other upload, same title) State of Plone Caching
(Broken... use the other upload, same title)  State of Plone Caching(Broken... use the other upload, same title)  State of Plone Caching
(Broken... use the other upload, same title) State of Plone CachingRicardo Newbery
 
Odoo(OpenERP)のご紹介 ~世界で人気No.1のオープンソースERP
Odoo(OpenERP)のご紹介 ~世界で人気No.1のオープンソースERPOdoo(OpenERP)のご紹介 ~世界で人気No.1のオープンソースERP
Odoo(OpenERP)のご紹介 ~世界で人気No.1のオープンソースERPYoshi Tashiro
 
What Is Social Media
What Is Social MediaWhat Is Social Media
What Is Social MediaThomas Martin
 
Socialcapital Socialmedia 090328095213 Phpapp01
Socialcapital Socialmedia 090328095213 Phpapp01Socialcapital Socialmedia 090328095213 Phpapp01
Socialcapital Socialmedia 090328095213 Phpapp01Hack the Hood
 
The Presence of Multiculturalism in General Music Textbooks: An Exploratory S...
The Presence of Multiculturalism in General Music Textbooks: An Exploratory S...The Presence of Multiculturalism in General Music Textbooks: An Exploratory S...
The Presence of Multiculturalism in General Music Textbooks: An Exploratory S...Antia G. Ben
 
2 2010 T M C Community Building Preso
2 2010  T M C Community Building Preso2 2010  T M C Community Building Preso
2 2010 T M C Community Building PresoHack the Hood
 
Digital Tv In Cee (2012)
Digital Tv In Cee (2012)Digital Tv In Cee (2012)
Digital Tv In Cee (2012)wimvermeulen
 
chem-story
chem-storychem-story
chem-storysmasemh
 
Status of accountability in online news media: A case of Nepal
Status of accountability in online news media: A case of NepalStatus of accountability in online news media: A case of Nepal
Status of accountability in online news media: A case of Nepalbbacharya
 
What can I do?
What can I do?What can I do?
What can I do?Martin Tae
 
Re&agri 2014 growing power exploring energy needs in smallholder agricultur...
Re&agri 2014   growing power exploring energy needs in smallholder agricultur...Re&agri 2014   growing power exploring energy needs in smallholder agricultur...
Re&agri 2014 growing power exploring energy needs in smallholder agricultur...Mohamed Larbi BEN YOUNES
 
March 6 building visibility for yr project
March 6 building visibility for yr projectMarch 6 building visibility for yr project
March 6 building visibility for yr projectHack the Hood
 

Destacado (20)

ERPCX whitepaper virtual consulting 2011 1
ERPCX whitepaper virtual consulting 2011 1ERPCX whitepaper virtual consulting 2011 1
ERPCX whitepaper virtual consulting 2011 1
 
State of Plone Caching
State of Plone CachingState of Plone Caching
State of Plone Caching
 
(Broken... use the other upload, same title) State of Plone Caching
(Broken... use the other upload, same title)  State of Plone Caching(Broken... use the other upload, same title)  State of Plone Caching
(Broken... use the other upload, same title) State of Plone Caching
 
nature17435
nature17435nature17435
nature17435
 
Odoo(OpenERP)のご紹介 ~世界で人気No.1のオープンソースERP
Odoo(OpenERP)のご紹介 ~世界で人気No.1のオープンソースERPOdoo(OpenERP)のご紹介 ~世界で人気No.1のオープンソースERP
Odoo(OpenERP)のご紹介 ~世界で人気No.1のオープンソースERP
 
What Is Social Media
What Is Social MediaWhat Is Social Media
What Is Social Media
 
Socialcapital Socialmedia 090328095213 Phpapp01
Socialcapital Socialmedia 090328095213 Phpapp01Socialcapital Socialmedia 090328095213 Phpapp01
Socialcapital Socialmedia 090328095213 Phpapp01
 
Mnenieto na givotnite
Mnenieto na givotniteMnenieto na givotnite
Mnenieto na givotnite
 
The Presence of Multiculturalism in General Music Textbooks: An Exploratory S...
The Presence of Multiculturalism in General Music Textbooks: An Exploratory S...The Presence of Multiculturalism in General Music Textbooks: An Exploratory S...
The Presence of Multiculturalism in General Music Textbooks: An Exploratory S...
 
2 2010 T M C Community Building Preso
2 2010  T M C Community Building Preso2 2010  T M C Community Building Preso
2 2010 T M C Community Building Preso
 
ANT
ANTANT
ANT
 
Digital Tv In Cee (2012)
Digital Tv In Cee (2012)Digital Tv In Cee (2012)
Digital Tv In Cee (2012)
 
chem-story
chem-storychem-story
chem-story
 
Deforestation 2
Deforestation 2Deforestation 2
Deforestation 2
 
Status of accountability in online news media: A case of Nepal
Status of accountability in online news media: A case of NepalStatus of accountability in online news media: A case of Nepal
Status of accountability in online news media: A case of Nepal
 
Our school
Our schoolOur school
Our school
 
What can I do?
What can I do?What can I do?
What can I do?
 
Buku rekod
Buku rekodBuku rekod
Buku rekod
 
Re&agri 2014 growing power exploring energy needs in smallholder agricultur...
Re&agri 2014   growing power exploring energy needs in smallholder agricultur...Re&agri 2014   growing power exploring energy needs in smallholder agricultur...
Re&agri 2014 growing power exploring energy needs in smallholder agricultur...
 
March 6 building visibility for yr project
March 6 building visibility for yr projectMarch 6 building visibility for yr project
March 6 building visibility for yr project
 

Similar a Introduction to zc.buildout

Marek Kuziel - Deploying Django with Buildout
Marek Kuziel - Deploying Django with BuildoutMarek Kuziel - Deploying Django with Buildout
Marek Kuziel - Deploying Django with Buildoutmarekkuziel
 
Princeton Wintersession: Software Quality Assurance Tooling
Princeton Wintersession: Software Quality Assurance ToolingPrinceton Wintersession: Software Quality Assurance Tooling
Princeton Wintersession: Software Quality Assurance ToolingHenry Schreiner
 
Django dev-env-my-way
Django dev-env-my-wayDjango dev-env-my-way
Django dev-env-my-wayRobert Lujo
 
Using Buildout to Develop and Deploy Python Projects
Using Buildout to Develop and Deploy Python ProjectsUsing Buildout to Develop and Deploy Python Projects
Using Buildout to Develop and Deploy Python ProjectsClayton Parker
 
Speed up your development environment PHP + Nginx + Fedora + PG
Speed up your development environment PHP + Nginx + Fedora + PGSpeed up your development environment PHP + Nginx + Fedora + PG
Speed up your development environment PHP + Nginx + Fedora + PGMarcus Sá
 
Software Quality Assurance Tooling - Wintersession 2024
Software Quality Assurance Tooling - Wintersession 2024Software Quality Assurance Tooling - Wintersession 2024
Software Quality Assurance Tooling - Wintersession 2024Henry Schreiner
 
Deploying software at Scale
Deploying software at ScaleDeploying software at Scale
Deploying software at ScaleKris Buytaert
 
ASP.NET 5 on the Raspberry PI 2
ASP.NET 5 on the Raspberry PI 2ASP.NET 5 on the Raspberry PI 2
ASP.NET 5 on the Raspberry PI 2Jürgen Gutsch
 
Towards Continuous Deployment with Django
Towards Continuous Deployment with DjangoTowards Continuous Deployment with Django
Towards Continuous Deployment with DjangoRoger Barnes
 
Autotests introduction - Codeception + PHP Basics
Autotests introduction - Codeception + PHP BasicsAutotests introduction - Codeception + PHP Basics
Autotests introduction - Codeception + PHP BasicsArtur Babyuk
 
Opps I deployed it again-ploneconf2010
Opps I deployed it again-ploneconf2010Opps I deployed it again-ploneconf2010
Opps I deployed it again-ploneconf2010Dylan Jay
 
Continuous Delivery w projekcie Open Source - Marcin Stachniuk - DevCrowd 2017
Continuous Delivery w projekcie Open Source - Marcin Stachniuk - DevCrowd 2017Continuous Delivery w projekcie Open Source - Marcin Stachniuk - DevCrowd 2017
Continuous Delivery w projekcie Open Source - Marcin Stachniuk - DevCrowd 2017MarcinStachniuk
 
Modern Development Tools
Modern Development ToolsModern Development Tools
Modern Development ToolsYe Maw
 
Grunt.js and Yeoman, Continous Integration
Grunt.js and Yeoman, Continous IntegrationGrunt.js and Yeoman, Continous Integration
Grunt.js and Yeoman, Continous IntegrationDavid Amend
 
Open source projects with python
Open source projects with pythonOpen source projects with python
Open source projects with pythonroskakori
 
Arbeiten mit distribute, pip und virtualenv
Arbeiten mit distribute, pip und virtualenvArbeiten mit distribute, pip und virtualenv
Arbeiten mit distribute, pip und virtualenvMarkus Zapke-Gründemann
 
JLPDevs - Optimization Tooling for Modern Web App Development
JLPDevs - Optimization Tooling for Modern Web App DevelopmentJLPDevs - Optimization Tooling for Modern Web App Development
JLPDevs - Optimization Tooling for Modern Web App DevelopmentJLP Community
 
Django Architecture Introduction
Django Architecture IntroductionDjango Architecture Introduction
Django Architecture IntroductionHaiqi Chen
 
Fun with Jenkins & Salesforce
Fun with Jenkins & SalesforceFun with Jenkins & Salesforce
Fun with Jenkins & SalesforceAbhinav Gupta
 

Similar a Introduction to zc.buildout (20)

Marek Kuziel - Deploying Django with Buildout
Marek Kuziel - Deploying Django with BuildoutMarek Kuziel - Deploying Django with Buildout
Marek Kuziel - Deploying Django with Buildout
 
Princeton Wintersession: Software Quality Assurance Tooling
Princeton Wintersession: Software Quality Assurance ToolingPrinceton Wintersession: Software Quality Assurance Tooling
Princeton Wintersession: Software Quality Assurance Tooling
 
Django dev-env-my-way
Django dev-env-my-wayDjango dev-env-my-way
Django dev-env-my-way
 
Using Buildout to Develop and Deploy Python Projects
Using Buildout to Develop and Deploy Python ProjectsUsing Buildout to Develop and Deploy Python Projects
Using Buildout to Develop and Deploy Python Projects
 
Speed up your development environment PHP + Nginx + Fedora + PG
Speed up your development environment PHP + Nginx + Fedora + PGSpeed up your development environment PHP + Nginx + Fedora + PG
Speed up your development environment PHP + Nginx + Fedora + PG
 
Software Quality Assurance Tooling - Wintersession 2024
Software Quality Assurance Tooling - Wintersession 2024Software Quality Assurance Tooling - Wintersession 2024
Software Quality Assurance Tooling - Wintersession 2024
 
Deploying software at Scale
Deploying software at ScaleDeploying software at Scale
Deploying software at Scale
 
ASP.NET 5 on the Raspberry PI 2
ASP.NET 5 on the Raspberry PI 2ASP.NET 5 on the Raspberry PI 2
ASP.NET 5 on the Raspberry PI 2
 
Towards Continuous Deployment with Django
Towards Continuous Deployment with DjangoTowards Continuous Deployment with Django
Towards Continuous Deployment with Django
 
Autotests introduction - Codeception + PHP Basics
Autotests introduction - Codeception + PHP BasicsAutotests introduction - Codeception + PHP Basics
Autotests introduction - Codeception + PHP Basics
 
Opps I deployed it again-ploneconf2010
Opps I deployed it again-ploneconf2010Opps I deployed it again-ploneconf2010
Opps I deployed it again-ploneconf2010
 
Continuous Delivery w projekcie Open Source - Marcin Stachniuk - DevCrowd 2017
Continuous Delivery w projekcie Open Source - Marcin Stachniuk - DevCrowd 2017Continuous Delivery w projekcie Open Source - Marcin Stachniuk - DevCrowd 2017
Continuous Delivery w projekcie Open Source - Marcin Stachniuk - DevCrowd 2017
 
Modern Development Tools
Modern Development ToolsModern Development Tools
Modern Development Tools
 
Grunt.js and Yeoman, Continous Integration
Grunt.js and Yeoman, Continous IntegrationGrunt.js and Yeoman, Continous Integration
Grunt.js and Yeoman, Continous Integration
 
Python Projects at Neova
Python Projects at NeovaPython Projects at Neova
Python Projects at Neova
 
Open source projects with python
Open source projects with pythonOpen source projects with python
Open source projects with python
 
Arbeiten mit distribute, pip und virtualenv
Arbeiten mit distribute, pip und virtualenvArbeiten mit distribute, pip und virtualenv
Arbeiten mit distribute, pip und virtualenv
 
JLPDevs - Optimization Tooling for Modern Web App Development
JLPDevs - Optimization Tooling for Modern Web App DevelopmentJLPDevs - Optimization Tooling for Modern Web App Development
JLPDevs - Optimization Tooling for Modern Web App Development
 
Django Architecture Introduction
Django Architecture IntroductionDjango Architecture Introduction
Django Architecture Introduction
 
Fun with Jenkins & Salesforce
Fun with Jenkins & SalesforceFun with Jenkins & Salesforce
Fun with Jenkins & Salesforce
 

Último

Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 

Último (20)

Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 

Introduction to zc.buildout

  • 1. zc.buildout ricardo newbery ric@ncryptedcloud.com a presentation given in november 2013 Donetsk, Ukraine Sunday, January 5, 14
  • 2. the problem • Need a process to build the application stack, including all dependencies. • Requirements: • repeatable and possible to automate • concise and easy to understand/modify • not just Python! Sunday, January 5, 14
  • 3. alternatives • app-get, yum, homebrew, etc. • make, rake, paver, minitage, etc. • puppet, chef, ansible salt, etc. • virtualenv • pip install -r requirements.txt • fabric Sunday, January 5, 14
  • 4. what is buildout? The Buildout project (zc.buildout) provides support for creating applications. It provides tools for assembling applications from multiple parts, Python or otherwise. An application may actually contain multiple programs, processes, and configuration settings. The word "buildout" refers to a description of a set of parts and the software to create and assemble them. It is often used informally to refer to an installed system based on a buildout definition. For example, if we are creating an application named "Foo", then "the Foo buildout" is the collection of configuration and applicationspecific software that allows an instance of the application to be created. We may refer to such an instance of the application informally as "a Foo buildout" Sunday, January 5, 14
  • 5. buildout benefits • • Centralized specification of the major dependencies of the software stack, both Python and non-Python • Sunday, January 5, 14 An automated and simple process to build and maintain a consistent software stack across all environments (dev/qa/staging/production) Centralized specification of the configuration parameters and scripts that define a stack build
  • 6. a barebones buildout Two files: - buildout.cfg - bootstrap.py Running the bootstrap script grabs the zc.buildout library and some minimal dependencies and creates a “bin/buildout” script. Sunday, January 5, 14
  • 7. buildout.cfg [buildout] parts = mydjango [mydjango] recipe = zc.recipe.egg egg = Django Sunday, January 5, 14
  • 8. variable interpolation [buildout] parts = mydjango eggs = django [mydjango] recipe = zc.recipe.egg egg = ${buildout:eggs} Sunday, January 5, 14
  • 9. extends (buildout.cfg) (varnish.cfg) [buildout] extends = varnish.cfg parts += mydjango eggs = Django Pillow [buildout] parts = myvarnish [mydjango] recipe = zc.recipe.egg egg = ${buildout:eggs} Sunday, January 5, 14 [myvarnish] recipe = zc.recipe.varnish url = http://...varnish.tar.gz
  • 10. basic recipes • • collective.recipe.template Generate a text file from a template http://pypi.python.org/pypi/collective.recipe.template • collective.recipe.cmd Execute a command line http://pypi.python.org/pypi/collective.recipe.cmd • zc.recipe.cmmi hexagonit.recipe.cmmi Two different recipes to download and build a package using configure/make/make-install http://pypi.python.org/pypi/zc.recipe.cmmi http://pypi.python.org/pypi/hexagonit.recipe.cmmi • Sunday, January 5, 14 zc.recipe.egg Install Python package distributions as eggs http://pypi.python.org/pypi/zc.recipe.egg mr.scripty Use python to write configuration http://pypi.python.org/pypi/mr.scripty
  • 11. more recipes • • mr.developer A zc.buildout extension to ease the development of projects with multiple packages. Provides some configuration sugar and scripts to maintain multiple source-controlled packages within a single buildout. http://pypi.python.org/pypi/zc.recipe.egg • collective.recipe.environment A zc.buildout recipe to set or look up environment variables http://pypi.python.org/pypi/collective.recipe.environment • cns.recipe.symlink A zc.buildout recipe to create symlinks (could do the same with collective.recipe.cmd) http://pypi.python.org/pypi/cns.recipe.symlink • Sunday, January 5, 14 collective.recipe.omelette A zc.buildout recipe to create a unified directory structure of installed packages, symlinking to the actual contents, in order to ease navigation and developer inspection. http://pypi.python.org/pypi/collective.recipe.omelette z3c.recipe.mkdir A zc.buildout recipe to create directories (could do the same with collective.recipe.cmd) http://pypi.python.org/pypi/z3c.recipe.mkdir
  • 12. keep it simple There are too many buildout recipes out there (850+ on pypi alone!) Avoid the temptation to create yet another recipe when you can do the same operation by just stringing together a few of the basic recipes. For example, these two are functionally equivalent but the one on the right avoids adding yet another abstraction layer between the semantics of the buildout configuration and the varnish configuration: [varnish] recipe = zc.recipe.cmmi url = ${urls:varnish} [varnish] recipe = zc.recipe.cmmi url = ${urls:varnish} [varnish-recipe] recipe = plone.recipe.varnish daemon = ${varnish:location}/sbin/varnishd bind = 127.0.0.1:8000 backends = 127.0.0.1:8080 cache-size = 256M [varnish-config] recipe = collective.recipe.template path = etc/varnish.vcl input = templates/${:path}.in output = ${buildout:directory}/${:path} [varnish-runner] recipe = collective.recipe.template input = inline: #!/bin/sh exec ${varnish:location}/sbin/varnishd -f "${varnish-config:output}" -P "${buildout:directory}/var/varnish.pid" -a 0.0.0.0:${global:varnish-port} -s file,"${buildout:directory}/var/ varnish_storage",1G "$@" output = ${buildout:directory}/bin/varnishd mode = 755 Sunday, January 5, 14