Installing the Sakai Grid Demonstration

This is a simple Grid Demonstration for Sakai.  It installs GT 3.2 into Sakai and has a very simple service which does a certificate retrieval using myproxy.

It also is a good example of how to extend Sakai using a self-contained component.

Here are the steps to make it work (I do this on my mac and it works).

Install Sakai - you can either do the release or pull from CVS head using the instructions at   

      http://cvs.sakaiproject.org/release/1.0.rc2/ 

As an example, here is my ~/build.properties:

maven.repo.remote = http://www.ibiblio.org/maven/,http://cvs.sakaiproject.org/maven/
maven.tomcat.home = /Users/csev/dev/jakarta-tomcat-5.0.27/

You should have the prerequisites (Eclipse is not a pre-requisite).   I have untarred tomcat into /Users/csev/dev/jakarta-tomcat-5.0.27:
 
dhcp162:~/dev csev$ tar xfz keepzips/jakarta-tomcat-5.0.27.tar.gz 

  // Remove the ROOT webapp as Sakai takes it over
dhcp162:~/dev csev$ rm -r ~/dev/jakarta-tomcat-5.0.27/webapps/ROOT

I like to wipe out my tomcat from time to time just to make sure that the common/lib does not get polluted.

In this sample I will do it from CVS.  First I will just make Sakai work without the Grid, and then I will add the grid module and re-deploy Sakai in a second step.  My .ssh is set up exactly as described at the Sakai site:

dhcp162:~ csev$ cat ~/.ssh/config 
Host=sakai_anon_cvs
   user=sakai
   Hostname=cvs.sakaiproject.org
   IdentityFile=~/.ssh/sakai_anoncvs_dsa

 // Clean out my local maven repository in case there is a problem
dhcp162:~ csev$ mv .maven maven-old

     // Set up /usr/local - it is nice just to run tomcat as the user rather than root

dhcp162:~ csev$ sudo sh  
sh-2.05b# cd /usr/local/
sh-2.05b# mkdir sakai
sh-2.05b# chown csev.csev sakai
chown: separation of user and group with a period is deprecated
sh-2.05b# exit
dhcp162:~ csev$ ls -l
total 0
drwxr-xr-x   8 root  wheel  272 30 Jul 11:13 bin
drwxr-xr-x   2 csev  csev    68 24 Aug 18:54 sakai
dhcp162:~ csev$ cd dev
dhcp162:~/dev csev$ CVS_RSH=ssh; export CVS_RSH

  //  I am just checking out the head
dhcp162:~/dev csev$ cvs -q -z9 -d :ext:sakai_anon_cvs:/cvs co sakai

...
U sakai/z-last/src/overview.html
U sakai/z-last/src/webapp/index.html
U sakai/z-last/src/webapp/WEB-INF/web.xml
dhcp162:~/dev csev$ cd sakai
dhcp162:~/dev/sakai csev$ maven
 __  __
|  \/  |__ _Apache__ ___
| |\/| / _` \ V / -_) ' \  ~ intelligent projects ~
|_|  |_\__,_|\_/\___|_||_|  v. 1.0-rc2

   // There is a LOT of downloaded stuff as it populates your maven repository in
   // ~/.maven - it only does a download once for each version of each war/jar

BUILD SUCCESSFUL
Total time: 1 minutes 10 seconds
Finished at: Tue Aug 24 19:07:10 EDT 2004

dhcp162:~/dev/sakai csev$ maven reg
reg:
    [copy] Copying 36 files to /usr/local/sakai/reg
BUILD SUCCESSFUL
Total time: 3 seconds
Finished at: Tue Aug 24 19:09:25 EDT 2004
dhcp162:~/dev/sakai csev$ maven conf_xml
conf_xml:
    [copy] Copying 1 file to /usr/local/sakai/framework-component
    [copy] Copying 1 file to /usr/local/sakai/legacy-component
    [copy] Copying 1 file to /usr/local/sakai/provider
    [copy] Copying 1 file to /usr/local/sakai/sakai-component
    [copy] Copying 1 file to /usr/local/sakai/shared
BUILD SUCCESSFUL
Total time: 3 seconds
Finished at: Tue Aug 24 19:09:34 EDT 2004

dhcp162:~/dev/sakai csev$ maven populate_xml
 populate_xml:
    [delete] Deleting directory /usr/local/sakai/db
    [copy] Copying 23 files to /usr/local/sakai/db
BUILD SUCCESSFUL
Total time: 3 seconds
Finished at: Tue Aug 24 19:09:43 EDT 2004
dhcp162:~/dev/sakai csev$ maven tomcat_context
tomcat_context:
    [copy] Copying 1 file to /Users/csev/dev/jakarta-tomcat-5.0.27/conf/Catalina/localhost
    [copy] Copying 1 file to /Users/csev/dev/jakarta-tomcat-5.0.27/conf/Catalina/localhost
BUILD SUCCESSFUL
Total time: 3 seconds
Finished at: Tue Aug 24 19:11:08 EDT 2004
dhcp162:~/dev/sakai csev$ cp -r deploy/src/usr_local_sakai/* /usr/local/sakai/
dhcp162:~/dev/sakai csev$ cd ~/dev/jakarta-tomcat-5.0.27/logs/
dhcp162:~/dev/jakarta-tomcat-5.0.27/logs csev$ ../bin/startup.sh 
Using CATALINA_BASE:   /Users/csev/dev/jakarta-tomcat-5.0.27
Using CATALINA_HOME:   /Users/csev/dev/jakarta-tomcat-5.0.27
Using CATALINA_TMPDIR: /Users/csev/dev/jakarta-tomcat-5.0.27/temp
Using JAVA_HOME:       /Library/Java/Home
dhcp162:~/dev/jakarta-tomcat-5.0.27/logs csev$ tail -f catalina.out 
INFO: Processing Context configuration file URL file:/Users/csev/dev/jakarta-tomcat-5.0.27/conf/Catalina/localhost/manager.xml
Aug 24, 2004 7:15:50 PM org.apache.catalina.core.StandardHostDeployer install
INFO: Processing Context configuration file URL file:/Users/csev/dev/jakarta-tomcat-5.0.27/conf/Catalina/localhost/sakai-dav.xml
DavRealm.start()

    .......

INFO: Starting Coyote HTTP/1.1 on http-8080
Aug 24, 2004 7:17:46 PM org.apache.jk.common.ChannelSocket init
INFO: JK2: ajp13 listening on /0.0.0.0:8009
Aug 24, 2004 7:17:46 PM org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=1/42  config=/Users/csev/dev/jakarta-tomcat-5.0.27/conf/jk2.properties
Aug 24, 2004 7:17:46 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 38661 ms

Navigate in your browser to http://localhost:8080/portal/

Login as admin with pw admin

Logout of the portal

Aug 24, 2004 7:18:35 PM org.sakaiproject.component.framework.log.Jdk14Logger info
INFO: EventTracking: 1093389501226-0@0:user.logout@[m, 2]
^C
dhcp162:~/dev/jakarta-tomcat-5.0.27/logs csev$ ../bin/shutdown.sh 
Using CATALINA_BASE:   /Users/csev/dev/jakarta-tomcat-5.0.27
Using CATALINA_HOME:   /Users/csev/dev/jakarta-tomcat-5.0.27
Using CATALINA_TMPDIR: /Users/csev/dev/jakarta-tomcat-5.0.27/temp
Using JAVA_HOME:       /Library/Java/Home
dhcp162:~/dev/jakarta-tomcat-5.0.27/logs csev$ cd ~/dev/sakai

// Download http://www-personal.umich.edu/~csev/sakai/sakai_grid_v00.tar

dhcp162:~/dev/sakai csev$  tar xfv ~/Desktop/sakai_grid_v00.tar  
dhcp162:~/dev/sakai csev$ cd grid
dhcp162:~/dev/sakai/grid csev$ maven
 __  __
|  \/  |__ _Apache__ ___
| |\/| / _` \ V / -_) ' \  ~ intelligent projects ~
|_|  |_\__,_|\_/\___|_||_|  v. 1.0-rc2

Starting the reactor...
Our processing order:
Sakai Grid Service APIs
Sakai Grid Service Implementations
Sakai Grid Tools
Sakai Grid Base Install

+----------------------------------------
| Executing clean,full Sakai Grid Service APIs
| Memory: 3M/4M
+----------------------------------------
Attempting to download axis-gt32.jar.
.........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
Attempting to download cog-axis-gt32.jar.
..........

    [echo] 
    [echo] Deploying jar xerces : xmlParserAPIs (version 2.2.1)
    [copy] Copying 1 file to /Users/csev/dev/jakarta-tomcat-5.0.27/common/lib
    [echo] 
BUILD SUCCESSFUL
Total time: 54 seconds
Finished at: Tue Aug 24 19:23:39 EDT 2004

  // Make to install the tool registry file into Sakai

dhcp162:~/dev/sakai/grid csev$ cp tool/src/reg/sakai.grid.xml /usr/local/sakai/reg 

// Yes, you can use another editor but why would you???

dhcp162:~/dev/sakai/grid csev$ vi /usr/local/sakai/db/site.xml 

Search for the string admin-900

Add the following page entry:

            <page id="~admin-1000" layout="0" title="Grid Cert">
                <properties/>
                <tools>
                    <tool id="~admin-1010" title="Grid Certificate" toolId="sakai.grid">
                        <properties/>
                    </tool>
                </tools>    
            </page> 

And save the file

dhcp162:~/dev/sakai/grid csev$ cd ~/dev/jakarta-tomcat-5.0.27/logs/
dhcp162:~/dev/jakarta-tomcat-5.0.27/logs csev$ ls
catalina.out                    localhost_log.2004-08-24.txt
dhcp162:~/dev/jakarta-tomcat-5.0.27/logs csev$ rm *
dhcp162:~/dev/jakarta-tomcat-5.0.27/logs csev$ ../bin/startup.sh 
Using CATALINA_BASE:   /Users/csev/dev/jakarta-tomcat-5.0.27
Using CATALINA_HOME:   /Users/csev/dev/jakarta-tomcat-5.0.27
Using CATALINA_TMPDIR: /Users/csev/dev/jakarta-tomcat-5.0.27/temp
Using JAVA_HOME:       /Library/Java/Home
dhcp162:~/dev/jakarta-tomcat-5.0.27/logs csev$ tail -f catalina.out 

Go to 

http://localhost:8080/portal/

Look at the happy little Grid Cert button - press it :)

Fill in the three items and press submit with a valid myproxy entry (cannot change the port).

Viola - you will see a subject!

Now this is not as rich as the CHEF Grid kit was - I don't have the side effect of login working yet and the stashing of the credential in the session is not yet there - but the code is in the service to do it - I just need to take some time to activate it.

/Chuck
August 24, 2004 19:32