Www.consorzio-cometa.it FESR Consorzio COMETA - Progetto PI2S2 WMS - Scripting techniques Fabio Scibilia INFN – Catania, Italy Tutorial per utenti e sviluppo.

Slides:



Advertisements
Similar presentations
INFSO-RI Enabling Grids for E-sciencE Workload Management System and Job Description Language.
Advertisements

The Grid Constantinos Kourouyiannis Ξ Architecture Group.
Job Submission The European DataGrid Project Team
Workload Management meeting 07/10/2004 Federica Fanzago INFN Padova Grape for analysis M.Corvo, F.Fanzago, N.Smirnov INFN Padova.
INFSO-RI Enabling Grids for E-sciencE EGEE Middleware The Resource Broker EGEE project members.
Special Jobs Claudio Cherubino INFN - Catania. 2 MPI jobs on gLite DAG Job Collection Parametric jobs Outline.
CS 497C – Introduction to UNIX Lecture 33: - Shell Programming Chin-Chih Chang
Basic Grid Job Submission Alessandra Forti 28 March 2006.
FESR Consorzio COMETA - Progetto PI2S2 Jobs Interattivi Giuseppe La Rocca INFN Catania – Italy Tutorial.
FESR Consorzio COMETA - Progetto PI2S2 Using MPI to run parallel jobs on the Grid Marcello Iacono Manno Consorzio COMETA
Bash Shell Scripting 10 Second Guide Common environment variables PATH - Sets the search path for any executable command. Similar to the PATH variable.
Submit Host Setup (user) Tc.data file Pool.config file Properties file Vdl-gen file Input file Exitcode checking script.
Introduction to Linux and Shell Scripting Jacob Chan.
FP6−2004−Infrastructures−6-SSA E-infrastructure shared between Europe and Latin America Special Jobs Matias Zabaljauregui UNLP.
The EPIKH Project (Exchange Programme to advance e-Infrastructure Know-How) WMPROXY API Python & C++ Diego Scardaci
The gLite API – PART I Giuseppe LA ROCCA INFN Catania ACGRID-II School 2-14 November 2009 Kuala Lumpur - Malaysia.
INFSO-RI Enabling Grids for E-sciencE GILDA Praticals GILDA Tutors INFN Catania ICTP/INFM-Democritos Workshop on Porting Scientific.
INFSO-RI Enabling Grids for E-sciencE Workload Management System Mike Mineter
Introduction to Linux OS (IV) AUBG ICoSCIS Team Prof. Volin Karagiozov March, 09 – 10, 2013 SWU, Blagoevgrad.
SEE-GRID-SCI The SEE-GRID-SCI initiative is co-funded by the European Commission under the FP7 Research Infrastructures contract no.
Architecture of the gLite WMS (Workload Management System) Hands-on Paola Celio Universita’ Roma TRE INFN Roma TRE Sevilla Septembre 2007.
E-science grid facility for Europe and Latin America GridwWin: porting gLite to run under Windows Fabio Scibilia – Consorzio COMETA 30/06/2008.
E-infrastructure shared between Europe and Latin America 1 Workload Management System-WMS Luciano Diaz Universidad Nacional Autónoma de México - UNAM Mexico.
CSCI 330 UNIX and Network Programming Unit IX: Shell Scripts.
INFSO-RI Enabling Grids for E-sciencE Claudio Cherubino, INFN Catania Grid Tutorial for users Merida, April 2006 Special jobs.
Enabling Grids for E-sciencE Workload Management System on gLite middleware - commands Matthieu Reichstadt CNRS/IN2P3 ACGRID School, Hanoi.
INFSO-RI Enabling Grids for E-sciencE GILDA and GENIUS Guy Warner NeSC Training Team An induction to EGEE for GOSC and the NGS NeSC,
Tier 3 Status at Panjab V. Bhatnagar, S. Gautam India-CMS Meeting, July 20-21, 2007 BARC, Mumbai Centre of Advanced Study in Physics, Panjab University,
FP6−2004−Infrastructures−6-SSA E-infrastructure shared between Europe and Latin America Grid2Win: Porting of gLite middleware to.
1 P-GRADE Portal tutorial at EGEE’09 Introduction to hands-on Gergely Sipos MTA SZTAKI EGEE.
INFSO-RI Enabling Grids for E-sciencE Job Submission Tutorial (material from INFN Catania)
Workload Management System Jason Shih WLCG T2 Asia Workshop Dec 2, 2006: TIFR.
1 DIRAC Job submission A.Tsaregorodtsev, CPPM, Marseille LHCb-ATLAS GANGA Workshop, 21 April 2004.
FP6−2004−Infrastructures−6-SSA E-infrastructure shared between Europe and Latin America WMS+LB Server Installation Tony Calanducci.
EGEE-III INFSO-RI Enabling Grids for E-sciencE EGEE and gLite are registered trademarks Grid2Win : gLite for Microsoft Windows Roberto.
INFSO-RI Enabling Grids for E-sciencE EGEE is a project funded by the European Union under contract IST Job sandboxes.
INFSO-RI Enabling Grids for E-sciencE GILDA Praticals Giuseppe La Rocca INFN – Catania gLite Tutorial at the EGEE User Forum CERN.
Development of test suites for the certification of EGEE-II Grid middleware Task 2: The development of testing procedures focused on special details of.
Introduction to Bash Shell. What is Shell? The shell is a command interpreter. It is the layer between the operating system kernel and the user.
1 P-GRADE Portal hands-on Gergely Sipos MTA SZTAKI Hungarian Academy of Sciences.
EGEE-II INFSO-RI Enabling Grids for E-sciencE EGEE and gLite are registered trademarks WMS tricks & tips – further scripting Giuseppe.
EGEE-II INFSO-RI Enabling Grids for E-sciencE Practical using WMProxy advanced job submission.
User Interface UI TP: UI User Interface installation & configuration.
D.Spiga, L.Servoli, L.Faina INFN & University of Perugia CRAB WorkFlow : CRAB: CMS Remote Analysis Builder A CMS specific tool written in python and developed.
CS 403: Programming Languages Lecture 20 Fall 2003 Department of Computer Science University of Alabama Joel Jones.
LCG2 Tutorial Viet Tran Institute of Informatics Slovakia.
1 UNIX Operating Systems II Part 2: Shell Scripting Instructor: Stan Isaacs.
Consorzio COMETA - Progetto PI2S2 UNIONE EUROPEA Grid2Win : gLite for Microsoft Windows Elisa Ingrà - INFN.
Introduction to Scripting Workshop February 23, 2016.
Introduction to Computing Element HsiKai Wang Academia Sinica Grid Computing Center, Taiwan.
FESR Consorzio COMETA - Progetto PI2S2 Jobs with Input/Output data Fabio Scibilia, INFN - Catania, Italy Tutorial per utenti e.
FESR Consorzio COMETA - Progetto PI2S2 Using MPI to run parallel jobs on the Grid Marcello Iacono Manno Consorzio Cometa
Enabling Grids for E-sciencE Work Load Management & Simple Job Submission Practical Shu-Ting Liao APROC, ASGC EGEE Tutorial.
FESR Trinacria Grid Virtual Laboratory Practical using WMProxy advanced job submission Emidio Giorgio INFN Catania.
Practical using C++ WMProxy API advanced job submission
Grid2Win: Porting of gLite middleware to Windows platform
Grid2Win Porting of gLite middleware to Windows XP platform
Unix Scripts and PBS on BioU
WMS - Tecniche di scripting
Special jobs with the gLite WMS
Running a job on the grid is easier than you think!
Workload Management System ( WMS )
Alexandre Duarte CERN Fifth EELA Tutorial Santiago, 06/09-07/09,2006
Grid2Win: Porting of gLite middleware to Windows XP platform
Shell Script Assignment 1.
5. Job Submission Grid Computing.
Long term job submission and monitoring uing grid services
gLite Job Management Christos Theodosiou
GENIUS Grid portal Hands on
Introduction to Bash Programming, part 3
Presentation transcript:

FESR Consorzio COMETA - Progetto PI2S2 WMS - Scripting techniques Fabio Scibilia INFN – Catania, Italy Tutorial per utenti e sviluppo di applicazioni Catania, Luglio 2007

Catania, Tutorial al DIIT, Luglio Preliminars LCG middleware –The workload is managed by the Resource Broker –Doesn’t support neither parametric jobs nor DAGs –Works fine gLite –Support both the parametric and the DAG jobs –Under developing –Uses WMProxy to manage the workload –Will be available in a few months Tips and tricks –Some ideas to use LCG middleware to support parametric jobs and DAGs while waiting for WMProxy stable release

Catania, Tutorial al DIIT, Luglio Exercise 1: Parametric jobs

Catania, Tutorial al DIIT, Luglio Exercise 1: The bash script (1/2) A set of jobs differing for input files only –The bash script looks like this #!/bin/sh if [ "$2" = "" ]; then echo "Usage: $0 begin end [step]" echo " begin The first value of the sequence" echo " end The last value of the sequence" echo " step The step between two submissions" exit 0 fi joblist="jobs.list" begin_index=$1 // the first parameter of the script end_index=$2 // the second parameter of the script if [ "$3" = "" ]; then step=1; else step=$3 // the third parameter of the script fi...

Catania, Tutorial al DIIT, Luglio Exercise 1: The bash script (2/2) # starts iterations for ((index=$begin_index; index<=$end_index; index=$index+$step)) do # we generate the input file automatically. Obviously it can be made by hand inputfile="input$index.txt" echo "creating input file $inputfile" echo "The name of this input file is $inputfile" > $inputfile # create the correspondent jdl file depending on the index jdlfile="job$index.jdl“ # name of the jdl echo "creating JDL file $jdlfile" ( echo 'Type="Job";' echo 'JobType="Normal";' echo 'Executable=“/bin/cat";' echo "Arguments=\"$inputfile\";" echo "StdOutput=\"stdout$index.txt\";" echo "StdError=\"stderr$index.txt\";“ echo "InputSandbox={\"$inputfile\"};" echo "OutputSandbox={\"stdout$index.txt\", \"stderr$index.txt\"};" ) > $jdlfile edg-job-submit -o jobs.id $jdlfile # actual job submission done # end of iterations

Catania, Tutorial al DIIT, Luglio Exercise 2: DAGs

Catania, Tutorial al DIIT, Luglio Exercise 2: DAG modelling DAGs can be emulated with a simplified Petri net –A job is submitted only when activating jobs have terminated –Each transition bar corresponds to a bash script that  Waits for termination of activating job(s) by polling every minute  Collects the output  Submits next job(s) 23456

Catania, Tutorial al DIIT, Luglio /last_job.sh: submits the last job and waits for its completion, downloading the output./polling.sh: waits for jobs [1..n] completion, collect the output and creates the final input file./submitter.sh: generates input[1..n].txt and submits jobs Exercise 2: An example We emulate a simple split and merge DAG –One transition bar –Anyway, this example can be extended to any possible DAG 12n input1.txt input2.txt input(n).txt last stdout final_input final_output./polling &&./last_job.sh: Implement the bar transion

Catania, Tutorial al DIIT, Luglio Exercise 2:./submitter.sh #!/bin/sh if [ "$1" = "" ]; then echo "Usage: $0 num-splits“ ; exit 0 fi for ((index=1; index<= $1; index++)); do # for each job echo "this is the content of input$index.txt" >> input$index.txt ( ## creates the jdl for this job echo "Type=\"Job\";" echo "JobType=\"Normal\";" echo "Executable=\"/bin/cat\";" echo "Arguments=\"input$index.txt\";" echo "InputSandbox={\"input$index.txt\"};" echo "StdOutput=\"stdout.txt\";" echo "StdError=\"stderr.txt\";" echo "OutputSandbox={\"stdout.txt\", \"stderr.txt\"};" ) > job$index.jdl; edg-job-submit -o jobs.id job$index.jdl done

Catania, Tutorial al DIIT, Luglio Exercise 2:./submitter.sh output dag]$./submitter.sh 2.. The job has been successfully submitted to the Network Server. Use edg-job-status command to check job current status. Your job identifier is: - The job identifier has been saved in the following file: /home/fscibi/tips_and_tricks/dag/jobs.id.. The job has been successfully submitted to the Network Server. Use edg-job-status command to check job current status. Your job identifier is: - The job identifier has been saved in the following file: /home/fscibi/tips_and_tricks/dag/jobs.id

Catania, Tutorial al DIIT, Luglio Exercise 2:./polling.sh (1/4) #!/bin/sh while read line; do if [ "$line" != "###Submitted Job Ids###" ]; then joblist="$joblist $line" fi done < jobs.id for job in $joblist; do status="unknown" finished="false" while [ "$finished" = "false" ]; do # loops waiting for job completion ## Gets the status of the job echo echo "getting status of job $job" output=`edg-job-status $job` status=`echo "$output" | grep "Current Status" | awk '{print $3 }'` echo "status = $status"

Catania, Tutorial al DIIT, Luglio Exercise 2:./polling.sh (2/4) ## depens on the status, decides what to do case $status in "Aborted“ ) echo "The job has been aborted on the CE" finished="true" ;; "Cleared“ ) echo "The job output sandbox has been already retrieved. I don't know where!" finished="true" ;; "Done“ ) echo "Job $job Done!!! Downloading the output" ## executes and parses the output of edg-job-get-output ## to understand where the output has been stored

Catania, Tutorial al DIIT, Luglio Exercise 2:./polling.sh (3/4) edg-job-get-output --dir. $job | (pipes the edg-job-get-output to llok for job status found="false" while read line; do if "$found" = "true“ ; then ## this line contains the dir path dirpath=$line echo "output sandbox stored at $dirpath" break fi if echo "$line" | grep -q "have been successfully retrieved and stored“ ; then found= "true" ## next line contains the dir path fi done if "$found" = "true“; then filename=$dirpath/stdout.txt echo "appending $filename to final_input" cat $filename >> final_input fi ) finished="true" ;;

Catania, Tutorial al DIIT, Luglio Exercise 2:./polling.sh (4/4) *) echo "sleeping 1 minute" sleep 1m ;; esac done # while done # for dag]$./polling.sh... (after a while) getting status of job Od68j9IBOuJHGlUq-EfWTg status = Done Job Done!!! Downloading the output output sandbox stored at... /dag/fscibi_Od68j9IBOuJHGlUq-EfWTg appending...dag/fscibi_Od68j9IBOuJHGlUq-EfWTg/stdout.txt to final_input getting status of job _-suh1wmmo1VvYJd_4AiLhA status = Done Job Done!!! Downloading the output output sandbox stored at... /dag/fscibi_-suh1wmmo1VvYJd_4AiLhA appending... dag/fscibi_-suh1wmmo1VvYJd_4AiLhA/stdout.txt to final_input

Catania, Tutorial al DIIT, Luglio Exercise 2: Submitting last job ] cat last_job.sh #!/bin/sh ## submits the last job edg-job-submit -o last_job.id last_job.jdl status=unknown while [ "$status" != "Done" ]; do echo "sleeping 30 seconds“ sleep 30s output=`edg-job-status -i last_job.id` status=`echo "$output" | grep "Current Status" | awk '{print $3 }'` echo "status = $status" done edg-job-get-output -i last_job.id --dir. echo "Everything is Done !!! " ] cat last_job.jdl Type="Job"; JobType="Normal"; Executable="/bin/cat"; Arguments="-n final_input"; StdOutput="final_output"; StdError="stderr.txt"; InputSandBox={"final_input"}; OutputSandbox={"stderr.txt", "final_output"};

Catania, Tutorial al DIIT, Luglio Exercise 2:./last_job.sh output dag]$./last_job.sh... The job has been successfully submitted to the Network Server sleeping 30 seconds (many times) status = Scheduled (waiting for status Done)... sleeping 30 seconds status = Done Retrieving files from host:... Output sandbox files for the job: - have been successfully retrieved and stored in the directory: /home/fscibi/tips_and_tricks/dag/fscibi_q_rqVQpNFt0GshDn5MZHEw "Everything is Done !!! dag]$ cat fscibi_q_rqVQpNFt0GshDn5MZHEw/final_output 1 this is the content of input1.txt 2 this is the content of input2.txt

Catania, Tutorial al DIIT, Luglio References JDL (WMS Netrwork Server) JDL (WMS WMProxy) Advanced BASH scripting Gilda twiki pages

Catania, Tutorial al DIIT, Luglio Questions...