Monthly Archives: August 2007

Getting a Java + Maven 2 Application on the NMI Testbed

Last week I got Sakai automatically building on the NMI test facility at Wisconsin. Here is a status page:
http://grandcentral.cs.wisc.edu/pavlo/index.php?page=results%2Foverview&opt_user=csev
Here are my scripts in SVN:
https://source.sakaiproject.org/contrib/csev/trunk/nmi/sakaimvn/
The submit file is the master control – here is my sample:
$ cat sakaiMaven2.submit
project = sakai
component = Trunk Build
component_version = 1.0.0
description = Auto-build of Sakai trunk (cron)
run_type = Build
inputs = sakaiMaven2.scp, sakaiMaven2.svn, m2-repo.scp
remote_task = buildSakai.sh
remote_task_args = “sakai/trunk sakai”
platforms = x86_macos_10.4
prereqs_x86_macos_10.4 = java-1.5.0_06
notify = csev@umich.edu
I need Java 1.5 – the simplest is to use the mac OS 10.4 systems for my builds. Later I will develop scripts for other operating systems.
The inputs specify what you want on your execution machine and how to get it there. I have three inputs.
The first copies all my shell scripts from the current directory to the destination machine using SCP.
[csev@nmi-s003 sakaimvn]$ cat sakaiMaven2.scp
method = scp
scp_file = /home/csev/sakaimvn/*.sh
recursive = true
The second input checks a particular tag out of SVN of the Sakai source.
[csev@nmi-s003 sakaimvn]$ cat sakaiMaven2.svn
method = svn
url = https://source.sakaiproject.org/svn/sakai/trunk sakai
The third copies a copy of a populated Maven 2 repository from my home directory on the submitting machine to the executing machine.
[csev@nmi-s003 sakaimvn]$ cat m2-repo.scp
method = scp
scp_file = /home/csev/.m2
recursive = true
As the source changes the .m2 repo will become out of date so I have to tar up a full repo from my dev machine from time to time and copy it over.
The script to be run is pretty complex – I will point out a few important steps.
In link-repo.sh the key line is
ln -s `pwd`/.m2 ~/.m2
The input directive will insure that the .m2 directory makes it into the execution directory – by soft linking it into home, Maven 2 will find it.
In nmi-bootstrap.sh the code is a bit tortuous – probably the clever bit is downloading a copy of Maven 2 and using the local copy.
I debugged this script separately on my mac before making it work on the NMI test bed.
I instlal Maven 2 each time the script runs – I use:
curl -O http://mirrors.ibiblio.org/pub/mirrors/apache/maven/binaries/maven-2.0.7-bin.tar.gz
Then extract it into my local directory and simply use
`pwd`/maven-2.0.7/bin/mvn
As my call to maven 2. This way I install my own pre-requisite and don’t have to depend on anything except for Java.
Once this is done, I put in a crontab to automate this:
[csev@nmi-s003 ~]$ crontab -l
MAILTO=csev@umich.edu
22 04 * * * $HOME/nightly.sh
[csev@nmi-s003 ~]$ cat nightly.sh
#!/bin/sh
PATH=$PATH:/nmi/bin:/usr/local/condor/bin
cd sakaimvn
nmi_submit sakaiMaven2.submit
Thanks to Jim Basney and everyone who helped walk me through the process. it took less than a day to get it all working.
Also thanks to the folks at Wisconsin who walked me through the process.

Continue reading

Making a cool Query for Sakai

I am down at NCSA right now working on pulling site membership info out of Sakai for the Maeviz project so it can be stuffed into SAML assertions to pass to other systems. We are using MyProxy and GridShib.
My job was to come up with a queru whcih for a particular Enterprise ID (i.e. csev) – find all the sites they are in, give the site ID, Site title, and whether they were the owner or just a member (I used site.upd for this).
I seldom get to play in the DB – after a few hours I came up with this query. Feel free to criticize – it only works on MySql 2.3 for sure:

SELECT SAKAI_SITE.SITE_ID,SAKAI_SITE.TITLE, NOT ISNULL(SAKAI_REALM_RL_FN.FUNCTION_KEY) AS POWER
FROM SAKAI_USER_ID_MAP
JOIN SAKAI_SITE_USER
ON SAKAI_USER_ID_MAP.USER_ID = SAKAI_SITE_USER.USER_ID
join SAKAI_SITE
ON SAKAI_SITE_USER.SITE_ID = SAKAI_SITE.SITE_ID
JOIN SAKAI_REALM
ON SAKAI_REALM.REALM_ID = CONCAT('/site/',SAKAI_SITE.SITE_ID)
JOIN SAKAI_REALM_RL_GR
ON SAKAI_REALM.REALM_KEY = SAKAI_REALM_RL_GR.REALM_KEY
AND SAKAI_SITE_USER.USER_ID = SAKAI_REALM_RL_GR.USER_ID
LEFT JOIN SAKAI_REALM_RL_FN
ON SAKAI_REALM.REALM_KEY = SAKAI_REALM_RL_FN.REALM_KEY
AND SAKAI_REALM_RL_GR.ROLE_KEY = SAKAI_REALM_RL_FN.ROLE_KEY
AND SAKAI_REALM_RL_FN.FUNCTION_KEY IN (SELECT FUNCTION_KEY FROM SAKAI_REALM_FUNCTION WHERE FUNCTION_NAME = 'site.upd')
WHERE
SAKAI_USER_ID_MAP.EID='tmclaren'
;

Here is sample output:

+---------------------------------------+--------------------------+-------+
| SITE_ID                               | TITLE                    | POWER |
+---------------------------------------+--------------------------+-------+
| !admin                                | Administration Workspace |     1 |
| ed4fd8d8-a717-4a3d-00f0-f1e368ac1faa  | MAEviz                   |     0 |
| ~1d722376-bd33-44a0-80ba-de56ba912175 | My Workspace             |     1 |
+---------------------------------------+--------------------------+-------+

Good fun.

Teaching With Sakai

I am going to record my notes/thoughts/ideas as I teach with Sakai this next year. Here are a few first thoughts:
– It is really cool to make the course sites myself and choose when to publish the sites – and control what tools appear on the site. I already have published my site and am using E-Mail and polls in the weeks prior to the start of class to help me plan.
– UM does not have the page order tool enabled :( I really like the tool – not so much for the reordering feature – but more for the show/hide feature.
– UM has tech support for CTools available on IM – AWSOME!!! I needed Poll tool added to my site (cause it is stealth at UM) and 5 minutes later it was done via iChat – I was able to paste course IDs in and all – nice nice nice.
– I sent out my first not to my Ruby on Rails calss with a simple poll – will see how much response I get …
I don’t have admin privs on CTools – so I get the real faculty experience – also I will resist the temptation to go straight to the developers and management just because I know them – I want ot use tech support and do the real faculty thing and get the whole experience.
I also hope to set parts of the course for public viewing – we will see – some features in 2.4 trunk are not in 2-4-x that make anon viewing better – perhaps next semester.

Motorcycle Racing Part II

This weekend was all about motorcycling – Friday and Saturday were up at Leota MI with Brent, and my brother Scott and his son John. We had a great time sharing three vehicles with four people. This allowed for plenty of time relaxing around a campfire between rides.
On Friday evening the three went out without me and went farther than told them to go and got sort of lost – they had left without the maps and GPS and my instructions as to what to do and not to do. I spend a nervous hour sitting at the campfire, thinking I would have to call the sherrif to haul them in – the trails at Leota are great and easy and fun – but a wrong turn can send you on a 50 mile trip. But as the sun set they came back – they had gotten a little lost but found their way back. Whew – I immediately gave Scott a map and the trail riding lesson :)
We stayed the night in Harrison, MI – had dinner at a bar with a live band – pretty cool. I did not like the place we stayed (won’t mention any names) – AC was not working and the shower ran out of water. But the next morning we did visit a really nice place that we will stay for our next trip the Lakeside Motel and Cottages. Fishing, swimming, boats to rent, all right on on Budd Lake and in downtown Harrison.
This is the first time I have ever been to Harrison, MI – going up to Makinaw all these years – I have driven *by* Harrison 100+ times – it is a very lively town – with local restaraunts, flea markets, nice little shopping center – it is not a”cute” town – just a very functional town and nicely close to mid-Michigan and to motorcycling and snowmobiling.
On Saturday John and Brent spent time in the scramble areas and really short trail rides on their own. Scott and I took a longer trail ride and explored some new areas – we found way points four and five finally and found the way back to waiypoint 3 from the hill climb that has eluded me for all these years. Scott increasingly became more skilled on the ATV and I had more trouble keeping up with him. By the time we got back from our 10 miles my bike had been ridden harder than in a few years – a few bolts loosened up.
Sunday morning was another Vintage Motocross event – this time at the Battle Creek Motorcycle Club. I wanted a video of it so I asked Scott and John to come along as cameramen.
The day dawned with the first rain in 5 weeks – great for lawns – bad for me on a morotcycle – but I pressed on. I met Ben Wanke – the Vintage MX Chairperson and he introduced me around. The Vintage MX group is like a family. They even helped pull start my bike when it flooded and would not start.
The track was VERY sliick and muddy. I fell down for the first time – I was coming out of a curve and gunned it before I had enough traction and the bike just slipped out from under me – thankfully that was during practice. During the first moto – my goggles got wet and muddy and I had to take them off – it just meant blinking your eyes when a faster bike flies by throwing mud everywhere – not so bad. Later I noticed that lots of riders rip off their goggles after they get gunked up.
I used my strategy to start last and be behind the riders – but that kind of failed because they ran two classes at the same time – I was in the first class – about a minute later they dropped the flag on the second group of about 10 riders – many of these guys caught and passed me – so plenty of mud in the face.
While there are about 25 riders on the track at the same time – there are multiple classes running at the same time. I am in a class called Evolution for bikes that are 1981 and older. (Vintage <= 1974, Evolution <= 1981, Innovation <= 1989) - for this race there were only two entrants in my Evolution class. After the race I went up and found out that I had come in first in my class. And that if I raced a second time I and came in first again - I would win a trophy. So while Scott and John had to go home - I convinced Brent to hang out for another hour so I could race my second race. This time I knew who was in my class - racer 641 from Clio MI (I forget his name). At the start this time - I actually wanted to compete - not just survive. When we started out - I stalled my bike in the excitement - and watched 641 absolutely fly away from me - by the time my bike was restarted - he was long-gone - and I could tell he was a good rider - much better than me - so instead of competing with him - I just wanted to survive and go fast enough not to be lapped (and get mud in my face). Again the pre-1974 bikes started a minute behind me (they are supposed to be slower bikes :) ). Soon they began to catch and pass me - and for a few seconds I was actually racing two abreast and keeping up - but then I would slow down for something and they would fly away. I actually passed a guy who was having some kind of trouble with his bike and going slowly (my first motocross pass) - then three turns later - his malfunction was apparently fixed and he flew by me - throwing dirt in my face. So again I came in last (second place) and got no trophy because if there is a tie the person placing higher in the second race gets the trophy - I was 1-2 and the other guy was 2-1 as he won the trophy. After the race 641 came over and introduced himself and his two children - they also had a Polaris Predator ATV they were using as a pit bike. He explained that he had run out of gas in the first race - that explained a lot - because I had won first place starting out last and never passing anyone. That also explained why in the second race he kicked my arse so handily. Ah well. Back to low expectations. I know I will never be competitive in motocross - when I was 16 I was not competitive - I am not crazy enough to be competitive - even old racers are pretty competitive. But racing is fun - even without winning - I may continue to do it for the exercise and comraderie. Here are the pictures - things are pretty muddy as you can see. I am feeling pretty tired, muddy and waterlogged. http://www.dr-chuck.com/images/2007/08/index.php?img=05-08-07_105716_01.jpg
Sorry Georgia Tech – the T-Square t-shirt was at the top of the pile because I wear it a lot – I did not know how muddy it would get – I am sure it will clean up with a good washing – it is just sand.

A new course I am working on – SI201

I am working with a number of others to build a new Undergraduate curriculum in Informatics at the University of Michigan. Paul Conway is our leader. My main role is to define a new course – SI201 – a beginning programming course focusing very much on Web 2.0 approaches to information.
I attach my *DRAFT* course descripton below. Comments/improvements welcome.

Continue reading