[Checkins] SVN: Sandbox/J1m/pycon2011/dev/ checkpoint

Jim Fulton jim at zope.com
Fri Mar 11 06:46:14 EST 2011


Log message for revision 120860:
  checkpoint

Changed:
  A   Sandbox/J1m/pycon2011/dev/
  A   Sandbox/J1m/pycon2011/dev/buildout.cfg
  A   Sandbox/J1m/pycon2011/dev/cmsapp.py
  A   Sandbox/J1m/pycon2011/dev/dbsource.cfg
  A   Sandbox/J1m/pycon2011/dev/metarecipe/
  A   Sandbox/J1m/pycon2011/dev/metarecipe/cmsappdbmetarecipe.py
  A   Sandbox/J1m/pycon2011/dev/metarecipe/setup.py
  A   Sandbox/J1m/pycon2011/dev/setup.py

-=-
Added: Sandbox/J1m/pycon2011/dev/buildout.cfg
===================================================================
--- Sandbox/J1m/pycon2011/dev/buildout.cfg	                        (rev 0)
+++ Sandbox/J1m/pycon2011/dev/buildout.cfg	2011-03-11 11:46:14 UTC (rev 120860)
@@ -0,0 +1,97 @@
+[buildout]
+develop = .
+parts = test app-sw db-sw ctl buildout-source-release
+
+[test]
+recipe = zc.recipe.testrunner
+eggs = cmsapp
+
+[app-sw]
+recipe = zc.recipe.egg
+eggs = ${test:eggs}
+       PasteScript
+       zc.zodbwsgi
+interpreter = py
+
+[db-sw]
+recipe = zc.recipe.egg
+eggs = ZODB3
+       zc.queue
+       zope.app.keyreference
+       zope.minmax
+       zc.catalogqueue
+       zc.zlibstorage
+
+[ctl]
+recipe = zc.recipe.rhrc
+dest = ${buildout:bin-directory}
+parts =
+    main-db-server
+    index-db-server
+    app-server
+
+[db-server]
+recipe = zc.zodbrecipes:server
+zeo.conf =
+   <zeo>
+      address ${:address}
+   </zeo>
+   %import zc.zlibstorage
+   <zlibstorage>
+     <filestorage>
+        path ${:path}
+     </filestorage>
+   </zlibstorage>
+
+[main-db]
+recipe = zc.recipe.filestorage
+
+[main-db-server]
+<= db-server
+address = :8100
+path = ${main-db:path}
+
+[index-db]
+recipe = zc.recipe.filestorage
+
+[index-db-server]
+<= db-server
+address = :8101
+path = ${index-db:path}
+
+
+[paste.ini]
+recipe = zc.recipe.deployment:configuration
+s =
+text =
+  ${:s}[app:main]
+  ${:s}use = egg:bobo
+  ${:s}bobo_resources = cmsapp
+  ${:s}filter-with = zodb
+  ${:s}
+  ${:s}[filter:zodb]
+  ${:s}use = egg:zc.zodbwsgi
+  ${:s}configuration =
+  ${:s}  <zodb main>
+  ${:s}     <zeoclient>
+  ${:s}        server ${main-db-server:address}
+  ${:s}     </zeoclient>
+  ${:s}  </zodb>
+  ${:s}  <zodb index>
+  ${:s}     <zeoclient>
+  ${:s}        server ${index-db-server:address}
+  ${:s}     </zeoclient>
+  ${:s}  </zodb>
+  ${:s}
+  ${:s}[server:main]
+  ${:s}use = egg:Paste#http
+  ${:s}host = localhost
+  ${:s}port = 8080
+
+[app-server]
+recipe = zc.zdaemonrecipe
+program = ${buildout:bin-directory}/paster serve ${paste.ini:location}
+
+[buildout-source-release]
+recipe = zc.recipe.egg:scripts
+eggs = zc.sourcerelease


Property changes on: Sandbox/J1m/pycon2011/dev/buildout.cfg
___________________________________________________________________
Added: svn:eol-style
   + native

Added: Sandbox/J1m/pycon2011/dev/cmsapp.py
===================================================================
--- Sandbox/J1m/pycon2011/dev/cmsapp.py	                        (rev 0)
+++ Sandbox/J1m/pycon2011/dev/cmsapp.py	2011-03-11 11:46:14 UTC (rev 120860)
@@ -0,0 +1,10 @@
+
+import bobo
+
+ at bobo.query('/')
+def index(bobo_request):
+    conn = bobo_request.environ['zodb.connection']
+    return "%r\n%r" % (
+        conn.root(),
+        conn.get_connection('index').root(),
+        )


Property changes on: Sandbox/J1m/pycon2011/dev/cmsapp.py
___________________________________________________________________
Added: svn:keywords
   + Id
Added: svn:eol-style
   + native

Added: Sandbox/J1m/pycon2011/dev/dbsource.cfg
===================================================================
--- Sandbox/J1m/pycon2011/dev/dbsource.cfg	                        (rev 0)
+++ Sandbox/J1m/pycon2011/dev/dbsource.cfg	2011-03-11 11:46:14 UTC (rev 120860)
@@ -0,0 +1,16 @@
+[buildout]
+extends = buildout.cfg
+parts = db-sw extra-eggs sbo
+relative-paths = true
+develop = metarecipe
+
+[extra-eggs]
+recipe = zc.recipe.egg:eggs
+eggs = zc.recipe.rhrc
+       zc.zodbrecipes
+       zc.recipe.deployment
+       zc.zodbdgc
+
+[sbo]
+recipe = zc.recipe.egg
+eggs = zc.sbo


Property changes on: Sandbox/J1m/pycon2011/dev/dbsource.cfg
___________________________________________________________________
Added: svn:eol-style
   + native

Added: Sandbox/J1m/pycon2011/dev/metarecipe/cmsappdbmetarecipe.py
===================================================================
--- Sandbox/J1m/pycon2011/dev/metarecipe/cmsappdbmetarecipe.py	                        (rev 0)
+++ Sandbox/J1m/pycon2011/dev/metarecipe/cmsappdbmetarecipe.py	2011-03-11 11:46:14 UTC (rev 120860)
@@ -0,0 +1,93 @@
+
+class MetaRecipe:
+    def __init__(self, buildout, name, options):
+
+        def add_section(section_name, **values):
+            if section_name in buildout._raw:
+                raise KeyError("already in buildout", section_name)
+            buildout._raw[section_name] = values
+            buildout[section_name] # cause it to be added to the working parts
+
+        deployment = name + '-deployment'
+
+        add_section(deployment,
+                    recipe = 'zc.recipe.deployment',
+                    name=name,
+                    user=options['user'],
+                    )
+
+        ports = options['main-port'], options['index-port']
+        dbnames = 'main', 'index'
+        servers - zip(dbnames, ports)
+        for dbname, port in servers:
+            add_section(name+'-'+dbname,
+                        recipe = 'zc.zodbrecipes:server',
+                        deployment = deployment,
+                        **{'zeo.conf': zeo_conf * dict(
+                            port=port,
+                            customer=name,
+                            dbname=dbname,
+                            )})
+
+        add_section(name+'-ctl',
+                    recipe = 'zc.recipe.rhrc',
+                    deployment= deployment,
+                    chkconfig = '345 99 10',
+                    parts = ' '.join(name+'-'+dbname
+                                     for (dbname, _) in servers),
+                    )
+
+        add_section(name+'-gc.conf',
+                    recipe = 'zc.recipe.deployment:configuration',
+                    deployment = deployment,
+                    text='\n'.join(gc_conf % dict(dbname=dbname, port=port)
+                                   for (dbname, port) in servers),
+                    )
+
+        add_section(name+'-pack.sh',
+                    recipe = 'zc.recipe.deployment:configuration',
+                    deployment = deployment,
+                    text = pack_sh % dict(
+                        customer=name,
+                        addresses = ' '.join(':'+port for port in ports),
+                        gcconf=name+'-gc.conf',
+                        ),
+                    )
+
+        add_section(name+'-pack',
+                    recipe = 'zc.recipe.deployment:crontab',
+                    deployment = deployment,
+                    times = '1 2 * * 6',
+                    command = 'sh ${%s-pack.sh:location}' % name
+                    )
+
+    update = install = lambda self: ()
+
+zeo_conf = """
+<zeo>
+   address :%(port)s
+</zeo>
+%import zc.zlibstorage
+<zlibstorage>
+  <filestorage>
+     path /var/databases/%(customer)s/%(dbname)s
+     pack-gc false
+  </filestorage>
+</zlibstorage>
+"""
+
+gc_conf = """
+    <zodb %(dbname)s>
+      <zeoclient>
+         server :%(port)s
+      </zeoclient>
+    </zodb>
+"""
+
+pack_sh = """
+  %(bin)s/zeopack -d3 -t00 \
+     %(addresses)s
+
+  ${buildout:bin-directory}/multi-zodb-gc -d3 -lERROR \
+     ${%(gcconf)s:location}
+"""


Property changes on: Sandbox/J1m/pycon2011/dev/metarecipe/cmsappdbmetarecipe.py
___________________________________________________________________
Added: svn:keywords
   + Id
Added: svn:eol-style
   + native

Added: Sandbox/J1m/pycon2011/dev/metarecipe/setup.py
===================================================================
--- Sandbox/J1m/pycon2011/dev/metarecipe/setup.py	                        (rev 0)
+++ Sandbox/J1m/pycon2011/dev/metarecipe/setup.py	2011-03-11 11:46:14 UTC (rev 120860)
@@ -0,0 +1,8 @@
+from setuptools import setup
+setup(
+    name = 'cmsappdbmetarecipe',
+    py_modules = ['cmsappdbmetarecipe'],
+    entry_points = {'zc.buildout': ['default = cmsappdbmetarecipe:MetaRecipe']},
+    install_requires = ['setuptools'],
+    zip_safe = False,
+    )


Property changes on: Sandbox/J1m/pycon2011/dev/metarecipe/setup.py
___________________________________________________________________
Added: svn:keywords
   + Id
Added: svn:eol-style
   + native

Added: Sandbox/J1m/pycon2011/dev/setup.py
===================================================================
--- Sandbox/J1m/pycon2011/dev/setup.py	                        (rev 0)
+++ Sandbox/J1m/pycon2011/dev/setup.py	2011-03-11 11:46:14 UTC (rev 120860)
@@ -0,0 +1,7 @@
+from setuptools import setup
+setup(
+    name = 'cmsapp',
+    py_modules = ['cmsapp'],
+    install_requires = ['setuptools', 'bobo', 'ZODB3'],
+    zip_safe = False,
+    )


Property changes on: Sandbox/J1m/pycon2011/dev/setup.py
___________________________________________________________________
Added: svn:keywords
   + Id
Added: svn:eol-style
   + native



More information about the checkins mailing list