airavata-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Shameera Rathnayaka <shameerai...@gmail.com>
Subject Replace XSLT base script generation with more flexible Groovy Temaplates
Date Thu, 29 Sep 2016 19:44:59 GMT
Hi Devs,

We are using XSLT+ XSD + CodeGen to generate our job submission scripts.
Compare to our requirement(just to generate simple script)  we are using
heavy tools and adding unnecessary complications. Another downside is all
dependency we need to do this XSLT transformation cause to increase the
size of the airavata distribution. I am thinking of simple Groovy Template
base implementations to replace with this XSLT.  Compare to the learning
curve of both XSLT and Groovy where Groovy has simplest learning curve
compare to XSLT, it is easy to maintain groovy template that XSLT. I have
implemented PoC for Slurm job script and following is how it looks like.
If everyone ok I would like to work on this replacement.

#!${shellName}
<%
if (queueName != null) out.print '#SBATCH -p ' + queueName + '\n'
   if (nodes != null) out.print '#SBATCH -N ' + nodes + '\n'
   if (cpuCount != null) out.print '#SBATCH -n ' + cpuCount + '\n'
   if (mailAddress != null) out.print '#SBATCH --mail-user=' +
mailAddress + '\n'
   if (accountString != null) out.print '#SBATCH -A ' + accountString + '\n'
   if (maxWallTime != null) out.print '#SBATCH -t ' + maxWallTime + '\n'
   if (jobName != null) out.print '#SBATCH -J ' + jobName + '\n'
   if (standardOutFile != null) out.print '#SBATCH -o ' + standardOutFile + '\n'
   if (standardErrorFile != null) out.print '#SBATCH -e ' +
standardErrorFile + '\n'
   if (qualityOfService != null) out.print '#SBATCH --qos=' +
qualityOfService + '\n'
   if (reservation != null) out.print '#SBATCH --reservation=' +
reservation + '\n'
%>
#SBATCH --mail-type=ALL

<% if (exports != null) for(com in exports)  out.print 'export ' + com +'\n'
   if (moduleCommands != null) for(mc in moduleCommands)  out.print mc +'\n'
   if (workingDirectory != null)  out.print 'cd ' + workingDirectory +'\n'
   if (preJobCommands != null) for(pjc in preJobCommands)  out.print pjc +'\n'
   if (jobSubmitterCommand != null)  out.print jobSubmitterCommand + ' '
   if (executablePath != null)  out.print  executablePath + ' '
   if (inputs != null) for(input in inputs)  out.print input + ' '
   out.print '\n'
   if (postJobCommands != null) for(pjc in postJobCommands)  out.print pjc +'\n'
%>



Thanks,
Shameera.

-- 
Shameera Rathnayaka

Mime
View raw message