530 likes | 704 Views
Globus Toolkit 4.0 Grid Resource Allocation Manager (GRAM) Job submission. ITCS 4146/5146 Grid Computing, 2007, UNC-Charlotte, B. Wilkinson. Jan 24, 2007. Globus Open Source Grid Software. G T 4. Delegation Service. Community Scheduler Framework [contribution]. Python WS Core
E N D
Globus Toolkit 4.0Grid Resource Allocation Manager (GRAM)Job submission ITCS 4146/5146 Grid Computing, 2007, UNC-Charlotte, B. Wilkinson. Jan 24, 2007
Globus Open Source Grid Software G T 4 Delegation Service Community Scheduler Framework [contribution] Python WS Core [contribution] C WS Core G T 3 CommunityAuthorization Service OGSA-DAI [Tech Preview] WS Authentication Authorization Reliable File Transfer Java WS Core Grid Resource Allocation Mgmt (WS GRAM) Monitoring & Discovery System (MDS4) G T 2 Pre-WS Authentication Authorization GridFTP Grid Resource Allocation Mgmt (Pre-WS GRAM) Monitoring & Discovery System (MDS2) C Common Libraries G T 3 Replica Location Service XIO G T 4 Credential Management GRAM Web ServicesComponents Non-WS Components Security Data Management Execution Management Information Services CommonRuntime I Foster
Job submission components GT4 container (hosts GT 4 web services) User job submission GRAM services Local scheduler GRAM adapter (for particular scheduler) Compute nodes Local scheduler on coit-grid02.uncc.edu is Condor (Sun Grid Engine on some other compute nodes)
How to specify job The job is specified in a file which gives details such as: • Job description • Name of executable • Arguments • Input files • Output files • Resource requirements • Memory Uses a “job description” language • Resource Specification Language (RSL) Then issue a command that includes name of job specification file.
Job submission • GT 2 job submission file • RSL version 1 language. • Traditional job description language • GT 3.2/4.0 job submission file • RSL version 2 language • XML based job description language
Resource Specification LanguageRSL version 1 • A meta-language describing job and its required execution. Provides a specification for: • Resource requirements - machine type, number of nodes, memory, etc. • Job description - directory, executable, arguments, environment
RSL Version 1 examplesConstraints ExampleConjunction (AND): & • To create 3-5 instances of myProg, each on a machine with at least 64 Mbytes memory available to me for 1 hours: & (executable=myProg) (count>=3)(count<=5)(memory>=64) (max_time=60)
Constraints ExampleDisjunction (OR): | • To create 5 instances of myProg, each on a machine with at least 64 Mbytes memory or 7 instances of myProg, each on a machine with at least 32 Mbytes memory : &(executable=myProg) (|(&(count=5)(memory>=64)) (&(count=7)(memory>=32)))
Requesting multiple resourcesmultirequest: + • To execute 5 instances of myProg1 on a machine with at least 64 Mbytes memory and execute 2 instances of myProg2: +(&(count=5)(memory>=64)) (executable=myProg1)) (&(count=2)(executable=myProg2))
Resource Specification Language, RSL version 2 • GT3 and GT 4 use RSL version 2. • Some differences in RSL language specification in GT4, so not completely interchangeable!!!. • RSL Version 2 is an XML language.
Resource Specification Language Version 2 (RSL -2) • XML version of RSL 1 • Can specify everything from executable, paths, arguments, input/output, error file, number of processes, max/min execution time, max/min memory, job type etc. etc.
RSL-2 • Much more elegant and flexible, and in keeping with systems using XML. • Can use XML parsers. • Allows more powerful mechanisms with job schedulers. • Resource scheduler/broker applies specification to local resources.
RSL-2 ExamplesSpecifying Executable(executable=/bin/echo) <gram:executable> <rsl:path> <rsl:stringElement value="/bin/echo"/> </rsl:path> </gram:executable> In GT 4 version of RSL-2, can simply write: <executable>/bin/echo</executable>
Specifying Directory(directory=“/bin”) <gram:directory> <rsl:path> <rsl:stringElement value="/bin/"/> </rsl:path> </gram:directory> In GT 4 version of RSL-2, can simply write: <directory>/bin/</directory>
Specifying Number(count=1) <gram:count> <rsl:integer value="1"/> </gram:count> In GT 4 version of RSL-2, can simply write: <count>1</count>
Specifying Arguments(arguments=“Hello”) <gram:arguments> <rsl:string> <rsl:stringElement value="Hello World"/> </rsl:string> </gram:arguments> In GT 4 version of RSL-2, can simply write: <argment>hello world</argument>
<?xml version="1.0" encoding="UTF-8"?> • <rsl:rsl xmlns:rsl="http://www.globus.org/namespaces/2003/04/rsl" • xmlns:gram="http://www.globus.org/namespaces/2003/04/rsl/gram" • xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" • xsi:schemaLocation=" • http://www.globus.org/namespaces/2003/04/rsl • c:/ogsa-3.0/schema/base/gram/rsl.xsd • http://www.globus.org/namespaces/2003/04/rsl/gram • c:/ogsa-3.0/schema/base/gram/gram_rsl.xsd"> • <gram:job> • <gram:executable> <rsl:path> • <rsl:stringElement value="/bin/echo"/> </rsl:path> • </gram:executable> • <gram:directory> <rsl:path> • <rsl:stringElement value="/bin"/> </rsl:path> • </gram:directory> • <gram:arguments> • <rsl:string> <rsl:stringElement value="Hello World"/> </rsl:string> • </gram:arguments> • <gram:stdin> <rsl:path> • <rsl:stringElement value="/dev/null"/> </rsl:path> </gram:stdin> • <gram:stdout> • <rsl:pathArray> • <rsl:path> • <rsl:substitutionRef name="HOME"/> • <rsl:stringElement value="/stdout"/> • </rsl:path> • </rsl:pathArray> • </gram:stdout> • <gram:stderr> • <rsl:pathArray> • <rsl:path> • <rsl:substitutionRef name="HOME"/> • <rsl:stringElement value="/stderr"/> • </rsl:path> • </rsl:pathArray> • </gram:stderr> • <gram:count> <rsl:integer value="1"/> </gram:count> • <gram:jobType> • <gram:enumeration> • <gram:enumerationValue> <gram:multiple/> </gram:enumerationValue> • </gram:enumeration> • </gram:jobType> • <gram:gramMyJobType> • <gram:enumeration> • <gram:enumerationValue> <gram:collective/> </gram:enumerationValue> • </gram:enumeration> • </gram:gramMyJobType> • <gram:dryRun> <rsl:boolean value="false"/> </gram:dryRun> • <gram:saveState> <rsl:boolean value="true"/> </gram:saveState> • <gram:twoPhase> <rsl:integer value="600"/> </gram:twoPhase> • </gram:job> • </rsl:rsl> RSL and GT 3.2 RSL-2 comparison for echo program &((executable=/bin/echo) (directory="/bin") (arguments="Hello World") (stdin=/dev/null) (stdout="stdout") (stderr="stderr") (count=1) )
GT 4.0 RSL-2 for echo program <?xml version="1.0" encoding="UTF-8"?> <job> <executable>/bin/echo</executable> <directory>${GLOBUS_USER_HOME}</directory> <argument>Hello</argument> <argument>World</argument> <stdout>${GLOBUS_USER_HOME}/stdout</stdout> <stderr>${GLOBUS_USER_HOME}/stderr</stderr> <count>1</count> <jobType>multiple</jobType> </job>
Comments on Linux command structure Linux commands typically consist of the command (program) name, a list of optional and required named “flags”, possibly with arguments. Flags are preceded with a hyphen and are traditionally a single letter, but can be more letters and may have alterative full names. Flags case sensitive.
Examples ls –a List files, -a says list all files including hidden files (those starting with a period). cc –o outputfile prog1 compile C program prog1 and create executable called outputfile
Comments on Linux command structure • Command can be quite long and must be entered without a return. • If need to go onto next line, use \ (backslash) first. Cause next character to be taken “literally”. • Will not use \ for next line continuation in slides, for clarity.
GT4 job submission command globusrun-ws • Submit and monitor GRAM jobs • Replaces (java) managed-job-globusrun • Written in C, faster startup and execution • Supports multiple and single job submission • Handles credential management • Streaming of job stdout/err during execution
Simple job submission • Step 1: Create proxy with grid-proxy-int command. • Step 2: Issue globusrun-ws with parameters to specify job.
Running GT 4 Jobusing XML job description file • Command: globusrun-ws –F hostname:port –submit –f prog.xml where prog.xml specifies the job.
Job submission-submit flag -submit Submits (or resubmits) a job to a job host in one of three output modes: batch interactive, or interactive-streaming. Default (without additional flags to specify) is “interactive.” -submit flag is always required to submit a job.
Specifying where job is submitted -F Specifies the “contact” for the job submission. Default https://localhost:8443/wsrf/services/ ManagedJobFactoryService In assignment 2, simply localhost and container port used, i.e. -F localhost:8440 Jeremy decided on this port.
Selecting a different host Example globusrun-ws –submit –F https://140.221.65.193:4444/wsrf/services/managedJobFactoryService –f prog1.xml
Job description Two ways: -f job-description-file Job description read from given file (as in previous slides) -c takes remaining globusrun-ws arguments and generates job description with named program and arguments. Must be last flag.
-f flag –f job description held in a file. Example globusrun-ws –submit –f echo.xml where echo.xml is an RSL-2 file describing job.
Contents of echo.xml <job> <executable>/bin/echo</executable> <argument>hello</argument> </job>
Input/Output RSL file can specify where stdout/err goes. Example <job> <executable>/bin/echo</executable> <directory>/tmp</directory> <argument>hello</argument> <stdout>job.out</stdout> <stderr>job.err</stderr> … </job>
Stream Input/Output -sThe standard output and standard error files of the job are monitored and data is written to the corresponding output of globusrun-ws. Allows streaming stdout/err during executing to the terminal.
Stream output data files Can also “stream” output data files. Specify in RSL file where to.
Example <job> … <fileStageOut> <transfer> <sourceUrl>file:///tmp/job.out</sourceUrl> <destinationUrl>gsiftp://host.domain:2811/ tmp/stage.out</destinationUrl> </transfer> </fileStageOut> … </job>
Submitting a single jobwithout XML job description file-c flag • c Causes globusrun-ws to generate a simple job description with the named program and arguments. This flag, if used, must be the last flag. Only useful for very simple single jobs.
Example Submit program echo with argument hello to default local host. % globusrun-ws –submit –c /bin/echo hello Submitting job...Done. Job ID: uuid:d23a7be0-f87c-11d9-a53b-0011115aae1f Termination time: 07/20/2005 17:44 GMT Current job state: Active Current job state: CleanUp Current job state: Done Destroying job...Done.
In previous example, output would be lost, as stdout not displayed. To specify a file for the output, need two flags: -s for streaming output and –so to specify output file
globusrun-ws -submit -F localhost:8440 -s -so echo_output -c /bin/echo hello Argument for echo name of file holding output
Batch Submission Job queued for execution. -batchResults in ManagedJob EPR as the sole standard output (unless in quiet mode) and then exits. -o filename Created ManagedJob EPR written to file (if submission successful) EPR “End point Reference” – the way to locate a web service, more on that later.
Batch Job Submission $ globusrun-ws –submit –batch –o job_epr –s /bin/sleep 50 Submitting job…Done JoB ID: uuid:f9544174-60c5-11d9-97e3-0002a5ad41e5 Termination time: 01/08/2005 16:05 GMT
Monitoring Batch Submission -monitor Attaches to an existing job in interactive or interactive-streaming output modes. -j filename EPR for ManagedJob read from file.
Monitoring Batch Job globusrun-ws –monitor –j job_epr job state: Active Current job state: CleanUp Current job state: Done Requesting original job description...Done. Destroying job...Done
Batch Submission -status Reports the current state of the job and exits -kill Requests immediate cancellation of job and exits.
Many other flagsExample -term time Set an absolute termination time, or a time relative to the successful job creation
Sources of GT 4 information http://www.globus.org/toolkit/docs Also: “GRAM, RFT & Job Submission, Execution Management for GT4 Developers,” S. Martinb and P. Plaszczak, globusWorld, 2005, www.globusworld.org
To learn more about Linux commands “Linux in a Nutshell,” by E. Siever, S. Figgins, and A. Weber, O’Reilly, (4th edition 2003). 928 pages!!
Multiple choice quiz When one issues the GT4.0 command: globusrun-ws -submit -F localhost:8440 -s -so hello1 -c /bin/echo hello what is hello? (a) A java class (b) An xml file containing the description of the job to be run (c) The executable to run in Globus (d) The argument for the program that will be executable
When one issues the GT4.0 command: globusrun-ws -submit -F localhost:8440 -s -so hello1 -c /bin/echo hello is the order of the flags important, and if so why? (a) Not important (b) Important: -c must be last as it uses the remaining arguments (c) Important: -s must be before -so (d) Important: -F must be first