zc.buildout - assets.en.oreilly.comassets.en.oreilly.com/1/event/12/software delivery _...
Post on 07-Apr-2018
250 Views
Preview:
TRANSCRIPT
July 2008 OSCON’08 / PORTLAND 1
zc.buildout
OSCON’08
Tarek Ziadé <tarek.ziade@ingeniweb.com>
2
Who am I & what we doCTO at Ingeniweb (Paris)Ingeniweb - part of Alterway
Alterway - 100% open source company
Python, Zope and Plone
QA
Releasing & deployment processes
My work
Building tools and conventions for developers
3
Books I wrote“Programmation Python” Editor: Eyrolles (Paris) - 2006 - French
“Petit guide à l’usage du développeur agile” Editeur Dunod (Paris) - 2007 - French
“Expert Python programming”Packt Publishing (UK) - Available in September 2008
Open Source stuff
Involved in Zope and PloneA few contributions in Python
4
45 min is too short
Plone drinkup tonightLucky Lab in NW, 1945 NW Quimby
at 6 pm
5
5 hours in 2006
6
5 hours in 2006get zopeinstall zope
install python extra packages
get extra products
install extra products dependency
doesn’t workahhh right, install python-ldap
create an instance
checkout products in development
start to work
doesn’t work
ahhh right, wrong python-ldap version
read extra products doc
install extra products
7
8
5 minutes in 2008
9
5 minutes in 2008get the “buildout”$ python bootstrap.py$ bin/buildoutstart to work
10
Yes !!!
11
Yepeee !!!
12
hahaha !!!
13
zc.buildout is a
a Coarse-Grained Python-Based Configuration-Driven Build Tool*
* definition stolen on Grok website
14
PaverPOSAV (Plain Old Setuptools And Virtualenv)
Capistrano, Ant, etc., Maven
IDNTS (I Don’t Need That Stuff)
15
Zope 3PloneGrok
All Zope based appsPylons based appsTwisted based appsBuildbot thinghies
Our customers
Community
...Herder (Creative Commons)
Every Python Project
16
zc.buildout =
distutils + setuptools + PyPI + configuration file
17
distutils =
builds and distributes a packageregisters and uploads it to PyPI
18
get the screencast at
http://ziade.org/oscon/demo1.m4v
19
setuptools =
simple dependencies management, namespaced package egg distribution
provides easy_install
20
setuptools + distutils=
the future distutils
21
egg=
binary or source distributionextended metadata
zip archive
22
easy_install my_package=
will get and install “my_package”from “PyPI”
23
PythonPackageIndex =
Python’s CPAN, driven with distutils
register and upload commands
24
get the screencast at
http://ziade.org/oscon/demo2.m4v
25
A zc.buildout primer
26
27
buildout.cfg : simple ini file (ConfigParser)
[buildout]
parts = one two
[one]recipe = my.recipe.onearg1 = value1
[two]recipe = my.recipe.twoarg1 = value1arg2 = value2
1
2
3
28
buildout.cfg processed
1
2
3
process each part sequentially
looks for “my.recipe.one”gets itexecutes it
look for “my.recipe.two”gets it executes it
29
demoinstalling zc.buildoutcreating a simple buildoutplaying with it
30
get the screencast at
http://ziade.org/oscon/demo3.mov
31
demo debriefbuildout.cfg describes the applicationrecipes = simple packageschange the .cfg -> re-run bin/buildoutzc.buildout grabs dependencies
32
What we get
bin buildout scripts from recipes
eggs all dependencies
develop-eggs
parts data from recipes
33
A recipe primer
34
a class + an entry point = a recipea recipe = a simple package
35
buildout developers love Paste ScriptPlone community provides ZopeSkel
36
demo writing a recipe using a Paste templatesetting an entry pointpublishing it at PyPI
37
get the screencast at
http://ziade.org/oscon/demo4.mov
38
http://pypi.python.org/pypi?:action=browse&show=all&c=512
Trove classifier : Framework :: Buildout
Hundreds of recipes at PyPI
39
great !!!
40
Plone application lifecycle
41
Plone buildouts are source based Warning
Get my Windows installer : python2.4.4-win32.zipGoogle “An installer for a buildout-ready Windows”
Windows developers
42
43
[buildout]
develop =path/to/my/package1path/to/another/package
cd path/to/my/package1python setup.py develop
buildout/develop-eggs
44
Typical buildout layout uses the extends feature
dev.cfg (extends buildout.cfg)buildout.cfg
prod.cfg (extends buildout.cfg)+ bootstrap.py
45
[buildout]extends = buildout.cfgparts = three
[buildout]parts = one two
buildout.cfg :
dev.cfg :
[buildout]parts = one two three
46
democreating a fresh Plone 3 buildout (Paste)adding the dev.cfghooking a new development packageadding a prod.cfg
47
get the screencast at
http://ziade.org/oscon/demo5.mov
48
complex example: plone.orghttps://svn.plone.org/svn/plone/PloneOrg/buildouts/trunk/devel/
python-ldap
zopezeo
varnish
pound
http://tinyurl.com/plone-buildout
49
Releasing the application
50
Source distribution
[buildout]offline = true...
[buildout]download-cache = downloads...
51
zc.buildout caveatsHard to do TDD for recipe codeisolated system = boundary with os is fuzzy
52
collective.releaser scripts to automate buildout releases and update
Tools on the top of zc.buildout
collective.buildbot buildout recipe to create a buildbot
5347
get the screencast at
http://ziade.org/oscon/demo6.mov
54
amazing !!!
55
alternative eggs locations
56
PyPI == SPOF
Eggs are not on PyPI sometimes
Eggs need privacy sometimes
A “Company PyPI” is useful
Command line releasing is cool
Why ?
57
Distributed model
58
a simple directorya directory published with a web server
or...
PloneSoftwareCenter
How : the find-links option[buildout]
find-links =http://plone.org/productshttp://my-company/eggs
59
PloneSoftwareCenter same APIs than PyPI distutils compliant powers the next plone.org can be used for any package
60
That’s all folks !
Thanks, questions ?
61
tarek.ziade@ingeniweb.com
Diagrams made with OmniGraffle (it rocks)
http://tarekziade.wordpress.com
zc.buildout @ PyPI
collective.buildbot @ PyPI
collective.releaser @ PyPI
http://alterway.fr
62
The Alter Way approach
Mission : bring a long-lasting and mature business model to Open Source
Significant contributions to Free Software
http://www.alterway.fr/
Federation of market leaders to foster the most complete solution to all IT needs for SME and institutions
The first european integrator 100% Open Source to be a real alternative to traditionnal players
Revenue in 2008 : 8 M€ (target in 2011 : 25 M€) Source in France
top related