Changeset 11386 for main/waeup.kofa/trunk/docs
- Timestamp:
- 24 Feb 2014, 06:43:26 (11 years ago)
- Location:
- main/waeup.kofa/trunk/docs
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/docs/INSTALL.txt
r7818 r11386 1 Installation on Linux production system 2 *************************************** 3 4 .. note:: `waeup.kofa` might not work with Python > 2.7 5 currently. Use of Python 2.6 or 2.7 is recommended. 1 Installation of Kofa 2 #################### 3 4 These are generic installation instructions for the WAeUP_ ``Kofa`` 5 student information portal and customized versions thereof. 6 7 For specific aspects of this package please refer to the local README 8 file. 9 10 Please note, that **only Linux-based installs** are described and actively 11 supported. We recommend use of Debian_ / Ubuntu_. 12 13 .. note:: This means we do not actively support Windows(tm)! 14 15 .. contents:: 16 6 17 7 18 Prerequisites 8 ============= 9 10 The `waeup.kofa` package is based on `Grok`_, which is a Python11 framework for agile webapplication development. Grok itself is based19 ************* 20 21 The Kofa packages are based on `Grok`_, which is a Python_ 22 framework for agile webapplication development. Grok_ itself is based 12 23 on `Zope`_. 13 24 14 .. _Grok: http://grok.zope.org/ 15 16 .. _Zope: http://www.zope.org/ 17 18 Both, Grok and Zope, are written in Python (with parts written in 19 C). You therefore need `Python`_ installed. 20 21 .. _Python: http://www.python.org/ 22 23 Note, that you also need the Python header files and a compiler to 24 compile the parts written in C. 25 26 To deploy `waeup.kofa` most easily, we use `zc.buildout`_ 27 28 .. _zc.buildout: http://cheeseshop.python.org/pypi/zc.buildout 29 30 You may have setuptools already installed for your system Python. In 31 that case, you may need to upgrade it first because buildout requires 32 a very recent version:: 33 34 $ sudo easy_install -U setuptools 35 36 If this command fails because easy_install is not available, there is 37 a good chance you do not have setuptools available for your system 38 Python. If so, there is no problem because setuptools will be 39 installed locally by buildout. 40 41 Bootstrap the buildout environment:: 42 43 $ python2.6 bootstrap/bootstrap.py 44 45 and run the buildout command:: 46 47 $ bin/buildout 48 [lots of stuff will be downloaded and installed here] 25 Both, Grok_ and Zope_, are written in the `Python`_ programming 26 language (with parts written in C). You therefore have to have 27 `Python`_ installed (including `Python`_ headers). 28 29 30 Preparing the System 31 ==================== 32 33 For a `Kofa` install we need of course `Python`_ installed as well as 34 some standard developer tools like C compilers, C libraries, etc. 35 36 What you need (Debian/Ubuntu package names in brackets): 37 38 * Python 2.7 (``python2.7``) 39 40 * Python 2.7 development files (``python2.7-dev``) 41 42 * A C-Compiler with basic C developer libraries (``build-essential``) 43 44 * A subversion client (``svn``) 45 46 * enscript (``enscript``) [optional] 47 48 This is only needed if you want test coverage reports. 49 50 All these packages can be installed on Debian systems like this:: 51 52 $ sudo apt-get install python2.7 python2.7-dev svn \ 53 build-essential enscript 54 55 Afterwards you should be able to enter:: 56 57 $ python2.7 58 59 at the commandline and get a Python_ prompt. Quit the interpreter 60 pressing <CTRL-D>. 61 62 63 Installing `virtualenv` 64 ======================= 65 66 We strongly suggest use of `virtualenv`_ to create Python_ sandboxes 67 where you can run your code without touching any other installations. 68 69 `virtualenv`_ is also the only possibility to build a `Kofa` install 70 without the need of superuser permissions. In short: `virtualenv`_ 71 will make your life easier. Use it. 72 73 Detailed install instructions for `virtualenv`_ can be found on 74 http://www.virtualenv.org/en/latest/virtualenv.html#installation. 75 76 The short way for a user install (no superuser perms required) is like 77 this:: 78 79 $ curl -O https://pypi.python.org/packages/source/v/virtualenv/virtualenv-1.11.4.tar.gz#md5=9accc2d3f0ec1da479ce2c3d1fdff06e 80 $ tar xvfz virtualenv-1.11.4.tar.gz 81 $ cd virtualenv-1.11.4 82 $ python virtualenv.py py27 83 84 Superusers can install `virtualenv`_ system-wide much easier. On 85 `Debian`_/`Ubuntu`_ systems where you have superuser permissions, you 86 can install `virtualenv`_ via:: 87 88 $ sudo apt-get install python-virtualenv 89 90 *Or*, if `pip` is installed already (superusers can install it via ``sudo apt-get install python-pip`` on `Debian`_/`Ubuntu`_):: 91 92 $ sudo pip install virtualenv 93 94 In the following, when referring to the `virtualenv` command, we talk 95 of the system-wide available command or the ``virtualenv.py`` script 96 installed for a local user. In the latter case you should read:: 97 98 $ virtualenv ... 99 100 as:: 101 102 $ python /path/to/my/virtualenv.py ... 103 104 105 Creating a sandbox 106 ================== 107 108 After installing `virtualenv`_ you can install local sandboxes like 109 this:: 110 111 $ virtualenv --no-site-packages py27 112 113 where ``py27`` is a directory in the filesystem where your sandbox 114 will be created. `virtualenv` will also create this directory for 115 you. It is recommended to use a sandbox name that is short and at the 116 same time reflects the Python version used (here: Python 2.7). 117 118 By passing the ``no-site-packages`` switch we tell `virtualenv` to 119 provide us a clean environment without any extra-packages installed 120 systemwide. More recent versions of `virtualenv`_ have this option set 121 by default. 122 123 Another often used option of `virtualenv`_ is ``-p``. With ``-p`` you 124 can tell `virtualenv`_ which Python executable to use as base for the 125 new sandbox. 126 127 You now can activate the sandbox by doing:: 128 129 $ source py27/bin/activate 130 (py27)$ 131 132 You will notice that the input prompt changes. 133 134 To deactivate the sandbox at any time, enter:: 135 136 (py27)$ deactivate 137 138 and the prompt will be the same as before the activation. 139 140 For the following steps make sure the sandbox is active. 141 142 143 Creating a working place 144 ======================== 145 146 In the sandbox we now create our real working 147 environment. To do this, we change to the sandbox and checkout the 148 sources of Kofa from the subversion server:: 149 150 (py27)$ cd mysandbox/ 151 (py27)$ svn co https://svn.waeup.org/repos/main/waeup.kofa/trunk kofa-trunk 152 153 where ``kofa-trunk`` is only a name we've chosen here to make clear 154 where the sources come from. In this case we are installing the Kofa base 155 package. 156 157 The command should fetch the Kofa base package sources for you and 158 put it in the directory ``kofa-trunk/``. 159 160 Now enter the new directory:: 161 162 (py27)$ cd kofa-trunk 163 164 165 You can run ``Kofa`` with a single client (useful for evaluation, 166 development, etc.) or with multiple clients running in parallel. The 167 latter setup is useful in productive environments with many thousands 168 users. We will cover both setup types one after another. 169 170 171 Part 1: Single Client Setup 172 *************************** 173 174 Preparing the build 175 =================== 176 177 In the sources directory (``kofa-trunk/``) you have to prepare the 178 project to fetch needed components (eggs), compile C-code parts, 179 etc. This steip will not touch any external projects:: 180 181 (py27)$ python bootstrap.py 182 183 This will generate some directories and the ``buildout`` script in 184 ``bin/`` for us. This step must be executed only once for each 185 instance. 186 187 You can now deactivate the sandbox:: 188 189 (py27)$ deactivate 190 191 Now we can do the real build by triggering:: 192 193 $ bin/buildout 194 195 If this is your first install of some Grok-related project, this step 196 will need some time as lots of sources have to be fetched, many 197 components must be compiled, etc. 198 199 This step must be redone whenever you change something in 200 ``buildout.cfg`` or ``setup.py``. 49 201 50 202 Note that if you have more than one sandbox for a Zope-based web … … 54 206 following contents:: 55 207 56 [buildout] 57 eggs-directory = /home/bruno/buildout-eggs 58 59 Running the `waeup.kofa` application 60 ====================================== 61 62 You can start Zope with the with the following command:: 63 64 $ bin/kofactl fg 65 66 Alternatively you can do: 67 68 $ bin/paster serve parts/etc/deploy.ini 69 70 If you now connect to port 8080 and log in with username 'grok', 71 password 'grok', you should be able to add the grok-based applications 208 [buildout] 209 eggs-directory = /home/bruno/buildout-eggs 210 211 212 Start the instance 213 ================== 214 215 You should be able now to start the created instance by doing:: 216 217 $ bin/zopectl fg 218 219 Alternatively you can do:: 220 221 $ bin/paster serve parts/etc/deploy.ini 222 223 The port numbers where Kofa is running on your server are defined in 224 buildout.cfg under [kofa_params]. 225 226 If you now point a browser to the right port on your server, for example :: 227 228 localhost:8080 229 230 you should get a login pop-up, where you can login as superuser with 231 ``grok`` and ``grok`` as username/password (Kofa base package only!). 232 233 You can stop the instance by pressing <CTRL-C>. 234 235 If you are connected and logged in, 236 you should be able to add the grok-based applications 72 237 (such as ``University``) from the menu. 73 238 … … 81 246 installed in the ``bin`` directory:: 82 247 83 $ bin/test 84 248 $ bin/test 249 250 251 Part 2: Deploying Kofa as ZEO install 252 ************************************* 253 254 Each ZEO install consists of at least one ZEO server and normally two 255 or more ZEO clients. While the ZEO server is meant to manage the ZODB 256 database for clients, the clients connect to the outside world, listen 257 for request and do the real dataprocessing. 258 259 We prepared a `buildout` configuration that sets up one server 260 configuration and two client configs. This configuration is in 261 ``buildout-zeo.cfg``. 262 263 Generating the ZEO setup 264 ======================== 265 266 To install Kofa ZEO-based you can run `buildout` with the given 267 (or your own) configuration file like this:: 268 269 $ ./bin/buildout -c buildout-zeo.cfg 270 271 This should generate all scripts necessary to run servers, clients, 272 etc. 273 274 Starting ZEO servers and clients 275 ================================ 276 277 First start the server:: 278 279 $ ./bin/zeo_server start 280 281 Clients can be started by doing:: 282 283 $ ./bin/zeo_client1 start 284 $ ./bin/zeo_client2 start 285 286 This will start both clients in daemon mode. 287 288 Instead of ``start`` you can, as usually, start an instance in 289 foreground (``fg``), etc. You know the drill. 290 291 292 Manually starting ZEO clients 293 ============================= 294 295 This is normally not neccessary. 296 297 ``zeo_clientN`` scripts are basically wrappers around calls to 298 ``bin/paster``. You can bypass this wrapper and start a client 299 'manually' like this:: 300 301 $ ./bin/paster serve --pid-file var/zeo1.pid --daemon \ 302 pars/etc/zeo1.ini 303 304 It is important to give a pid-file as paster otherwise can not start 305 different clients (they would all refer to the same pid file 306 `paster.pid` and refuse to start after the first client was started). 307 308 309 Setup (paramters, ports, etc.) 310 ============================== 311 312 By default the server will listen on port 8100 for requests from 313 localhost (not: from the outside world). 314 315 You can change ZEO server settings in the ``[zeo_server]`` section 316 of ``buildout-zeo.conf``. Run `buildout` afterwards. 317 318 The clients will listen on port 8081 and 8082. You can change settings 319 in ``etc/zeo1.ini.in`` and ``etc/zeo2.ini.in`` respectively. Run 320 buildout after any change. 321 322 If you want to change the paster wrapper for any zeo client, you can 323 edit ``etc/zeo1.conf`` and/or ``etc/zeo2.conf``. Run buildout 324 afterwards. 325 326 327 Creating new clients 328 ==================== 329 330 You want more clients to be created by buildout? Easy. Three steps are 331 neccessary. 332 333 1. Create config files in etc/ 334 ------------------------------ 335 336 Each client needs two configuration files: 337 338 - ``etc/zeoN.conf`` 339 configuring the paster wrapper 340 341 - ``etc/zeoN.ini`` 342 configuring the runtime config, ports, etc. 343 344 Just copy over these files from the already existing zeo1/zeo2 files 345 and replace ``zeo1`` or ``zeo2`` with your new name. 346 347 2. Update buildout-zeo.cfg 348 -------------------------- 349 350 Here, inside ``buildourt-zeo.cfg`` also three steps are needed. 351 352 * 2.1. Create new .ini and .conf entries 353 354 The .conf and .ini files in etc/ are only templates that have to be 355 generated in their really used final location. In buildout-zeo.cfg 356 you can care for this by creating a new ``[zeoN_ini]`` and 357 ``[zeoN_conf]`` option (replacing ``N`` with a number, of course). 358 359 Just copy over existing entries and replace the mentions of ``zeo1`` 360 or ``zeo2`` by your ``zeoN``. 361 362 * 2.2. Create a new ``zeo_clientN`` entry 363 364 Then you have to create an entry that will generate the 365 ``zeo_clientN`` script. Again, just copy over an existing 366 ``[zeo_client1]`` entry and replace ``1`` withg your client number. 367 368 * 2.3. Register the new sections in ``[buildout]`` section 369 370 When done with the above: add the new section in ``[buildout]``:: 371 372 [buildout] 373 ... 374 <old entries...> 375 ... 376 zope_conf_zeo_5 377 zeo5_ini 378 zeo_client5 379 380 depending on how you named your new sections. 381 382 3. Rerun ``buildout`` 383 --------------------- 384 385 When adding or removing client/server instances, make sure to stop all 386 running servers/clients before rerunning buildout. 387 388 To activate the new setup, rerun buildout:: 389 390 $ bin/buildout -c buildout-zeo.cfg 391 392 This should generate any new clients and remove older ones or just 393 update configuration files. 394 395 396 Considerations 397 ============== 398 399 There are some things in the current buildout-zeo.cfg we might do not 400 want. It extends the regular ``buildout.cfg`` so that we do not have 401 to repeat most sections but the ``parts`` in ``[buildout]`` have to be 402 listed. 403 404 We need, however, not everything with a ZEO-deploy that is listed in a 405 default buildout. We might do not need docs, no profiling, etc. Also a 406 regular non-ZEO kofactl might not make to much sense. Therefore all 407 this might be subject to changes. 408 409 .. _Debian: http://www.debian.org/ 410 .. _Grok: http://grok.zope.org/ 411 .. _Python: http://www.python.org/ 412 .. _Ubuntu: http://www.ubuntu.com/ 413 .. _virtualenv: http://www.virtualenv.org/en/latest/ 414 .. _WAeUP: https://www.waeup.org/ 415 .. _Zope: http://www.zope.org/ 416 .. _zc.buildout: http://cheeseshop.python.org/pypi/zc.buildout -
main/waeup.kofa/trunk/docs/source/developerdocs/developernotes.rst
r7818 r11386 10 10 =========================== 11 11 12 The installation is described for Linux-based computers. 13 14 Preparing the system 15 -------------------- 16 17 To create a working copy of the WAeUP.Kofa we recommend use of 18 `virtualenv`. You, however, need also some basic libraries, a C 19 compiler and some things more. 20 21 What you need (Debian/Ubuntu package names in brackets): 22 23 * Python 2.6 (python2.6) 24 25 Currently, also Python2.5 is supported but we want to make use of 26 some of the 2.6 goodies in the future. 27 28 29 * Python 2.6 development files (python2.6-dev) 30 31 * A C-Compiler (gcc) 32 33 * The C library development files (libc6-dev) 34 35 * A subversion client (svn) 36 37 * enscript (enscript) [optional] 38 39 This is only needed if you want test coverage reports. 40 41 All these packages can be installed on Debian systems like this:: 42 43 # apt-get install python2.6 python2.6-dev python2.6-dbg \ 44 gcc libc6-dev svn enscript 45 46 Afterwards you should be able to enter:: 47 48 $ python2.6 49 50 at the commandline and get a Python prompt. Quit the interpreter 51 pressing <CTRL-D>. 52 53 Installing `virtualenv` 54 ----------------------- 55 56 We recommend use of `virtualenv` to create Python sandboxes where you 57 can run your code without touching any other installations. 58 59 If you don't already have ``easy_install`` available, you can find the 60 script to set it up on the `PEAK EasyInstall page`_. 61 62 .. _`PEAK EasyInstall page`: http://peak.telecommunity.com/DevCenter/EasyInstall#installing-easy-install 63 64 You need to download `ez_setup.py`_. Then, you run it like this to 65 install ``easy_install`` into your system Python:: 66 67 $ sudo python2.6 ez_setup.py 68 69 .. _`ez_setup.py`: http://peak.telecommunity.com/dist/ez_setup.py 70 71 This will make ``easy_install`` available to you. 72 73 .. note:: Sometimes you have ``easy_install`` installed but you need a 74 newer version of the underlying setuptools infrastructure to 75 make Grok work. You can upgrade setuptools with:: 76 77 $ sudo easy_install -U setuptools 78 79 Now you can install `virtualenv` by doing (as root):: 80 81 # easy_install-2.6 virtualenv 82 83 This step will fetch all needed sources from the internet and install 84 `virtualenv` locally in your Python2.6 installation. 85 86 87 Creating a sandbox 88 ------------------ 89 90 This step is only necessary (and recommended) if you installed 91 `virtualenv` before. 92 93 As a normal user you now can create a sandbox for your upcoming work 94 by:: 95 96 $ virtualenv --no-site-packages mysandbox 97 98 where ``mysandbox`` is a directory in the filesystem where your 99 sandbox will be created. `virtualenv` will also create this directory 100 for you. 101 102 By passing the ``no-site-packages`` switch we tell `virtualenv` to 103 provide us a clean environment without any extra-packages installed 104 systemwide. 105 106 If you have a look into the freshly created sandbox, you will notice 107 that in the ``bin/`` directory there is also 108 109 You now can activate the sandbox by doing:: 110 111 $ source mysandbox/bin/activate 112 113 You will notice that the input prompt changes. 114 115 To deactivate the sandbox at any time, enter:: 116 117 $ deactivate 118 119 and the prompt will be the same as before the activation. 120 121 For the following steps make sure the sandbox is active. 122 123 124 Creating a working place 125 ------------------------ 126 127 In the sandbox (or anywhere else) we now create our real working 128 environment. To do this, we change to the sandbox and checkout the 129 sources of the WAeUP.Kofa from the subversion server:: 130 131 $ cd mysandbox/ 132 $ svn co https://svn.waeup.org/repos/main/waeup.kofa/trunk waeup-trunk 133 134 where ``waeup-trunk`` is only a name we've chosen here to make clear 135 where the sources come from. 136 137 This command should fetch the sources of the WAeUP sources for you and 138 put it in the directory ``waeup-trunk/``. 139 140 Now enter the new directory:: 141 142 $ cd waeup-trunk 143 144 145 Preparing the build 146 ------------------- 147 148 In the sources directory (``waeup-trunk/``) you have to prepare the 149 project to fetch needed components (eggs), compile C-code parts, 150 etc. This steip will not touch any external projects:: 151 152 $ python2.6 bootstrap.py 153 154 This will generate some directories and the ``buildout`` script in 155 ``bin/`` for us. This step must be executed only once for each 156 instance. 157 158 Now we can do the real build by triggering:: 159 160 $ bin/buildout 161 162 If this is your first install of some Grok-related project, this step 163 will need some time as lots of sources have to be fetched, many 164 components must be compiled, etc. 165 166 This step must be redone whenever you change something in 167 ``buildout.cfg`` or ``setup.py``. 168 169 Afterwards we are ready to go. 170 171 172 Start the instance 173 ------------------ 174 175 You should be able now to start the created instance by doing:: 176 177 $ bin/zopectl fg 178 179 If you now point a browser to:: 180 181 localhost:8080 182 183 you should get a login pop-up, where you can login as superuser with 184 ``grok`` and ``grok`` as username/password. 185 186 If you want to change the default credentials, have a look into 187 ``buildout.cfg`` where the superuser password is determined. 188 189 You can stop the instance by pressing <CTRL-C>. 190 191 12 See :ref:`installing_linux` 192 13 193 14 Documentation … … 200 21 become both: executable (i.e. testable) examples and documentation. 201 22 202 Generating documentation203 ---------------------- --23 Building documentation 24 ---------------------- 204 25 205 We use the excellent `Sphinx <http://sphinx.pocoo.org/>`_ Python 206 documentation generator to generate the docs as HTML pages. 207 208 The documentation of the :mod:`waeup.kofa` project can easily be 209 created doing:: 210 211 $ bin/waeupdocs 212 213 This will create a tree of HTML pages in 214 ``parts/waeupdocs/waeup.kofa/build/waeup.kofa/`` which you can for 215 instance browse by pointing your browser to this location. 216 217 An 'official' place in internet for the whole docs is about to come 218 but not yet available. 219 26 See :ref:`building_documentation` 220 27 221 28 Writing documentation … … 225 32 at the same time. See the many .txt files in the :mod:`waeup.kofa` 226 33 package for examples. 227 228 34 229 35 Testing -
main/waeup.kofa/trunk/docs/source/userdocs/buildingdocs.rst
r7808 r11386 4 4 ************************************** 5 5 6 To build the documentation for :mod:`waeup.kofa`, please follow these steps: 6 We use the excellent `Sphinx <http://sphinx.pocoo.org/>`_ Python 7 documentation generator to generate the docs as HTML pages. 7 8 8 9 Prerequisites … … 16 17 ================== 17 18 18 After successful install go to the root dir, where `waeup.kofa` is 19 located. 19 The documentation of the :mod:`waeup.kofa` project can easily be 20 created doing:: 20 21 21 There run:: 22 $ bin/waeupdocs 22 23 23 $ ./bin/waeupdocs 24 This will create a tree of HTML pages in 25 ``docs/build/html`` which you can for 26 instance browse by pointing your browser to this location. 24 27 25 This will (re-)generate any needed docs. 26 27 The output can be found in ``docs/build/html``. 28 An 'official' place in internet for the whole docs is about to come 29 but not yet available. 28 30 29 31 Actually, ``waeupdocs`` is only a wrapper script around the real main … … 37 39 Run:: 38 40 39 $ ./bin/sphinx-build --help41 $ bin/sphinx-build --help 40 42 41 43 to get a list of options available. … … 52 54 and more with a short explanation for each format. 53 55 54 55 56 Building PDF docs 56 57 =================
Note: See TracChangeset for help on using the changeset viewer.