Cool. I just learned PHP.
Xgrid jobs can be submitted several ways. One is the Batch/XML
format way. The xgrid man page shows the syntax:
xgrid -job batch [-gid grid-identifier] xml-batch-file
...
Batch file examples
Complex multi-job specification may be submitted via an XML
batch prop-
erty list. Batch file job specifications are submitted as
follows:
$ xgrid -job batch sample_batch.xml
The following XML plist submits a simple /usr/bin/cal job:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN"
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>name</key>
<string>Cal Job</string>
<key>taskSpecifications</key>
<dict>
<key>0</key>
<dict>
<key>command</key>
<string>/usr/bin/cal</string>
<key>arguments</key>
<array>
<string>6</string>
<string>2005</string>
</array>
</dict>
</dict>
</dict>
</plist>
So, what you do, is you write a webpage that collects the
necessary parameters need to run a job:
- the job name
- the command to run (and have the ability to upload files if needed)
- arguments
- etc
Then store this in mysql, then notify the admin. The admin would
check out the stuff submitted (mainly the command specified, and
the file uploaded) and then approve it. When it is approved, then
make an xml file and send that to the xgrid command.
Now that I think of it, my perl xml stuff is totally overkill. It
can be done much easier. Anyway, the way to do it in php is to
create some function that converts a named array (hash,
dictionary, whatever) into a plist (which is xml formatted). It
would be a piece of cake, and I wouldn't mind writing that part.
The xml file, and sending it to the xgrid command are the most
trivial pieces IMO. In other words, the actual Xgrid portions are
trivial. Perhaps I'm just speaking for myself. Anyway, I would
be more than happy to help with those portions. The rest is where
my eyes glaze over...
James
Hi James.
I am currently a PHP guy, so would favor using that. Should be ok
tho,
because PHP has easy access to Shell.
I dont think that those articles will really help me, so am going to
look into writing an XML parser or try to find one already made.
I am not entirely sure what you mean by Batch/XML Format. Could you
explain what this is?
Thanks.