How to use ERP5 Appliance Buildout

Warning...this tutorial is outdated.

Instead use this tutorial, we recommend you install ERP5 using SlapOS, a fully automated system to provide and manage services in a computer cloud.

You can install ERP5 using SlapOS following the tutorial  How to Install ERP5 using SlapOS. In case that you prefer a quick installation, you can install ERP5 using Linux packages, just following the tutorial how to install ERP5 by RPM and Deb packages.

For more information, please access the download area at this website.

ERP5 Appliance Buildout

Introduction

Buildout installation is the recommended way to install ERP5 if you want to develop or customise ERP5. This tutorial has been tested under Mandriva and Ubuntu. Contributions are welcomed to test it under other platforms.

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 is system independent.
Requirements to build ERP5 Appliance are:

  • C and C++ compiler
  • standard C and C++ library with development headers
  • make
  • patch
  • diff (also known as diffutils)
  • groff
  • rpm2cpio
  • python (>=2.4) with development headers (to run buildout)

Notes

Note: The overall process might take few time to be completed. It will depend on the speed of your computer and of the bandwidth of your Internet connection. We recommend you to explicitly separate the data from the software. The below procedure will take this advice into account.

Setup

Create directory for buildout and its extends cache:

$ mkdir -p ~/erp5.buildout/extends-cache
$ cd ~/erp5.buildout

Now it is time to create 'buildout.cfg' file in ~/erp5.buildout/ directory, using your preferred text editor (gedit, kate, vim.). Follow text shall be put in this file:

[buildout]
extends = https://svn.erp5.org/repos/public/erp5/trunk/buildout/buildout-2.12.cfg
# In case of Zope 2.8 use:
# extends = https://svn.erp5.org/repos/public/erp5/trunk/buildout/buildout.cfg
extends-cache = extends-cache

Bootstrap buildout

Note:please read "Troubleshooting" section bellow, you may need to unset environment variables in your GNU/Linux distribution

Such command will bootstrap buildout:

$ python -S -c 'import urllib;print urllib.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 including Zope plus dependencies (including Acquisition with _aq_dynamic patch) and CMF 2.2 plus dependencies.

Note on -S: This switch is overridden by PYTHONPATH 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 create the ERP5 instances.

$ mkdir ~/instances
$ cd ~/instances

Now it is time to create 'buildout.cfg' file in ~/instances directory with following content (replace '/home/foo' below with your home directory path):

[buildout]
# Reuse extends from software
# (it should be an absolute path because buildout cannot extend '~' character.)
extends-cache = /home/foo/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
  /home/foo/erp5.buildout/instance.inc

parts =
  mysql-instance
  cloudooo-instance
  supervisor-instance
  runUnitTest
  development-site

Then 'bootstrap' your buildout environment, and invoke buildout command:

$ ~/erp5.buildout/bin/bootstrap2.6
$ bin/buildout -v

The software-home configuration (along with the 'extends-cache') 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

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 cloudooo 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

Also a fully configured Zope instance is installed in the directory "parts/development-site", and it should be already available on http://localhost:18080/ invoked by supervisord. 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:

$ 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

Also, please make sure that TMPDIR and TMP environment variables are correctly set otherwise some software may not run properly, such as MySQL.

 

Bottom Gadget
Right Gadget

Profile

Loading ...

Relations

Loading ...