GRAM服务为有权用户提供了一种安全的向各种不同作业调度系统提交作业的方式,支持透明的提交选项,作业提交是通过GRAM的命令行工具实现的.
Gram支持的新功能
Job Description variable
作业环境变量在处理的时候被Gram替换,这一切对于作业的客户端是透明的.但在GRAM中,作业的描述变量是一个固定的集合,不支持用户自定义的环境变量.
submision ID
主要作用是保证在作业提交和传输的时候由于消息的丢失之类的原因,导致用户不断重复提交动作时作业的唯一性.这个ID可以由用户通过命令行传入.如果用户没有指定,那么缺省的情况下,GRAM会自动的产生一个.这个ID是一个UUID,全局唯一的
Job Hold and Release 主要用来在使得在执行到一定的状态的时候,hold响应的作业的进程,一个典型的应用就是为了让GRAM
Client取回作业的提交结果,必须在作业执行完的时候,hold住GRAM的cleanup进程.
Multijob 主要是提供多个作业同时提交的功能
Job and process rendezous
主要是提供Multijob和Subjobs之间的同步等待,作业可以注册自己的二进制信息,也可以在别人注册二进制信息的时候得到通知,这一点在没有rendevzous的操作系统上显得特别的重要.
Gram的使用
基于代理的安全机制,通过grid-proxy-init产生代理证书.如下所示 % bin/grid-proxy-init
Your identity: /O=Grid/OU=GlobusTest/OU=simpleCA.mymachine/OU=mymachine/CN=John Doe
Enter GRID pass phrase for this identity:
Creating proxy ................................. Done
Your proxy is valid until: Tue Oct 26 01:33:42 2004
支持没有Job description file的作业提交,通过命令行的方式 % globusrun-ws -submit -c /bin/touch touched_it
Submitting job...Done.
Job ID: uuid:4a92c06c-b371-11d9-9601-0002a5ad41e5
Termination time: 04/23/2005 20:58 GMT
Current job state: Active
Current job state: CleanUp
Current job state: Done
Destroying job...Done.
支持通过服务的方式(contact string)的方式提交job % globusrun-ws -submit -F https://lucky0.mcs.anl.gov:8443/wsrf/services/ManagedJobFactoryService -c /bin/touch touched_it
Submitting job...Done.
Job ID: uuid:3050ad64-b375-11d9-be11-0002a5ad41e5
Termination time: 04/23/2005 21:26 GMT
Current job state: Active
Current job state: CleanUp
Current job state: Done
Destroying job...Done.
支持Job description的方式提交job
下面是GRAM的一个Job作业描述文件 <job>
<executable>/bin/echo</executable>
<argument>this is an example_string </argument>
<argument>Globus was here</argument>
<stdout>${GLOBUS_USER_HOME}/stdout</stdout>
<stderr>${GLOBUS_USER_HOME}/stderr</stderr>
</job>
提交方式: % bin/globusrun-ws -submit -f test_super_simple.xml
Submitting job...Done.
Job ID: uuid:c51fe35a-4fa3-11d9-9cfc-000874404099
Termination time: 12/17/2004 20:47 GMT
Current job state: Active
Current job state: CleanUp
Current job state: Done
Destroying job...Done.
GRAM的文件支持作业的输入输出的重定向,下面是一个支持作业的输入输出重定向的描述 <?xml version="1.0" encoding="UTF-8"?>
<job>
<executable>/bin/echo</executable>
<directory>/tmp</directory>
<argument>12</argument>
<argument>abc</argument>
<argument>34</argument>
<argument>this is an example_string </argument>
<argument>Globus was here</argument>
<environment>
<name>PI</name>
<value>3.141</value>
</environment>
<stdin>/dev/null</stdin>
<stdout>stdout</stdout>
<stderr>stderr</stderr>
<count>2</count>
</job>
specify the file staging in the job description
在GRAM的具体是现中,其作业描述语言支持文件策略,主要是指定文件的输入和输出,也就是文件从哪里来,到哪里去,这个和我们的GRS很类似,可以说在一定的意义上我们的grs实现了GRAM的这部分功能.
下面是一个带有stage-in和stage-out的job description,注意这里的还不是JSDL语言 <job>
<executable>my_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>
<fileStageIn>
<transfer>
<sourceUrl>gsiftp://job.submitting.host:2811/bin/echo</sourceUrl>
<destinationUrl>file:///${GLOBUS_USER_HOME}/my_echo</destinationUrl>
</transfer>
</fileStageIn>
<fileStageOut>
<transfer>
<sourceUrl>file:///${GLOBUS_USER_HOME}/stdout</sourceUrl>
<destinationUrl>gsiftp://job.submitting.host:2811/tmp/stdout</destinationUrl>
</transfer>
</fileStageOut>
<fileCleanUp>
<deletion>
<file>file:///${GLOBUS_USER_HOME}/my_echo</file>
</deletion>
</fileCleanUp>
</job>
multijob and subjob
The subjobs are submitted to job factory services in their order of appearance
in the multijob description. A multijob resource is created by the factory and
exposes a set of WSRF resource properties different than the resource properties
of an executable job. The state machine of a multijob is also different since
the multijob represents the overall execution of all the executable jobs it is
composed of. multijob的resource是通过创造的,并且不暴露出一个WSRF的资源属性集合.
将一个同时执行多个可执行文件具构成了一个multijob,里面的每个作业叫做subjob,subjob里面不能再包含multijob,所以,这是一个两层结构,而不是一个递归结构.
GRAM的multijob的subjob之间没有任何关系,它们之间只有顺便关系,GRAM将按照subjob的定义顺序执行相应的job.
每个subjob的描述中必须定义一个endpoint以便multijob的factory将subjob提交给其执行.这里GRAM实际上的多个subjob实际上都是wsrf服务的调用.
实际上GRAM通过定义Multijob来支持wsrf多个wsrf的调用.
Excute的key Conception
gt提供了一系列的ws
我们的思考
JSDL的功能
尽管现在我们一直认为JSDL作业需要部属,需要包装,但今天马提了一个问题:我们要不要允许用户上传二进制文件我们执行.我们的第一回答肯定是不要.但仔细分析一下JSDL规范,发现如果不允许用户上传二进制文件,而要我们首先部属的话,JSDL里面的许多的东西就成了多余的元素,其中比较明显的几个就是CPUArchitecture,cpucunt等等.
因此,是不是我们的JSDL的引擎本身就存在问题,还是我们对于作业的定义本身就由问题.
特别是在进行详细设计的时候,发现这个问题比较严重.如果采用我们的方式,JSDL里面的资源需求一节可以说基本可以忽略了. |