Commit 2c046485 authored by Łukasz Nowak's avatar Łukasz Nowak

- synchronise 2.8 with 2.12 and make 2.12 the default one


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@41099 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent f0418a36
===========================
ERP5 buildout for Zope 2.12
===========================
Introduction
============
ERP5 Buildout provides a way to build and manage ERP5 software components
with all needed dependencies.
ERP5 Buildout also provides a way to manage separate installation instances of
ERP5 to share non-data components of an ERP5 software installation from a
single location, allowing for easy component upgrade.
Software
========
Software part is system independent.
Requirements to build ERP5 Appliance 2.12 are:
* C and C++ compiler (gcc and g++)
* standard C and C++ library with development headers (glibc and libstdc++)
* make
* patch
* python (>=2.4) with development headers (to run buildout)
** WARNING ** DO __NOT__ use helpers, they are only for ERP5 Appliance 2.8 flavour. ** WARNING **
Setup
-----
Create directory for buildout and its extends cache:
$ mkdir -p ~/erp5.buildout/{downloads,extends-cache}
Go to this directory:
$ cd ~/erp5.buildout
Create buildout.cfg there:
$ cat > buildout.cfg
[buildout]
extends = https://svn.erp5.org/repos/public/erp5/trunk/buildout/buildout-2.12.cfg
extends-cache = extends-cache
^D
Bootstrap buildout
~~~~~~~~~~~~~~~~~~
WARNING: please read "Troubleshooting" section bellow, you may need to
unset environment variables in your GNU/Linux distribution
$ python -S -c 'import urllib2;print urllib2.urlopen("http://svn.zope.org/*checkout*/zc.buildout/trunk/bootstrap/bootstrap.py").read()' | python -S -
Run the buildout
~~~~~~~~~~~~~~~~
$ bin/buildout -v
This will download and install the software components needed to run ERP5 on
Zope 2.12 including Zope 2.12 plus dependencies (including
Acquisition with _aq_dynamic patch) and CMF 2.2 plus dependencies.
Note on -S: this switch is overridden by PYTHON_PATH environment variable. In
doubt, unset it before invoking that command.
Post-build check
----------------
There are tests for buildout in:
https://svn.erp5.org/repos/public/erp5/trunk/buildout/tests/assertSoftware.py
Download this file, for example by using provided svn:
$ parts/subversion/bin/svn export --non-interactive --trust-server-cert https://svn.erp5.org/repos/public/erp5/trunk/buildout/tests/assertSoftware.py
Run:
python assertSoftware.py
Instances
=========
Note: Instance generation is still a work in progress. In particular, these
instructions should be much simplified.
After the software components are built, we can generate ERP5 instance
buildouts from that software.
Assuming the ERP5 software buildout is available in ~/erp5.buildout the
following sequence of steps should result in a working "instance" buildout:
$ mkdir ~/instances # 0
$ cd ~/instances # 1
$ cat > buildout.cfg # 3
[buildout]
# Reuse extends from software
extends-cache = ~/erp5.buildout/extends-cache
# Default run buildout in offline mode.
offline = true
extends =
https://svn.erp5.org/repos/public/erp5/trunk/buildout/profiles/development-2.12.cfg
~/erp5.buildout/instance.inc
parts =
mysql-instance
oood-instance
supervisor-instance
^D
$ ~/erp5.buildout/bin/bootstrap2.6 # 4
$ bin/buildout -v # 5
The software-home configuration (along with the 'extends-cache' in the
'instance-profiles' symlink) provides all the information and components that
would otherwise have to be downloaded.
The steps above generate instance configurations for mysql and the
OpenOffice.org document conversion daemon. We need mysql, in particular,
to be running before configuring an actual ERP5 instance, so we'll start
supervisor:
$ bin/supervisord # 6
Now it is time to give supervisor few moments (about 10 seconds) to start all
required services. By running bin/supervisorctl status one can be informed if mysql
and oood are running.
Also, we need databases in the mysql server that correspond to both the ERP5
instance we're going to create, and the testrunner we will want to run:
$ var/bin/mysql -h 127.0.0.1 -u root
mysql> create database development_site;
mysql> grant all privileges on development_site.* to 'development_user'@'localhost' identified by 'development_password';
mysql> grant all privileges on development_site.* to 'development_user'@'127.0.0.1' identified by 'development_password';
mysql> create database test212;
mysql> grant all privileges on test212.* to 'test'@'localhost';
mysql> grant all privileges on test212.* to 'test'@'127.0.0.1';
mysql> exit
(there is automated support for creating databases but it's not currently
working with the Zope 2.12 buildout)
$ var/bin/
Now edit buildout.cfg and add "runUnitTest" (w/o quotes) to 'buildout:parts'.
The "development-instance" part will be pulled in automatically as a
dependency:
$ $EDITOR buildout.cfg # 7
Then run buildout again to finish the configuration
$ bin/buildout -ov # 8
Now a fully configured development instance will be available in the directory
"var/development-instance", so you can do:
$ var/development-site/bin/zopectl fg
And see an ERP5 instance running on "http://localhost:18080/". The port '18080'
refers to the 'development-instance:http-address' setting in
'profiles/development-2.12.cfg'. The file 'instance-profiles/zope-2.12.cfg'
provides the "Manager" credentials you should use (usually zope:zope), in
the 'zope-instance-template:user' variable.
You should also be able to run ERP5 unit tests like so:
$ bin/runUnitTest testClassTool
Troubleshooting
===============
In various Linux distributions python is heavily patched and user related
environment variables are set system wide. This affects behaviour of python
and introduces various problem with running buildout.
In case of such issues consider resetting some python environment variables
before running buildout:
* PYTHONPATH
* PYTHONSTARTUP
* PYTHONDONTWRITEBYTECODE
Example:
$ unset PYTHONPATH PYTHONSTARTUP PYTHONDONTWRITEBYTECODE
$ make
$ # other buildout related commands
TODO
====
* Refactor the .cfg files to reduce duplication and so that only the
'instance-profiles' directory needs to be symlinked. Alternatively, push all
.cfg files into a single 'profiles'
directory.
* Combine steps 2, 3 and 4 into a single step by creating a more powerful
'bootstrap2.6' script.
* Running 'buildout' twice in the instance (once to configure 'supervisor',
'mysql' and 'oood' and once to setup the ZODB ERP5 instance) is confusing
and error-prone. A buildout shouldn't deal with persistent state, only with
file installation. Move the mysql database and ERP5 ZODB instance creation
procedures to dedicated scripts in 'bin/' instead of implicitly running them
in the (second) buildout run.
* Patch the SOAPpy package provided by Nexedi so it doesn't fail with a
SyntaxError on Python 2.6. Right now we're using a SOAPpy repackaging from
http://ibid.omnia.za.net/eggs/ .
* Synchronize the buildout behaviour for Zope 2.8 and 2.12 (i.e. allows Zope
2.8 to work with a single buildout check-out).
* See if we can use http://pypi.python.org/pypi/zc.sourcerelease/ to generate
a single (humongous) tarball with all needed software components for fully
offline operation.
* Figure out why garbage is left on <software_home>/parts/unit_test after the
test run. It can influence later test runs.
Please see README.txt
......@@ -5,139 +5,176 @@ ERP5 buildout
Introduction
============
ERP5 Buildout is providing a way to build and manage ERP5 software components
ERP5 Buildout provides a way to build and manage ERP5 software components
with all needed dependencies.
ERP5 Buildout is also providing a way to manage instances of software
(whenever provided by ERP5 Buildout or externally).
ERP5 Buildout also provides a way to manage separate installation instances of
ERP5 to share non-data components of an ERP5 software installation from a
single location, allowing for easy component upgrade.
Note for Zope 2.8
-----------------
Those instructions are for ERP5 running with Zope 2.12. Please refer to small
notes below to see differences between 2.12 and 2.8.
Software
========
Software part shall be system independent. In perfect world it shall depend
only on:
Software part is system independent.
* C and C++ compiler
* standard C and C++ library with development headers
Requirements to build ERP5 Appliance are:
* C and C++ compiler (gcc and g++)
* standard C and C++ library with development headers (glibc and libstdc++)
* make
* patch
* python (>=2.4) with development headers (to run buildout)
* tool to download bootstrap (wget, curl or web browser)
* subversion client (XXX: It will be removed some day)
As world is not perfect some additional build time requirements are added,
please look below for a way to acquire list of dependencies and system helpers.
Note: We are working hard on removing system depending helpers. Please try to
use ERP5 Appliance 2.8 without helpers and extend buildout profiles to depend
only on above list.
Setup
-----
How to run
----------
Create directory for buildout and its extends cache:
Checkout: https://svn.erp5.org/repos/public/erp5/trunk/buildout/
For example:
$ mkdir -p ~/erp5.buildout/{downloads,extends-cache}
svn co https://svn.erp5.org/repos/public/erp5/trunk/buildout/ ~/erp5.buildout
Go to this directory:
Run make inside:
$ cd ~/erp5.buildout
cd ~/erp5.buildout
mkdir -p downloads
make
Create buildout.cfg there:
It will install required software and configure it locally, up to ERP5 site
with some Business Templates. By default it will use local python, MySQL,
Zope, etc.
$ cat > buildout.cfg
Choosing and modifying proper profile allows to control how much software will
be build in place.
Minimal requirements
--------------------
[buildout]
extends = https://svn.erp5.org/repos/public/erp5/trunk/buildout/buildout-2.12.cfg
# In case of Zope 2.9 use:
# extends = https://svn.erp5.org/repos/public/erp5/trunk/buildout/buildout.cfg
extends-cache = extends-cache
^D
To start buildout it is required to have:
Bootstrap buildout
~~~~~~~~~~~~~~~~~~
* any python with header files (file similar to
/usr/lib*/python*/config/Makefile have to be delivered by system package)
* svn client (to checkout buildout)
WARNING: please read "Troubleshooting" section bellow, you may need to
unset environment variables in your GNU/Linux distribution
After build check
-----------------
$ python -S -c 'import urllib2;print urllib2.urlopen("http://svn.zope.org/*checkout*/zc.buildout/trunk/bootstrap/bootstrap.py").read()' | python -S -
After software is build invoke:
Run the buildout
~~~~~~~~~~~~~~~~
make assert
$ bin/buildout -v
To be sure that all components are available (corretly build and linked).
This will download and install the software components needed to run ERP5 on
Zope including Zope plus dependencies (including
Acquisition with _aq_dynamic patch) and CMF 2.2 plus dependencies.
Distribution helpers
--------------------
Note on -S: this switch is overridden by PYTHON_PATH environment variable. In
doubt, unset it before invoking that command.
In profiles directory there are profiles to help with preparation of used
distributions.
Post-build check
----------------
To prepare Mandriva 2010.0 please type, having root privileges:
There are tests for buildout in:
https://svn.erp5.org/repos/public/erp5/trunk/buildout/tests/assertSoftware.py
helpers/mandriva2010.0.sh
Download this file, for example by using provided svn:
There are more helpers available, please refer to helpers directory.
$ parts/subversion/bin/svn export --non-interactive --trust-server-cert https://svn.erp5.org/repos/public/erp5/trunk/buildout/tests/assertSoftware.py
Run:
python assertSoftware.py
Instances
=========
Note: Instance generation is still work in progress.
Note: Instance generation is still a work in progress. In particular, these
instructions should be much simplified.
After the software components are built, we can generate ERP5 instance
buildouts from that software.
Assuming the ERP5 software buildout is available in ~/erp5.buildout the
following sequence of steps should result in a working "instance" buildout:
After software is generated it is time to have instances running.
The easiest way to generate instance is of course to reuse generated software.
If software is available in ~/erp5.buildout, such scenario work:
$ mkdir ~/instances # 0
$ cd ~/instances # 1
$ cat > buildout.cfg # 3
$ svn co https://svn.erp5.org/repos/public/erp5/trunk/buildout/ ~/instances
$ cd instances
$ cat > my_instances.cfg
[buildout]
extends = profiles/development.cfg
# Reuse extends from software
extends-cache = ~/erp5.buildout/extends-cache
# Default run buildout in offline mode.
offline = true
# Note: In case of Zope 2.8 use:
# https://svn.erp5.org/repos/public/erp5/trunk/buildout/profiles/development.cfg
extends =
https://svn.erp5.org/repos/public/erp5/trunk/buildout/profiles/development-2.12.cfg
~/erp5.buildout/instance.inc
parts =
software-links
mysql-instance
oood-instance
supervisor-instance
[software_definition]
software_home = /home/MYUSER/erp5.buildout
^D
$ ~/erp5.buildout/bin/python2.4 bootstrap/bootstrap.py -c my_instances.cfg
$ ~/erp5.buildout/bin/python2.4 -S bin/buildout -c my_instances.cfg
$ var/bin/supervisord # it will start supervisor and configured software
$ $EDITOR my_instances.cfg
# add "runUnitTest" and "development-site" to parts
$ ~/erp5.buildout/bin/python2.4 -S bin/buildout -c my_instances.cfg
Fully configured development instance will be available in var/development-site.
$ ~/erp5.buildout/bin/bootstrap2.6 # 4
$ bin/buildout -v # 5
Network based invocation
========================
The software-home configuration (along with the 'extends-cache' in the
'instance-profiles' symlink) provides all the information and components that
would otherwise have to be downloaded.
Buildout profile can extend other ones from network. It is possible to play
with ERP5 buildout that way.
The steps above generate instance configurations for mysql and the
OpenOffice.org document conversion daemon. We need mysql, in particular,
to be running before configuring an actual ERP5 instance, so we'll start
supervisor:
What to do:
$ bin/supervisord # 6
$ mkdir software
$ cd software
$ echo '[buildout]' >> buildout.cfg
$ echo 'extends = https://svn.erp5.org/repos/public/erp5/trunk/buildout/buildout.cfg' >> buildout.cfg
$ wget -qO - http://svn.zope.org/*checkout*/zc.buildout/trunk/bootstrap/bootstrap.py | python -S - -d
$ python -S bin/buildout
Now it is time to give supervisor few moments (about 10 seconds) to start all
required services. By running bin/supervisorctl status one can be informed if mysql
and oood are running.
Note on -S: this switch is overridden by PYTHON_PATH environment variable. In
doubt, unset it before invoking that command.
Also, we need databases in the mysql server that correspond to both the ERP5
instance we're going to create, and the testrunner we will want to run:
After some time everything shall be locally available.
$ var/bin/mysql -h 127.0.0.1 -u root
mysql> create database development_site;
mysql> grant all privileges on development_site.* to 'development_user'@'localhost' identified by 'development_password';
mysql> grant all privileges on development_site.* to 'development_user'@'127.0.0.1' identified by 'development_password';
mysql> create database test212;
mysql> grant all privileges on test212.* to 'test'@'localhost';
mysql> grant all privileges on test212.* to 'test'@'127.0.0.1';
mysql> exit
Disclaimer: That way is still in early stage of development.
$ var/bin/
Now edit buildout.cfg and add "runUnitTest" (w/o quotes) to 'buildout:parts'.
The "development-instance" part will be pulled in automatically as a
dependency:
$ $EDITOR buildout.cfg # 7
Then run buildout again to finish the configuration
$ bin/buildout -ov # 8
Now a fully configured development instance will be available in the directory
"var/development-instance", so you can do:
$ var/development-site/bin/zopectl fg
And see an ERP5 instance running on "http://localhost:18080/". The port '18080'
refers to the 'development-instance:http-address' setting in
'profiles/development-2.12.cfg'. The file 'instance-profiles/zope-2.12.cfg'
provides the "Manager" credentials you should use (usually zope:zope), in
the 'zope-instance-template:user' variable.
You should also be able to run ERP5 unit tests like so:
$ bin/runUnitTest testClassTool
Troubleshooting
===============
......@@ -158,3 +195,32 @@ Example:
$ unset PYTHONPATH PYTHONSTARTUP PYTHONDONTWRITEBYTECODE
$ make
$ # other buildout related commands
TODO
====
* Refactor the .cfg files to reduce duplication and so that only the
'instance-profiles' directory needs to be symlinked. Alternatively, push all
.cfg files into a single 'profiles'
directory.
* Combine steps 2, 3 and 4 into a single step by creating a more powerful
'bootstrap2.6' script.
* Running 'buildout' twice in the instance (once to configure 'supervisor',
'mysql' and 'oood' and once to setup the ZODB ERP5 instance) is confusing
and error-prone. A buildout shouldn't deal with persistent state, only with
file installation. Move the mysql database and ERP5 ZODB instance creation
procedures to dedicated scripts in 'bin/' instead of implicitly running them
in the (second) buildout run.
* Patch the SOAPpy package provided by Nexedi so it doesn't fail with a
SyntaxError on Python 2.6. Right now we're using a SOAPpy repackaging from
http://ibid.omnia.za.net/eggs/ .
* See if we can use http://pypi.python.org/pypi/zc.sourcerelease/ to generate
a single (humongous) tarball with all needed software components for fully
offline operation.
* Figure out why garbage is left on <software_home>/parts/unit_test after the
test run. It can influence later test runs.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment