| | 1 | [[TracNav(NuwaNav)]] |
| | 2 | [[PageOutline]] |
| | 3 | |
| | 4 | = NuWa Slave : automated build/test setup = |
| | 5 | |
| | 6 | Running a slave provides : |
| | 7 | * automatically updated and tested dybinst'allation |
| | 8 | * web interface to the status of the installation including history of build/test status |
| | 9 | |
| | 10 | = How to setup a slave = |
| | 11 | |
| | 12 | == Pre-requisites : python 2.5?, setuptools, bitten ( 0.6dev-r561 ) == |
| | 13 | |
| | 14 | Although bitten is installed by dybinst into nuwa python as part of the nosebit external, |
| | 15 | it is more logical to install this into your system python as the slave |
| | 16 | can then perform ''green-field'' dybinst builds without recourse to existing dybinst-allations. |
| | 17 | {{{ |
| | 18 | svn checkout http://svn.edgewall.org/repos/bitten/branches/experimental/trac-0.11@561 bitn |
| | 19 | cd bitn |
| | 20 | python setup.py develop ## probably with sudo |
| | 21 | }}} |
| | 22 | * more recent revisions of bitten have incompatibilites with the trac 0.11 master |
| | 23 | |
| | 24 | |
| | 25 | == Interactive Test Running of the slave == |
| | 26 | |
| | 27 | * Verify that '''bitten-slave''' is installed and in your PATH and is the expected ''standard'' version |
| | 28 | {{{ |
| | 29 | [blyth@belle7 ~]$ which bitten-slave |
| | 30 | /usr/bin/bitten-slave |
| | 31 | [blyth@belle7 ~]$ bitten-slave --version |
| | 32 | bitten-slave 0.6dev-r561 |
| | 33 | }}} |
| | 34 | |
| | 35 | * export dybinst into directory to be used for slave builds (you could use an existing dybinst-allation also) |
| | 36 | * interactive test run of the slave |
| | 37 | {{{ |
| | 38 | ./dybinst trunk slave |
| | 39 | }}} |
| | 40 | * this should fail complaining of lack of config in your {{{$HOME/.dybinstrc}}} |
| | 41 | |
| | 42 | * add or create {{{$HOME/.dybinstrc}}} containing connection credentials |
| | 43 | {{{ |
| | 44 | slv_buildsurl=http://dayabay.ihep.ac.cn/tracs/dybsvn/builds |
| | 45 | slv_username=slave |
| | 46 | slv_password=*** |
| | 47 | slv_loghost=http://your.address ## if you are able to publish logfiles |
| | 48 | }}} |
| | 49 | |
| | 50 | |
| | 51 | If your credentials are correct the expected startup messages are : |
| | 52 | {{{ |
| | 53 | [blyth@cms01 trunk]$ ./dybinst trunk slave |
| | 54 | Updating existing installation directory installation/trunk/dybinst. |
| | 55 | Updating existing installation directory installation/trunk/dybtest. |
| | 56 | |
| | 57 | |
| | 58 | Mon Aug 9 16:12:04 CST 2010 |
| | 59 | Start Logging to /data/env/local/dyb/trunk/dybinst-20100809-161204.log (or dybinst-recent.log) |
| | 60 | |
| | 61 | |
| | 62 | Starting dybinst commands: slave |
| | 63 | |
| | 64 | Stage: "slave"... |
| | 65 | |
| | 66 | |
| | 67 | dybinst-slave invoking : /data/env/local/dyb/trunk/installation/trunk/dybinst/scripts/slave.sh trunk |
| | 68 | |
| | 69 | Contacting the master instance, this will take a while. Go get muffins... |
| | 70 | |
| | 71 | === slv-main : derive config /home/blyth/.bitten-slave/dybslv.cfg from source /home/blyth/.dybinstrc |
| | 72 | [INFO ] Setting socket.defaulttimeout : 15.0 |
| | 73 | [INFO ] Setting socket.defaulttimeout : 15.0 |
| | 74 | [DEBUG ] Sending POST request to 'http://dayabay.ihep.ac.cn/tracs/dybsvn/builds' |
| | 75 | [INFO ] No pending builds |
| | 76 | }}} |
| | 77 | |
| | 78 | |
| | 79 | Note that slave asked the master if there are any builds to do and got reply '''No pending builds''' , the default config is to |
| | 80 | ask the master every 5 mins if there is anything to do. |
| | 81 | |
| | 82 | |
| | 83 | In order for the master to instruct the slave to perform builds you must send the '''hostname''' to Simon : |
| | 84 | {{{ |
| | 85 | [blyth@belle7 ~]$ hostname |
| | 86 | belle7.nuu.edu.tw |
| | 87 | }}} |
| | 88 | who will inform add the slave to the master through the Trac Admin web interface. |
| | 89 | |
| | 90 | |
| | 91 | |
| | 92 | == Running the slave continuously == |
| | 93 | |
| | 94 | Supervisord is recommended to keep the slave running, |
| | 95 | * http://supervisord.org/ |
| | 96 | |
| | 97 | Install supervisord into your system python with easy_install or pip : |
| | 98 | {{{ |
| | 99 | easy_install supervisor |
| | 100 | }}} |
| | 101 | |
| | 102 | For tips on using supervisord, see : |
| | 103 | * http://dayabay.phys.ntu.edu.tw/tracs/env/browser/trunk/base/sv.bash |
| | 104 | * ( includes functions to setup redhat init.d scripts that restart supervisord and all its children when your machine is rebooted ) |
| | 105 | |
| | 106 | An example of the supervisord config used to keep the dybslv running : |
| | 107 | {{{ |
| | 108 | [program:dybslv] |
| | 109 | environment=HOME=/home/blyth,BITTEN_SLAVE=/usr/bin/bitten-slave,SLAVE_OPTS=--verbose |
| | 110 | directory=/data1/env/local/dyb |
| | 111 | command=/data1/env/local/dyb/dybinst -l dybinst-slave.log trunk slave |
| | 112 | redirect_stderr=true |
| | 113 | redirect_stdout=true |
| | 114 | autostart=true |
| | 115 | autorestart=true |
| | 116 | priority=999 |
| | 117 | user=blyth |
| | 118 | }}} |
| | 119 | |
| | 120 | |
| | 121 | |
| | 122 | |
| | 123 | |
| | 124 | |