globus toolkit 4.0 grid resource allocation manager (gram) job submission

53
1b.1 Globus Toolkit 4.0 Grid Resource Allocation Manager (GRAM) Job submission ITCS 4146/5146 Grid Computing, 2007, UNC-Charlotte, B. Wilkinson. Jan 24, 2007

Upload: axel-mclaughlin

Post on 04-Jan-2016

44 views

Category:

Documents


5 download

DESCRIPTION

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 - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Globus Toolkit 4.0 Grid Resource Allocation Manager  (GRAM) Job submission

1b.1

Globus Toolkit 4.0

Grid Resource Allocation Manager (GRAM)

Job submission

ITCS 4146/5146 Grid Computing, 2007, UNC-Charlotte, B. Wilkinson. Jan 24, 2007

Page 2: Globus Toolkit 4.0 Grid Resource Allocation Manager  (GRAM) Job submission

Data Management

SecurityCommonRuntime

Execution Management

Information Services

Web Services

Components

Non-WS

Components

Pre-WSAuthenticationAuthorization

GridFTP

GridResource

Allocation Mgmt(Pre-WS GRAM)

Monitoring& Discovery

System(MDS2)

C CommonLibraries

GT2

WSAuthenticationAuthorization

ReliableFile

Transfer

OGSA-DAI[Tech Preview]

GridResource

Allocation Mgmt(WS GRAM)

Monitoring& Discovery

System(MDS4)

Java WS Core

CommunityAuthorization

ServiceGT3

ReplicaLocationService

XIO

GT3

CredentialManagement

GT4

Python WS Core[contribution]

C WS Core

CommunitySchedulerFramework

[contribution]

DelegationService

GT4

Globus Open Source Grid Software

I Foster

GRAM

Page 3: Globus Toolkit 4.0 Grid Resource Allocation Manager  (GRAM) Job submission

1b.3

Job submission componentsGT4 container

(hosts GT 4 web services)

GRAM services

GRAM adapter (for particular

scheduler)

Local scheduler

Compute nodes

User job submission

Local scheduler on coit-grid02.uncc.edu is Condor(Sun Grid Engine on some other compute nodes)

Page 4: Globus Toolkit 4.0 Grid Resource Allocation Manager  (GRAM) Job submission

1b.4

How to specify jobThe 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.

Page 5: Globus Toolkit 4.0 Grid Resource Allocation Manager  (GRAM) Job submission

1b.5

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

Page 6: Globus Toolkit 4.0 Grid Resource Allocation Manager  (GRAM) Job submission

1b.6

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

Page 7: Globus Toolkit 4.0 Grid Resource Allocation Manager  (GRAM) Job submission

1b.7

RSL Version 1 examplesConstraints Example

Conjunction (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)

Page 8: Globus Toolkit 4.0 Grid Resource Allocation Manager  (GRAM) Job submission

1b.8

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)))

Page 9: Globus Toolkit 4.0 Grid Resource Allocation Manager  (GRAM) Job submission

1b.9

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))

Page 10: Globus Toolkit 4.0 Grid Resource Allocation Manager  (GRAM) Job submission

1b.10

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.

Page 11: Globus Toolkit 4.0 Grid Resource Allocation Manager  (GRAM) Job submission

1b.11

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.

Page 12: Globus Toolkit 4.0 Grid Resource Allocation Manager  (GRAM) Job submission

1b.12

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.

Page 13: Globus Toolkit 4.0 Grid Resource Allocation Manager  (GRAM) Job submission

1b.13

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>

Page 14: Globus Toolkit 4.0 Grid Resource Allocation Manager  (GRAM) Job submission

1b.14

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>

Page 15: Globus Toolkit 4.0 Grid Resource Allocation Manager  (GRAM) Job submission

1b.15

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>

Page 16: Globus Toolkit 4.0 Grid Resource Allocation Manager  (GRAM) Job submission

1b.16

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>

Page 17: Globus Toolkit 4.0 Grid Resource Allocation Manager  (GRAM) Job submission

1b.17

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)

)

<?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>

Page 18: Globus Toolkit 4.0 Grid Resource Allocation Manager  (GRAM) Job submission

1b.18

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>

Page 19: Globus Toolkit 4.0 Grid Resource Allocation Manager  (GRAM) Job submission

1b.19

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.

Page 20: Globus Toolkit 4.0 Grid Resource Allocation Manager  (GRAM) Job submission

1b.20

Examples

ls –a List files, -a says list all files including hidden files (those starting with a period).

cc –o outputfile prog1compile C program prog1 and create executable called outputfile

Page 21: Globus Toolkit 4.0 Grid Resource Allocation Manager  (GRAM) Job submission

1b.21

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.

Page 22: Globus Toolkit 4.0 Grid Resource Allocation Manager  (GRAM) Job submission

1b.22

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

Page 23: Globus Toolkit 4.0 Grid Resource Allocation Manager  (GRAM) Job submission

1b.23

Simple job submission

• Step 1: Create proxy with grid-proxy-int command.

• Step 2: Issue globusrun-ws with parameters to specify job.

Page 24: Globus Toolkit 4.0 Grid Resource Allocation Manager  (GRAM) Job submission

1b.24

Some globusrun-ws flags (options) for job submission

Page 25: Globus Toolkit 4.0 Grid Resource Allocation Manager  (GRAM) Job submission

1b.25

Running GT 4 Jobusing XML job description file

• Command:

globusrun-ws –F hostname:port –submit –f prog.xml

where prog.xml specifies the job.

Page 26: Globus Toolkit 4.0 Grid Resource Allocation Manager  (GRAM) Job submission

1b.26

Job submission-submit flag

-submit Submits (or resubmits) a job to a job host in one of three output modes:batchinteractive, or interactive-streaming.

Default (without additional flags to specify) is “interactive.”

-submit flag is always required to submit a job.

Page 27: Globus Toolkit 4.0 Grid Resource Allocation Manager  (GRAM) Job submission

1b.27

Specifying where job is submitted

-F Specifies the “contact” for the job submission.

Defaulthttps://localhost:8443/wsrf/services/

ManagedJobFactoryService

In assignment 2, simply localhost and container port used, i.e.

-F localhost:8440Jeremy decided on this port.

Page 28: Globus Toolkit 4.0 Grid Resource Allocation Manager  (GRAM) Job submission

1b.28

Selecting a different host

Example

globusrun-ws –submit –F

https://140.221.65.193:4444/wsrf/

services/managedJobFactoryService

–f prog1.xml

Page 29: Globus Toolkit 4.0 Grid Resource Allocation Manager  (GRAM) Job submission

1b.29

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.

Page 30: Globus Toolkit 4.0 Grid Resource Allocation Manager  (GRAM) Job submission

1b.30

-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.

Page 31: Globus Toolkit 4.0 Grid Resource Allocation Manager  (GRAM) Job submission

1b.31

Contents of echo.xml

<job>

<executable>/bin/echo</executable>

<argument>hello</argument>

</job>

Page 32: Globus Toolkit 4.0 Grid Resource Allocation Manager  (GRAM) Job submission

1b.32

Input/OutputRSL 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>

Page 33: Globus Toolkit 4.0 Grid Resource Allocation Manager  (GRAM) Job submission

1b.33

Stream Input/Output

-s The 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.

Page 34: Globus Toolkit 4.0 Grid Resource Allocation Manager  (GRAM) Job submission

1b.34

Stream output data files

Can also “stream” output data files. Specify in RSL file where to.

Page 35: Globus Toolkit 4.0 Grid Resource Allocation Manager  (GRAM) Job submission

1b.35

Example<job>

<fileStageOut>

<transfer>

<sourceUrl>file:///tmp/job.out</sourceUrl>

<destinationUrl>gsiftp://host.domain:2811/

tmp/stage.out</destinationUrl>

</transfer>

</fileStageOut>

</job>

Page 36: Globus Toolkit 4.0 Grid Resource Allocation Manager  (GRAM) Job submission

1b.36

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.

Page 37: Globus Toolkit 4.0 Grid Resource Allocation Manager  (GRAM) Job submission

1b.37

ExampleSubmit 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-0011115aae1fTermination time: 07/20/2005 17:44 GMTCurrent job state: ActiveCurrent job state: CleanUpCurrent job state: DoneDestroying job...Done.

Page 38: Globus Toolkit 4.0 Grid Resource Allocation Manager  (GRAM) Job submission

1b.38

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

Page 39: Globus Toolkit 4.0 Grid Resource Allocation Manager  (GRAM) Job submission

1b.39

globusrun-ws -submit -F localhost:8440

-s -so echo_output -c /bin/echo hello

name of file holding output

Argument for echo

Page 40: Globus Toolkit 4.0 Grid Resource Allocation Manager  (GRAM) Job submission

1b.40

Batch Submission

Job queued for execution.

-batch Results 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.

Page 41: Globus Toolkit 4.0 Grid Resource Allocation Manager  (GRAM) Job submission

1b.41

Batch Job Submission

$ globusrun-ws –submit –batch –o job_epr –s /bin/sleep 50

Submitting job…DoneJoB ID: uuid:f9544174-60c5-11d9-97e3-0002a5ad41e5Termination time: 01/08/2005 16:05 GMT

Page 42: Globus Toolkit 4.0 Grid Resource Allocation Manager  (GRAM) Job submission

1b.42

Monitoring Batch Submission

-monitor Attaches to an existing job in interactive or interactive-streaming output modes.

-j filename EPR for ManagedJob read from file.

Page 43: Globus Toolkit 4.0 Grid Resource Allocation Manager  (GRAM) Job submission

1b.43

Monitoring Batch Job

globusrun-ws –monitor –j job_epr

job state: ActiveCurrent job state: CleanUpCurrent job state: DoneRequesting original job description...Done.Destroying job...Done

Page 44: Globus Toolkit 4.0 Grid Resource Allocation Manager  (GRAM) Job submission

1b.44

Batch Submission

-status Reports the current state of the job and exits

-kill Requests immediate cancellation of job and exits.

Page 45: Globus Toolkit 4.0 Grid Resource Allocation Manager  (GRAM) Job submission

1b.45

Page 46: Globus Toolkit 4.0 Grid Resource Allocation Manager  (GRAM) Job submission

1b.46

Many other flagsExample

-term time

Set an absolute termination time, or a time relative to the successful job creation

Page 47: Globus Toolkit 4.0 Grid Resource Allocation Manager  (GRAM) Job submission

1b.47

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

Page 48: Globus Toolkit 4.0 Grid Resource Allocation Manager  (GRAM) Job submission

1b.48

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!!

Page 49: Globus Toolkit 4.0 Grid Resource Allocation Manager  (GRAM) Job submission

1b.49

Multiple choice quizWhen 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

Page 50: Globus Toolkit 4.0 Grid Resource Allocation Manager  (GRAM) Job submission

1b.50

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

Page 51: Globus Toolkit 4.0 Grid Resource Allocation Manager  (GRAM) Job submission

1b.51

When one issues the GT4.0 command:

globusrun-ws -submit -F localhost:8440 -s

-so hello1 -c /bin/echo hello

what is localhost?

(a) The server logged into running globusrun-ws.

(b) The computer you are using to log into the server

(c) None of the other answers.

Page 52: Globus Toolkit 4.0 Grid Resource Allocation Manager  (GRAM) Job submission

1b.52

What does the tag <count> specify in an RSL-2 file?

(a) The number of different jobs submitted.

(b) The number of computers to use.

(c) The number of identical jobs to submit.

(d) The number of arguments.

Page 53: Globus Toolkit 4.0 Grid Resource Allocation Manager  (GRAM) Job submission

1b.53

Questions