configurationengine/doc/intro.rst
author terytkon
Thu, 11 Mar 2010 17:04:37 +0200
changeset 0 2e8eeb919028
child 3 e7e0ae78773e
permissions -rw-r--r--
Adding EPL version of configurationengine.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
     1
Introduction
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
     2
============
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
     3
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
     4
ConE installation offers three different use scenarios of the tool.
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
     5
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
     6
#. ConE API (read, write)
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
     7
#. ConE plugin API (A plugin interface to add functionality to ConE)
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
     8
#. ConE command line interface (tools/utilities that use the API)
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
     9
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    10
ConE API
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    11
--------
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    12
The ConE API tries to offer a simple way to access the configurations inside the Configuration
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    13
project. The concepts of confml and the Configuration project are quite complicated, but the API
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    14
simplifies the project quite a bit to enable effective programming. Although the API aims for 
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    15
simplicity, everything is made available via the API.
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    16
The API is described in this document with python api documentation tool *epydoc*.  
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    17
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    18
ConE plugin API
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    19
---------------
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    20
The purpose of the plugin API is to offer the possibility to expand the functionality of Configuration project. Normal use case
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    21
is an implementation plugin which reads data from the configuration and transforms it into some other form 
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    22
(e.g. centralrepository text file).
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    23
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    24
ConE command line interface
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    25
---------------------------
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    26
The main purpose of ConE is to offer the above APIs, but ConE installation as tool
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    27
offers also set of command line utilities that can used to modify, read and utilize (generate other output files 
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    28
with implementation plugins) from a Configuration project. These utilities lie on the cone-script package and 
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    29
are described in the ConE command line interface section.
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    30
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    31
Installation
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    32
------------
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    33
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    34
Requirements
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    35
^^^^^^^^^^^^
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    36
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    37
ConE installation requires:
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    38
 
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    39
* Python 2.5 (though 2.6 probably works too)
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    40
* Ant (Required for installing from source)
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    41
* Python setuptools - http://pypi.python.org/pypi/setuptools. (Required to install ConE as part of python)
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    42
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    43
ConE can be installed in two different ways:
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    44
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    45
1. In the Python environment under site-packages like any other Python package
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    46
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    47
  - Makes it possible to use the ConE API from Python scripts
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    48
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    49
2. As a standalone installation in a separate directory
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    50
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    51
  - Contains the CLI and a set of plug-ins
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    52
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    53
Installing from source
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    54
^^^^^^^^^^^^^^^^^^^^^^
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    55
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    56
In order to install from source, you obviously need to first get the ConE sources:
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    57
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    58
* Clone the Mercurial repository:
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    59
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    60
  * ``hg clone https://developer.symbian.org/sfl/MCL/sftools/depl/swconfigmdw/``
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    61
  
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    62
* -- or -- checkout from SVN (if you are in Nokia intranet):
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    63
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    64
  * ``svn checkout https://trace1.isource-nokia.nokia.com/isource/svnroot/cone/trunk cone_src``
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    65
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    66
**Installing under site-packages**
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    67
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    68
Simply install using ``setup.py`` like for any Python package:
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    69
  
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    70
* ``cd cone_src/source``
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    71
* ``python setup.py install``
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    72
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    73
This will install the ConE core module into your Python environment. To install a plug-in,
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    74
do the same in the desired plug-in's source directory (e.g. ``cone_src/plugins/common/ConeRulePlugin``).
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    75
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    76
**Installing the standalone ConE**
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    77
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    78
The normal installation in windows environment creates a directory containing the needed
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    79
libraries and ConE plug-ins, and a ``cone.cmd`` wrapper script. The directory can then
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    80
be added somewhere into your PATH, and then the CLI can be used by running ``cone``.
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    81
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    82
To install, run:
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    83
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    84
* <windows> ``install.cmd /path/to/install common``
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    85
* <linux> *Not available yet*
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    86
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    87
Notice the parameter ``common`` in the install command. This specifies the plug-in package to install.
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    88
It can be omitted, in which case it defaults to ``common``. Replace this with e.g. ``symbian`` to create
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    89
a Symbian-specific ConE installation.
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    90
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    91
.. note::
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    92
    Currently the standalone installation is Windows-specific in the sense that only a batch file
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    93
    wrapper (``cone.cmd``) is included and some Symbian-specific plug-ins have dependencies to
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    94
    Windows applications and Python libraries with native components. However, the ``common``
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    95
    plug-in package should contain only pure Python, so it should work in Unix. Also, a ``cone.sh``
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    96
    script is available under ``source/``, which can be used to replace ``cone.cmd`` in Unix.
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    97
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    98
Install from ZIP
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
    99
^^^^^^^^^^^^^^^^
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   100
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   101
Fetch the latest ConE build from our CruiseControl build server (works only in Nokia intranet):
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   102
  
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   103
* Goto http://trwec021.nmp.nokia.com:8080/buildresults/cone-build
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   104
* Click on the Build Artifacts to get the latest build. Older builds are also available for some time.
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   105
* Download the zip file
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   106
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   107
The ZIP file should contain a pre-built standalone installation described in the previous section.
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   108
Simply unzip it where you please.
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   109
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   110
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   111
.. _installation-export-tests:
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   112
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   113
Standalone test set
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   114
^^^^^^^^^^^^^^^^^^^
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   115
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   116
A standalone ConE installation can be tested using an automated standalone test set, which tests the
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   117
ConE CLI functionality. Like the ``install`` command, exporting the test set also needs to
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   118
be given the plug-in package name (it wouldn't make much sense to test a Symbian ConE
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   119
installation using a Maemo-specific test set).
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   120
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   121
* Export the test set:
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   122
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   123
  * ``cd cone_src``
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   124
  * <windows> ``export_bat.cmd /path/to/tests common``
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   125
  * <linux> *Not available yet*
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   126
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   127
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   128
.. warning::
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   129
    The path specified as the target path will be cleared before the actual
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   130
    export takes place, so be sure not to pass anything like C:\\ there.
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   131
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   132
* Run the test set:
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   133
  
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   134
  * Copy the ConE installation to test into ``/path/to/tests/cone/``
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   135
  * ``cd /path/to/tests``
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   136
  * ``runtests.cmd``
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   137
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   138
You can also run the tests so that a standalone ConE installation is built and then tested
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   139
with its corresponding test set:
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   140
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   141
  * ``cd cone_src``
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   142
  * <windows> ``run_bat.cmd /path/to/tests common``
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   143
  * <linux> *Not available yet*
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   144
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   145
If you simply want to test that ConE works correctly on your machine, you can
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   146
also run:
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   147
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   148
  * ``ant test``
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   149
  
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   150
This will export the test set, install ConE and run the tests inside a temporary
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   151
build directory in the working copy.
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   152
  
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   153
Build and install debian packages (Maemo)
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   154
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   155
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   156
  1. Install tools and cone dependencies, as root or with sudo.
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   157
  
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   158
    * ``sudo apt-get install dpkg-dev fakeroot python-setuptools python-central``
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   159
    
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   160
  2. Build python-cone and cone-tool. The packages are placed in parent directory.
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   161
   
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   162
    * ``cd cone/trunk``
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   163
    * ``dpkg-buildpackage -rfakeroot -b``
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   164
    
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   165
  3. Install the binary packages, as root or with sudo.
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   166
   
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   167
    * ``sudo dpkg -i ../python-cone*.deb ../cone-tool*.deb``
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   168
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   169
  4. Install Jinja2 (not part of all Debian-based distros)
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   170
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   171
    * ``sudo easy_install Jinja2``
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   172
2e8eeb919028 Adding EPL version of configurationengine.
terytkon
parents:
diff changeset
   173