THESE PAGES ARE STILL UNDER DEVELOPMENT

This page is about deploying a test application with BOINC/Debian, and this will replace add functionality section of the BOINC/ServerGuide page.

1. Add scientific applications to be distributed

The BOINC project managers need to provide all the binaries for all the supported platforms. This is of some difficulty especially for those platforms that one does not own oneself. This page first demonstrates the workflow using xadd for a single platform. The second half of this page is dedicated to employing the binaries Debian provides for the purpose.

Another page describes how to perform the equivalent installation for the Wrapper application.

1.1. Add a single example app for a single architecture to the BOINC project

1.1.1. Get binary of local platform

Install the application package, boinc-app-examples:

apt-get install boinc-app-examples

The example application used in the document is upper_case, which converts text inside a file to all capitals. Have a quick look that it is truly contained, since this walk-through may already be outdated (we are all volunteers):

$ dpkg -L boinc-app-examples | grep upper_case
/usr/lib/boinc-server/apps/upper_case

1.1.2. Create a directory and add the app to project configuration.

This directory becomes an intrinsic part of your project.

[ -z "$installroot" -o -z "$fileprojectname" ] || . ~/.boinc_test.conf
appdir="$installroot"/"$fileprojectname"/apps/upper_case
sudo mkdir "$appdir"

Copy the file from the installed "boinc-app-examples" Debian package into that directory and rename it to distinguish versions and architectures. In our case, the app_ver variable is that of the BOINC server, the second part of the filename is that of the BOINC architecture.

appver=6.12 # adjust to the right version, only have single "."
boincplat=amd64-pc-linux-gnu # adjust to your architecture, maybe i686-pc-linux-gnu
sudo cp $(dpkg -L boinc-app-examples | grep upper_case) $appdir/uppercase_${appver}_${boincplat}

Upstream lists official BOINC architectures here.

1.2. Use the Debian-provided script to install binaries for multiple platforms

(D.: ... I am refering to /usr/share/doc/boinc-server-maker/examples/fetch_example_applications.sh , which is coming with the BOINC-server-maker package. Please amend that to fit the structure above described. sm)

When applications do not have dependencies non-standard dynamically loaded libraries (test with the tool 'ldd'), then one can use the regular binary from Debian. This should then be functional also for non-Debian/Ubuntu platforms. The boinc-server-maker package provides a shell script that downloads the Debian packages of a given name (the default is the boinc-app-examples package) and unpacks it to retrieve the binary from there.

To be implemented: this will create a structure as described above for the single application.

2. Inform local database of available binaries

Now add following lines to project.xml in the project root

(you have used "upper_case" below and "uppercase" above ?!?!?)

[ -z "$installroot" -o -z "$fileprojectname" ] || . ~/.boinc_test.conf
if [ -z "$installroot" -o -z "$fileprojectname" ]; then
   echo 'Variables $installroot (' $installroot ') and $fileprojectname (' $fileprojectname ') are both required.'
elif [ -d "$installroot/$fileprojectname" ]; then
   (cat << EOPROJECTXML
<boinc>
 <app>
  <name>upper_case</name>
  <user_friendly_name>upperCASE</user_friendly_name>
 </app>
</boinc>
EOPROJECTXML
) | sudo tee "$installroot"/"$fileprojectname"/project.xml
fi

Change to the projectroot

cd "$installroot"/"$fileprojectname"

and run initiate the addition of the binary found in the directory structure to the local database

sudo bin/xadd

The local screen output will be similar to

{{{Processing <App#None upper_case> ... /var/tmp/boinc/boinctest/py/Boinc/db_base.py:63: Warning: Field 'host_scale_check' doesn't have a default value

{'_dirty': False,

}}}

And when executing that line again, nothing happens:

# bin/xadd 
Processing <App#None upper_case> ...
  Skipped existing <App#None upper_case>

The file project.xml is not touched.

The database has now seen the application:

$ echo "select * from app" | mysql -u root -p $dbprojectname
Enter password: 
id      create_time     name            min_version  deprecated  user_friendly_name  homogeneous_redundancy  weight  beta    target_nresults min_avg_pfc     host_scale_check
1       1309734539      upper_case       0            0           upperCASE           0                       1       0       0               1               0

3. Sign the application binary

BOINC need to sign the application binaries before dispatch for security reasons.

(Is this a different upper_case folder? If not, where is the version of the upper_case/uppercase filenames? sm)

privateKeyfile="./keys/code_sign_private"
if [ -z "$appver" -o -z "$boincplat" ]; then
   echo "Please set appver and boincplat variables from above."
elif [ ! -r "$privateKeyfile" ]; then
   echo 'Have your private key ready as created during setup, expected at $privateKeyfile .'
else 
   sudo ./bin/sign_executable apps/upper_case/upper_case_${appver}_${boincplat} "$privateKeyfile" | sudo tee apps/upper_case/upper_case_${appver}_${boincplat}.sig
fi

Update the boinc database,

./bin/update_versions

and prompt yes when asked for confirmation.

Sample output:

  Found <App#1 upper_case> version 100 for <Platform#3 i686-pc-linux-gnu>: upper_case_1.00_i686-pc-linux-gnu
Using signature file /var/tmp/boinc/test2/apps/upper_case/upper_case_1.00_i686-pc-linux-gnu.sig
Copying upper_case_1.00_i686-pc-linux-gnu to /var/tmp/boinc/test2/download/upper_case_1.00_i686-pc-linux-gnu
Ready to commit 1 items:
    <AppVersion#None upper_case 100 i686-pc-linux-gnu>
Continue [Y/n]
Committed:
    <AppVersion#1 upper_case 100 i686-pc-linux-gnu>
Touched trigger file to make feeder re-read app_version table from database
Done

4. Add a Work Unit

A work unit is the portion of data that the project should be analyzed, a work unit has following parts, * Input file(s) * Work Unit template * Result Template

Create a test input file, with some text in $installroot/$fileprojectname/download/in

echo test string >> download/input_file

Copy the default work unit and result template for upper case application to the templates folder.

# The paths are to be changed in the next version of package, so watch out.
% cp /usr/share/doc/boinc-server-maker/examples/upper_case_* $installroot/$fileprojectname/templates/

and finally create the work,

cd $installroot/$fileprojectname
./bin/create_work -appname upper_case -wu_name test -wu_template templates/upper_case_wu -result_temp
late templates/upper_case_result input_file

This will create one work unit named test in the database.

5. Start the project.

Now its time to start the project, assuming we are still inside the project root,

./bin/start

And ./bin/status can be used to check status of the project.