Differences between revisions 38 and 39
Revision 38 as of 2011-01-01 23:47:17
Size: 12461
Comment: added chmod+X on inc back in
Revision 39 as of 2011-01-01 23:51:53
Size: 12532
Comment: two more directories with permission problems
Deletions are marked like this. Additions are marked like this.
Line 115: Line 115:
sudo chmod o+x html/inc ; sudo chmod o+r html/inc/* sudo chmod o+x html/inc
sudo chmod o+r html/inc/*
sudo chmod o+x html/languages/
sudo chmod o+x html/languages/compiled

This tutorial will help you create BOINC project with Debian server without using virtual images provide from BOINC. See BOINC/Server for an overview on BOINC-Server with Debian related issues. For an overview and guide on how to compile the BOINC package from the pkg-boinc git repository, see BOINC/Development/GitUsage.

To see more info about how to install and config BOINC server, please look at BOINC project wiki and the "See also" section on this page.

Install BOINC Server

Installation according to the books - without the Debian server package

  1. Install BOINC server dependencies :

    sudo apt-get install subversion build-essential apache2 php5 mysql-server php5-gd php5-cli php5-mysql python-mysqldb libtool automake autoconf pkg-config libmysql++-dev libssl-dev
  2. Create a user and a group for BOINC and add www-data to that group :

    sudo addgroup  --system  boincadm
    sudo adduser www-data boincadm
  3. Download BOINC source :

    svn co http://boinc.berkeley.edu/svn/branches/server_stable boinc
  4. Compile BOINC :

    cd boinc
    ./_autosetup
    ./configure --disable-client
    make

Installation with the Debian server package

  1. Install boinc-server package from unstable :

    sudo apt-get install boinc-server
  2. Add www-data user to boincadm group : sudo adduser www-data boincadm next upload will perform this in the postinst

Project-specific configuration

The project-specific bits should probably better be project-specific, indeed. One would then need a Debian package for every project. One such could be prepared for every example provided with the BOINC source tree.

This has not yet been addressed.

Create and config BOINC project

The following needs to be performed for every project, with or without the Debian BOINC server package. In the following we will work on a single BASH shell. This allows us to use mostly self-explanatory variables to help your local adaptation.

Secret words

Please define the password to be used to receive write access to your BOINC database. And also specify the name of the project.

pw=MYSQLPASSWORDFORBOINCUSER
dbprojectname=boinctest

Create MySQL database for BOINC project

With the variables defined before, you can just copy and pasted the code below:

if ! echo "DROP USER 'boincadm'@'localhost'" | mysql -u root -p; then
   echo "If the removal of the previous user fails because the user is not existing, then this does not matter. Other errors would be required a manual removal."
fi
cat <<EOMYSQL | mysql -u root -p mysql
DROP DATABASE IF EXISTS $dbprojectname;
CREATE DATABASE IF NOT EXISTS $dbprojectname;
CREATE USER 'boincadm'@'localhost' IDENTIFIED BY '$pw';
GRANT ALL PRIVILEGES ON $dbprojectname.* TO 'boincadm'@'localhost';
EOMYSQL

The passwords requested are that of the root user's for accessing mysql.

Create project

Please replace a.b.c.d with your full hostname or your server's IP address. If you only have dynamic IP addresses, then this is unfortunate, but investigate the service of dyndns.org to help out.

hosturl=http://a.b.c.d
fileprojectname=$dbprojectname
niceprojectname="BoincTestProject@Home"
installroot=/var/tmp/boinc

Installation according to the books - without the Debian server package

The installation is expected to happen from within the BOINC source tree.

[ -d "$installroot" ] || sudo mkdir -p "$installroot"
sudo ./tools/make_project --url_base "$hosturl" --db_name "$dbprojectname" --db_user boincadm  --db_passwd "$pw" --drop_db_first  --project_root /var/www/boinc/$fileprojectname "$fileprojectname" "$niceprojectname"

Installation with the Debian server package

If you use boinc-server package you need to use this command instead:

[ -d "$installroot" ] || sudo mkdir "$installroot"
sudo PYTHONPATH=$PYTHONPATH:/usr/share/pyshared/Boinc/ /usr/share/boinc-server/tools/make_project --url_base "$hosturl" --db_name "$dbprojectname" --db_user boincadm  --db_passwd "$pw" --drop_db_first  --project_root "$installroot"/"$fileprojectname" --srcdir /usr/share/boinc-server/ "$fileprojectname" "$niceprojectname"

The '--test_app' flag is omitted to help the understanding of the setup and since for Debian the required example_app is not compiled by default in the current version (6.12.8-2) of the package.

Continue - with or without the Debian BOINC server package

  1. Change files and directories permission:

    cd "$installroot"/"$fileprojectname"
    sudo chown root:boincadm  -R .
    sudo chmod g+w -R .
    sudo chmod 02770 -R upload html/cache html/inc html/languages html/languages/compiled html/user_profile
    If those permissions are sufficient depends on the user the the web service runs with. For Debian, running apache as user www-data, the include files need to be accessible. Those they should be with www-data added to the group boincadm with those files group accessible and group writable. However, there seem to be

    some remaining issues. To circumvent them, run

    sudo chmod o+x html/inc
    sudo chmod o+r html/inc/*
    sudo chmod o+x html/languages/
    sudo chmod o+x html/languages/compiled
  2. Add project cronjob:

    sudo crontab -e

    Then add this line to editor appear after run command above

    0,5,10,15,20,25,30,35,40,45,50,55 * * * * /var/boinc/testproj/bin/start --cron

    Verify that the cron entry was indeed accepted

    sudo crontab -l
  3. Config password for BOINC server administrative page:

    sudo htpasswd -c html/ops/.htpasswd USERNAME
  4. Config Apache to call BOINC server

    sudo cp ${fileprojectname}.httpd.conf  /etc/apache2/sites-available/
    sudo a2ensite  ${fileprojectname}.httpd.conf 
    sudo /etc/init.d/apache2 reload

Configure and start BOINC demons

Please stay in that project directory and just use the default configuration as a start.

  1. Read information from file 'project.xml' and put into the database

    sudo bin/xadd

    The tool xadd configures the project by parsing the 'project.xml' file. That 'project.xml' file initially only lists the most common platforms. Then it mentions the application that should be supported, which is 'uppercase'.

  2. add the binary to be distributed to the clients. For the applications in 'project.xml', a folder in the 'apps' directory must be created and the respective binary be placed into that.

    to be written, this is just guesswork for the very moment.
    sudo mkdir apps/uppercase
    sudo chown root:boincadm apps/uppercase
    sudo chmod 770 apps/uppercase
    # works for the Debian boinc-server package:
    sudo cp /usr/lib/boinc-server/apps/upper_case apps/uppercase/uppercase_$(arch)-pc-linux-gnu
    # copy it from your source directory if not running that package

    The $(arch) identifies the platform that this installation is performed on and consequently that the binary in /usr/lib/boinc-server is compiled for. The information on the availability of that binary needs to be communicated to the database by executing the update_versions tool by a mere

    sudo PYTHONPATH=/usr/share/boinc-server/py bin/update_versions
    .
  3. start the demons

    sudo bin/start

    Running start, this should show something like

    Entering ENABLED mode
    Starting daemons
      Starting daemon: feeder -d 3
      Starting daemon: transitioner -d 3
      Starting daemon: file_deleter -d 3

    and after some academic minute the shell prompt should return. The UNIX tool top should just show your regular BOINC work units (assuming that your server remains a good client until it is busy). A "ps aux | tail -20" should list something like

    root      4551  0.4  2.1  46864 21776 ?        S    10:33   0:00 feeder -d 3
    root      4553  0.0  0.2  35312  3004 ?        S    10:33   0:00 transitioner -d 3
    root      4555  0.0  0.2  27336  2240 ?        S    10:33   0:00 file_deleter -d 3
    Something lets me think that those processes should better run as "boincadm" than via 'sudo', but, well, let's be happy for now.

Test web interface

The web site should now be accessible. It should be available as an alias "$fileprojectname", please look it up in "/etc/apache2/sites-enabled/${filesprojectname}.httpd.conf". You will find the automated home page to need some further manual adjustments - which does not really encourage to update the server version too frequently, we presume.

If the home page does not show up then there may be some missing file or some bogus file permission. The inspection of "/var/log/apache/error.log" should bring sufficient insights to fix the issue.

Add your own application

The only thing that counts to have is the application that helps your very personal task at hand. This will be addressed in the upcoming section. The section at hand will take one of the example projects.

When compiling the sources oneself

When building the

  1. Compile sample application :

    cd ~/boinc/samples/wrapper
    make
  2. Setup sample application :

    cd "$installroot"/"$fileprojectname"
    sudo ./html/ops/single_job_setup.php ~/boinc/samples

This 2nd step then demands to add two binaries to the local config.xml file, have those electronically signed by

sudo bin/update_versions

. Once done, one shall restart BOINC

sudo bin/stop
sudo bin/start

.

When starting from the Debian package

The wrapper application is not compiled by default. A the current (6.12.8-3) version of the Debian BOINC server package will redistribute that source code in /usr/share/doc/boinc-server. The Makefiles have been adjusted to all the direct compilation of that binary outside the source tree of BOINC.

Config clients

The project should now be ready to run a couple of work units. Please use any Linux BOINC client. The Debian boinc-client package will do. It needs to be Linux since our application was yet only prepared for this OS. The project URL is $hosturl/$fileprojectname.

Management of your own project

To be written.

Why to use (or not to use) the Debian BOINC server package

The concept of the BOINC server package is slightly irritating in that it itself is not a working server but something from which a server infrastructure is generated. It provides all the binaries and header files for local developments and thus saves some considerable time to prepare such and ensures to have all the libraries in place that the community has determined to be of help.

The package is still too experimental to use in a production environment. But, hey, we will be getting there over time.

See also