Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id B9580200B91 for ; Thu, 29 Sep 2016 21:45:21 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id B7F63160AE4; Thu, 29 Sep 2016 19:45:21 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id CE14F160AC1 for ; Thu, 29 Sep 2016 21:45:20 +0200 (CEST) Received: (qmail 42921 invoked by uid 500); 29 Sep 2016 19:45:20 -0000 Mailing-List: contact dev-help@airavata.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@airavata.apache.org Delivered-To: mailing list dev@airavata.apache.org Received: (qmail 42907 invoked by uid 99); 29 Sep 2016 19:45:19 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 29 Sep 2016 19:45:19 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id C895718050F for ; Thu, 29 Sep 2016 19:45:18 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.398 X-Spam-Level: ** X-Spam-Status: No, score=2.398 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=2, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, RCVD_IN_SORBS_SPAM=0.5, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd3-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx2-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id a0d_8LuRQDH7 for ; Thu, 29 Sep 2016 19:45:17 +0000 (UTC) Received: from mail-oi0-f47.google.com (mail-oi0-f47.google.com [209.85.218.47]) by mx2-lw-eu.apache.org (ASF Mail Server at mx2-lw-eu.apache.org) with ESMTPS id A36675F47D for ; Thu, 29 Sep 2016 19:45:16 +0000 (UTC) Received: by mail-oi0-f47.google.com with SMTP id r126so105802324oib.0 for ; Thu, 29 Sep 2016 12:45:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to; bh=zUgCZJ6dvgv0L7clxcGJn6AI48VAteQukAA50/UpSd0=; b=gP4jT/yf7nt4/raKRh1hvQ3vD82m0BAplyWBEU4XoXcGAKzis3K4QekkYq+gk9M8ic N+xHzls2zLWbdaO11usIV/uTIn2xhESEKao8hed+xfcpyHCWRsIooXIn7YvpLvR4LKKs +M/ZE0yYkuhAV1IIye8IQLDZv009SCKULoQXMhjDDQGwsrKADWsynQfYe0rimHI42pnK qbORFd8FkkQHaUhuv8m4nyLGZyiOpUlgzWX4AmehknmuCOAB1HtDHy4Q4QnPbzRwIW5p IG3N7dk1vxM6uWKL5NNnVc8pRqiM4XNfLdqW7z5c7eRRzfRCi77Tr27Sb0B6SBjEUhmJ R9UA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=zUgCZJ6dvgv0L7clxcGJn6AI48VAteQukAA50/UpSd0=; b=VdGYZzQ/PTpCEAlxzzZAP6HlEMekchm8gPEeKMe/qiiQXjA11swddfTPigoVQxLS2t Rq4yRKLyLdMjMrRydnlCRqfOOLSYzCkccr14vQSbC9M0nA0o6C7IsarOcmAt9eDT8tuA NzXAQxuTJcIX0m40Px9zljDNw6G1NvnPiYiFGC+qeJJMDmtSCmL6VktIB8po9HS4V2MP Pt2CiXE5NmED5zCxs3yVYWIwe0Z/hOK+WcYpyxREcWULikEu3kT00FTR5NkO3kSh0GvA SvusWu80RCEB+6pQPHaiVBT0dcNR9eJ+wWrbnh2crZQuL8nHHYjoTOgjLHJnb7QPJZGG dAgQ== X-Gm-Message-State: AA6/9RmNnA4Ct6PyAnxPVyvz2xkFPEC8ykmfpKjX2yxvaJy+joW2q3tNh+ihhjwre6YxhRMpDeTa7eWkHp9tdw== X-Received: by 10.157.61.230 with SMTP id l93mr2433931otc.208.1475178309386; Thu, 29 Sep 2016 12:45:09 -0700 (PDT) MIME-Version: 1.0 From: Shameera Rathnayaka Date: Thu, 29 Sep 2016 19:44:59 +0000 Message-ID: Subject: Replace XSLT base script generation with more flexible Groovy Temaplates To: dev Content-Type: multipart/alternative; boundary=001a1143fee21c87e8053daab7c3 archived-at: Thu, 29 Sep 2016 19:45:21 -0000 --001a1143fee21c87e8053daab7c3 Content-Type: text/plain; charset=UTF-8 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 --001a1143fee21c87e8053daab7c3 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi Devs,=C2=A0

We are using XSLT+ XSD= =C2=A0+ CodeGen to generate our job submission scripts. Compare to our requ= irement(just to generate simple script) =C2=A0we are using heavy tools and = adding unnecessary=C2=A0complications. Another downside is all dependency w= e need to do this XSLT transformation cause to increase the size of the=C2= =A0airavata=C2=A0distribution. I am thinking of simple Groovy Template base= implementations=C2=A0to replace with this XSLT.=C2=A0 Compare to the learn= ing 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 i= mplemented PoC for Slurm job script and following=C2=A0is how it looks like= .=C2=A0 If everyone ok I would like to work on this replacement.=C2=A0

#!${shellName}
<%
i= f (queueName !=3D null) out.print '#SBATCH -p ' + queueName + '= \n'
if (nodes !=3D null) out.print '#SBATCH -N ' + nodes = + '\n'
if (cpuCount !=3D null) out.print '#SBATCH -n '= ; + cpuCount + '\n'
if (mailAddress !=3D null) out.print '= ;#SBATCH --mail-user=3D' + mailAddress + '\n'
if (account= String !=3D null) out.print '#SBATCH -A ' + accountString + '\n= '
if (maxWallTime !=3D null) out.print '#SBATCH -t ' + ma= xWallTime + '\n'
if (jobName !=3D null) out.print '#SBATC= H -J ' + jobName + '\n'
if (standardOutFile !=3D null) ou= t.print '#SBATCH -o ' + standardOutFile + '\n'
if (st= andardErrorFile !=3D null) out.print '#SBATCH -e ' + standardErrorF= ile + '\n'
if (qualityOfService !=3D null) out.print '#SB= ATCH --qos=3D' + qualityOfService + '\n'
if (reservation = !=3D null) out.print '#SBATCH --reservation=3D' + reservation + = 9;\n'
%>
#SBATCH --mail-type=3DALL

<% if (exports != =3D null) for(com in exports) out.print 'export ' + com +'\n&#= 39;
if (moduleCommands !=3D null) for(mc in moduleCommands) out.prin= t mc +'\n'
if (workingDirectory !=3D null) out.print 'cd= ' + workingDirectory +'\n'
if (preJobCommands !=3D null)= for(pjc in preJobCommands) out.print pjc +'\n'
if (jobSubmi= tterCommand !=3D null) out.print jobSubmitterCommand + ' '
i= f (executablePath !=3D null) out.print executablePath + ' '
= if (inputs !=3D null) for(input in inputs) out.print input + ' '<= br> out.print '\n'
if (postJobCommands !=3D null) for(pjc i= n postJobCommands) out.print pjc +'\n'
%>

Thanks,
Shameera.

--
Shameera Rathnayaka
--001a1143fee21c87e8053daab7c3--