~ salmonella-environment-setup (master) /README


  1== Introduction
  2
  3This file contains instructions on how to build CHICKEN and run
  4salmonella using salmonella-run-publish.
  5
  6To run tests for multiple settings (e.g., branches, C toolchains,
  7different build options etc.), we use a wrapper script:
  8run-salmonella.sh in this directory.
  9
 10
 11== Requirements
 12
 13The following system tools are required:
 14
 15* bzip2
 16* GNU make
 17* A working C toolchain
 18* tar
 19* svn
 20* git
 21* dot (from GraphViz)
 22* gzip
 23
 24The following CHICKEN tools are required
 25
 26* salmonella
 27* salmonella-html-report
 28* salmonella-feeds
 29* salmonella-diff
 30* salmonella-run-publish
 31* henrietta-cache (optional -- only for salmonella-run-publish's
 32  local-mode)
 33
 34
 35The following directory layout is assumed by run-salmonella.sh (see
 36"Initial setup" for more details):
 37
 38$HOME/local/chicken-4
 39    CHICKEN 4 installation directory (in case CHICKEN 4 tools are used)
 40
 41$HOME/local/chicken-5
 42    CHICKEN 5 installation directory (used by default)
 43
 44By default CHICKEN 5 tools are going to be used.  If you want to use
 45CHICKEN 4 tools instead, set the `CHICKEN_TESTS_MAJOR_VERSION'
 46environment variable to 4.
 47
 48
 49The following directory layout will be generated by run-salmonella.sh
 50after tests:
 51
 52$HOME/salmonella/build
 53    Work directory for salmonella builds
 54
 55$HOME/salmonella/reports
 56    Salmonella reports, RSS feeds and log files to be served by a web
 57    server.
 58
 59
 60=== Account conventions for dedicated salmonella machines
 61
 62run-salmonella.sh can be used on regular systems with regular user
 63accounts.  For dedicated salmonella machines we follow a convention of
 64using the following user accounts:
 65
 66* chicken: regular user account to run salmonella jobs.  This user
 67  runs run-salmonella.sh via cron.
 68
 69* awful: in case the salmonella machine serves the salmonella reports
 70  and assorted salmonella log files generated by the test jobs, the
 71  web server conventionally runs under the awful account, which can be
 72  a system account.
 73
 74
 75== Initial setup
 76
 77The instructions below apply if you want to run salmonella jobs using
 78CHICKEN 5 tools.
 79
 80
 81=== Install CHICKEN 5 & required eggs
 82
 83run-salmonella.sh will look for CHICKEN 5 tools in
 84$HOME/local/chicken-5.  I usually install CHICKEN setting
 85PREFIX=$HOME/local/chicken-<version> and create a symlink
 86chicken-5 -> chicken-<version> in $HOME/local (that eases
 87updating CHICKEN).
 88
 89Once CHICKEN 5 is installed, we can use it to install the required
 90eggs.  At the moment some eggs are only available in git:
 91
 92$ $HOME/local/chicken-5/bin/chicken-install salmonella-html-report salmonella-diff salmonella-feeds
 93
 94$ git clone https://github.com/mario-goulart/salmonella-run-publish
 95$ cd salmonella-run-publish
 96$ $HOME/local/chicken-5/bin/chicken-install
 97
 98
 99== Configuring salmonella jobs
100
101run-salmonella.sh will look for configuration files (files with a
102`.conf' sufix) in the `conf' directory of the local copy of the
103salmonella-environment-setup repository.  The configuration files are
104Scheme files that usually set salmonella-run-publish parameters.
105
106run-salmonella.sh will also read `settings.sh' files from the
107configuration directory.  These files will be load shell settings
108("source") in the current environment.  That can be useful if you want
109to set environment variables.  run-salmonella.sh will look for
110settings files in the following directories, according to the
111following order:
112
113* $HOME/src/salmonella-environment-setup/conf/shell-settings/${OS}
114* $HOME/src/salmonella-environment-setup/conf/shell-settings/${OS}-${ARCH}
115
116Where ${OS} is the value returned by (software-version) and ${ARCH} is
117the value returned by (machine-type) by CHICKEN.
118
119
120== Running run-salmonella.sh
121
122After you've got everything installed and configured, you can call
123run-salmonella.sh with the configuration file names (without
124extension) as arguments.  Example:
125
126$HOME/src/salmonella-environment-setup/run-salmonella.sh chicken-5 chicken-5-clang
127
128This will make run-salmonella.sh pick the chicken-5.conf and
129chicken-5-clang.conf files and shell settings files for ${OS} and
130${ARCH}.
131
132To run those jobs periodically, just configure a crontab entry for the
133run-salmonella.sh command line.
134
135
136== Setting up the web server
137
138Setting up the web server is optional, as it is possible to generate
139reports on a system (which doesn't run the web server) and serve them
140from another system.
141
142The web server is a custom hack to serve salmonella reports out of
143compressed tar files.  To install it, run:
144
145$ chicken-install awful-salmonella-tar
146
147The default configuration of the web server in the
148salmonella-environment-setup repository (`awful' directory) assumes
149some conventions:
150
151* The web server runs under the `awful' user account.
152
153* Web server logs go to /var/log/awful (the awful user must be able to
154  write to that directory).
155
156* HTML files extracted from salmonella reports in compressed tar
157  format are cached under /var/cache/awful-salmonella-tar (the awful
158  user must be able to write to that directory).
159
160* Configuration files are conventionally kept at /etc/awful (normally
161  it contains symlinks to actual files in the local copy of the
162  salmonella-environment-setup repository).  A typical configuration
163  for the web server can be set up like (assuming
164  salmonella-environment-setup is cloned under
165  $HOME/src/salmonella-environment-setup):
166
167  $ mkdir /etc/awful
168  $ cd /etc/awful
169  $ ln -s $HOME/src/salmonella-environment-setup/awful/awful-salmonella-tar.conf awful.conf
170  $ ln -s $HOME/src/salmonella-environment-setup/awful/privileged.conf
171
172The default configuration expects to serve files from
173/home/chicken/salmonella/reports (that's hardcoded in awful.conf).
174Since web bots can scan salmonella reports and request a lot of files,
175it's recommended to install the robots.txt file in the web server's
176document directory:
177
178$ cd /home/chicken/salmonella/reports
179$ ln -s /home/chicken/src/salmonella-environment-setup/awful/robots.txt
180
181How to start and stop the server is system-dependent and not covered
182by this document.  The `awful' directory in the
183salmonella-environment-setup repository contains some assorted scripts
184for some systems).
Trap