Differences between revisions 3 and 5 (spanning 2 versions)
Revision 3 as of 2011-06-25 08:34:14
Size: 7350
Editor: dhananjay
Comment: Added screen outputs, and version numbers to the app.
Revision 5 as of 2011-06-26 18:49:15
Size: 10254
Comment: second round of comments
Deletions are marked like this. Additions are marked like this.
Line 3: Line 3:
= Add an example app to BOINC project. =

Install the application package, boinc-app-examples. The example application used in the document is upper_case, which converts text inside a file to uppercase.

== Create a directory and add to app to project configuration. ==

{{{
% mkdir $installroot/$fileprojectname/apps/upper_case
% cp /usr/lib/boinc-server/apps/upper_case apps/uppercase/uppercase_$(app_ver)_$(arch)-pc-linux-gnu
}}}
= 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 Wapper application. (Dhananjay, please describe also that)

== Add a single example app for a single archictecture to the BOINC project ==

Install the application package, boinc-app-examples. The example application used in the document is ''upper_case'', which converts text inside a file to all capitals.

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

This directory becomes an intrinsic part of your project.

(D., please also use the bash or another BOURNE-compatible shell. sm)

{{{
$ mkdir $installroot/$fileprojectname/apps/upper_case
}}}
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.33 # adjust to the right version
$ boincplat=amd64-pc-linux-gnu # adjust to your architecture, maybe i686-pc-linux-gnu
$ cp /usr/lib/boinc-server/apps/upper_case apps/uppercase/uppercase_${appver}_${boincplat}
}}}
Upstream lists official BOINC architectures [[http://boinc.berkeley.edu/trac/wiki/BoincPlatforms|here]].


== 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.

== Inform local database of available binaries ==
Line 16: Line 44:
{{{ (you have used "upper_case" below and "uppercase" above ?!?!?)

{{{
if [ -z "$installroot" -o -z "$fileprojectname" ]; then
   echo 'Variables $installroot ('$installroot ') and $fileprojectname (' $fileprojectname ') are both required.'
elif [ -d "$installroot/$fileprojectname" ]; then
   cat << EOPROJECTXML > $installroot/$fileprojectname/project.xml
Line 21: Line 55:
}}}

and run
{{{
EOPROJECTXML
fi
}}}

change to the projectroot {{{
cd "$installroot/$fileprojectname"
}}}
and run {{{
Line 161: Line 199:
(can you explain what this means? why did the i686/amd64 entries not show anything?) Please also show the respective entries in the database, e.g. with {{{
echo 'select * from ... | mysql -u $host -p
}}}
sm)
Line 162: Line 205:
Line 164: Line 208:
{{{
./bin/sign_executable apps/upper_case/upper_case_$(arch)-pc-linux-gnu code_sighn_private_key_file
te >> apps/upper_case/upper_case_$(arch)-pc-linux-gnu.sig
(Is this a different upper_case folder? If not, where is the version of the upper_case/uppercase filenames? sm)

{{{
./bin/sign_executable apps/upper_case/upper_case_$(boincplat) code_sign_private_key_file
te >> apps/upper_case/upper_case_$(boincplat).sig
Line 190: Line 236:
Line 218: Line 263:
== Start the project. == = Start the project. =
Line 221: Line 266:

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

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 Wapper application. (Dhananjay, please describe also that)

Add a single example app for a single archictecture to the BOINC project

Install the application package, boinc-app-examples. The example application used in the document is upper_case, which converts text inside a file to all capitals.

Create a directory and add the app to project configuration.

This directory becomes an intrinsic part of your project.

(D., please also use the bash or another BOURNE-compatible shell. sm)

$ mkdir $installroot/$fileprojectname/apps/upper_case

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.33 # adjust to the right version
$ boincplat=amd64-pc-linux-gnu # adjust to your architecture, maybe i686-pc-linux-gnu
$ cp /usr/lib/boinc-server/apps/upper_case apps/uppercase/uppercase_${appver}_${boincplat}

Upstream lists official BOINC architectures here.

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.

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 ?!?!?)

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

change to the projectroot

cd "$installroot/$fileprojectname"

and run

./bin/xadd

The screen output will look like this,

Processing <Platform#None windows_intelx86> ...
  Committed <Platform#1 windows_intelx86> ; values:
{'_dirty': False,
 '_lazy_lookups': {},
 'create_time': 1308990279L,
 'deprecated': 0,
 'id': 1L,
 'name': 'windows_intelx86',
 'user_friendly_name': 'Microsoft Windows (98 or later) running on an Intel x86-compatible CPU'}
Processing <Platform#None windows_x86_64> ...
  Committed <Platform#2 windows_x86_64> ; values:
{'_dirty': False,
 '_lazy_lookups': {},
 'create_time': 1308990279L,
 'deprecated': 0,
 'id': 2L,
 'name': 'windows_x86_64',
 'user_friendly_name': 'Microsoft Windows running on an AMD x86_64 or Intel EM64T CPU'}
Processing <Platform#None i686-pc-linux-gnu> ...
  Committed <Platform#3 i686-pc-linux-gnu> ; values:
{'_dirty': False,
 '_lazy_lookups': {},
 'create_time': 1308990279L,
 'deprecated': 0,
 'id': 3L,
 'name': 'i686-pc-linux-gnu',
 'user_friendly_name': 'Linux running on an Intel x86-compatible CPU'}
Processing <Platform#None x86_64-pc-linux-gnu> ...
  Committed <Platform#4 x86_64-pc-linux-gnu> ; values:
{'_dirty': False,
 '_lazy_lookups': {},
 'create_time': 1308990279L,
 'deprecated': 0,
 'id': 4L,
 'name': 'x86_64-pc-linux-gnu',
 'user_friendly_name': 'Linux running on an AMD x86_64 or Intel EM64T CPU'}
Processing <Platform#None powerpc-apple-darwin> ...
  Committed <Platform#5 powerpc-apple-darwin> ; values:
{'_dirty': False,
 '_lazy_lookups': {},
 'create_time': 1308990279L,
 'deprecated': 0,
 'id': 5L,
 'name': 'powerpc-apple-darwin',
 'user_friendly_name': 'Mac OS X 10.3 or later running on Motorola PowerPC'}
Processing <Platform#None i686-apple-darwin> ...
  Committed <Platform#6 i686-apple-darwin> ; values:
{'_dirty': False,
 '_lazy_lookups': {},
 'create_time': 1308990279L,
 'deprecated': 0,
 'id': 6L,
 'name': 'i686-apple-darwin',
 'user_friendly_name': 'Mac OS 10.4 or later running on Intel'}
Processing <Platform#None x86_64-apple-darwin> ...
  Committed <Platform#7 x86_64-apple-darwin> ; values:
{'_dirty': False,
 '_lazy_lookups': {},
 'create_time': 1308990279L,
 'deprecated': 0,
 'id': 7L,
 'name': 'x86_64-apple-darwin',
 'user_friendly_name': 'Intel 64-bit Mac OS 10.5 or later'}
Processing <Platform#None sparc-sun-solaris2.7> ...
  Committed <Platform#8 sparc-sun-solaris2.7> ; values:
{'_dirty': False,
 '_lazy_lookups': {},
 'create_time': 1308990279L,
 'deprecated': 0,
 'id': 8L,
 'name': 'sparc-sun-solaris2.7',
 'user_friendly_name': 'Solaris 2.7 running on a SPARC-compatible CPU'}
Processing <Platform#None sparc-sun-solaris> ...
  Committed <Platform#9 sparc-sun-solaris> ; values:
{'_dirty': False,
 '_lazy_lookups': {},
 'create_time': 1308990279L,
 'deprecated': 0,
 'id': 9L,
 'name': 'sparc-sun-solaris',
 'user_friendly_name': 'Solaris 2.8 or later running on a SPARC-compatible CPU'}
Processing <Platform#None sparc64-sun-solaris> ...
  Committed <Platform#10 sparc64-sun-solaris> ; values:
{'_dirty': False,
 '_lazy_lookups': {},
 'create_time': 1308990279L,
 'deprecated': 0,
 'id': 10L,
 'name': 'sparc64-sun-solaris',
 'user_friendly_name': 'Solaris 2.8 or later running on a SPARC 64-bit CPU'}
Processing <Platform#None powerpc64-ps3-linux-gnu> ...
  Committed <Platform#11 powerpc64-ps3-linux-gnu> ; values:
{'_dirty': False,
 '_lazy_lookups': {},
 'create_time': 1308990279L,
 'deprecated': 0,
 'id': 11L,
 'name': 'powerpc64-ps3-linux-gnu',
 'user_friendly_name': 'Sony Playstation 3 running Linux'}
Processing <Platform#None anonymous> ...
  Committed <Platform#12 anonymous> ; values:
{'_dirty': False,
 '_lazy_lookups': {},
 'create_time': 1308990279L,
 'deprecated': 0,
 'id': 12L,
 'name': 'anonymous',
 'user_friendly_name': 'anonymous'}
Processing <App#None upper_case> ...
/var/tmp/boinc/test2/py/Boinc/db_base.py:63: Warning: Field 'host_scale_check' doesn't have a default value
  cursor.execute(command)
  Committed <App#1 upper_case> ; values:
{'_dirty': False,
 '_lazy_lookups': {},
 'beta': 0,
 'create_time': 1308990279L,
 'deprecated': 0,
 'homogeneous_redundancy': 0,
 'host_scale_check': 0,
 'id': 1L,
 'min_avg_pfc': 1.0,
 'min_version': 0L,
 'name': 'upper_case',
 'target_nresults': 0,
 'user_friendly_name': 'upperCASE',
 'weight': 1.0}

The xadd tool will parse the project.xml and will put the configurations to the database.

(can you explain what this means? why did the i686/amd64 entries not show anything?) Please also show the respective entries in the database, e.g. with

echo 'select * from ... | mysql -u $host -p

sm)

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)

./bin/sign_executable apps/upper_case/upper_case_$(boincplat) code_sign_private_key_file
te >> apps/upper_case/upper_case_$(boincplat).sig

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

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.

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.