Changes between Initial Version and Version 1 of qcg-advanced-client

Show
Ignore:
Timestamp:
08/07/13 17:24:20 (11 years ago)
Author:
piontek
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • qcg-advanced-client

    v1 v1  
     1The QCG-Advance Client offers an access to the full functionality of the QCG system. 
     2 
     3'''IMPORTANT:''' For users who do not need advanced capabilities of the QCG system, the QCG-Simple client is strongly recommended. 
     4 
     5= Job Profile = 
     6Every experiment submitted to QCG-Broker has to be described by XML-based document called ''Job Profile''. The structure of ''Job Profile'' is formalized by [[http://node2.qoscosgrid.man.poznan.pl/~piontek/qcg-broker/QCGJobDescriptionSchema.xsd|Job Profile schema]]. 
     7 
     8Examples of Job Profiles describing basic use cases are distributed with QCG-Broker and can be found in `<CLIENT_DIR>/examples directory`. 
     9 
     10= Usage = 
     11 
     12The QCG-Groker command-line java based client can operate in two modes: 
     13 
     14* '''batch mode''' – that executes single operation with arguments passed directly to the client during its invocation. The batch mode allows to use the client in any kind of scripts mostly in cases when the processing of output is needed to steer the experiment, 
     15* '''console mode''' – that works similar to shell console in which user can type in lines with operations and arguments to be executed by service. The console mode gives additional useful features like aliases, history accessible by arrows-keys, creation and management of user proxy, help functionality.  
     16 
     17The usage of the client depends on the mode: 
     18* for batch mode: "`qcg-client OPRATION [ARG1 .. ARGn]`" 
     19* for console mode: "`qcg-client -console`" and then user is prompted to type in lines in format "`OPERATION [ARG1 .. ARGn]`" to be processed by client.  
     20 
     21'''IMPORTANT:''' To secure the communication between client and service and to delegate user's privileges to the service client needs access to user's proxy certificate. 
     22 
     23== Operations == 
     24 
     25Regardless from the mode the QCG-Broker java based command-line client supports following list of operations: 
     26 
     27||= '''Operation''' =||= '''Arguments''' =||= '''Description''' =|| 
     28||='''submit_job''' =|| `<desc_file>` `[QCG_SIMPLE, QCG or JSDL]` || submits a job to be executed. The description of job can be expressed either in native QCG-Broker language (the default one) or in JSDL one. '''In case when the job to be submitted is described in JSDL format the type (JSDL) must be explicitly specified'''. If the description is valid client returns to the user a globally unique job identifier, which unambiguously identifies the job in the system.  QCG defines jobs as a sets of dependent tasks that constitute a logical whole (workflow). Each task is executed by system only if all tasks it depends on are in specified by the user states. ||  
     29||='''list_jobs''' =|| `[<limit>]` `[<status>]` || lists jobs belonging to the `user`. It is possible either to `limit` number of jobs or to display only ones in given state. All possible states are listed below  the table. || 
     30||='''list_user_jobs''' =|| `<user>` `[<limit>]` `[<status>]` || lists jobs belonging to the given `user`. The functionality is destined for administrative purposes. || 
     31||='''test_description''' =|| `<desc_file>` `[QCG or JSDL]` || validates job description ||  
     32||='''translate_description''' =|| `<desc_file>` JSDL || translates job description to native QCG-Broker one || 
     33||='''job_info''' =|| `<jobId>` `[<showJobDesc>]` || return complex information about the given job. If the `showJobDesc is` `true` the job description is shown. || 
     34||='''cancel_job''' =|| `<jobId>` || cancels execution of the given job || 
     35||='''commit_job''' =|| `<jobId>` || allows to approve the job submitted with two phase commit mechanism to be processed by the system. The two phase commit mechanism can be used to register notifications before the processing of the job will be started by broker. || 
     36||='''list_tasks''' =|| `<jobId>` `[<status>]` || lists tasks belonging to given job. Optionally it is possible to specify the task's status. Possible task statuses are listed below the table. || 
     37||='''tasks_statuses''' =|| `<jobId>` `[<summary>]` || lists tasks constituting the given job with their statuses. If the `summary` argument is `true` some additionall statistics is displayed. || 
     38||='''register_job_notification''' || `<jobId>` `<url>` || registers notification consumer for the given job || 
     39||='''list_job_notifications''' =|| `<jobId>` || lists notifications registered for the given job || 
     40||='''register_tasks_notification''' =|| `<jobId>` `<url>` || register notification for all tasks of the given job || 
     41||='''monitor_job''' =|| `<jobId>` `[<interval>]` || monitors status changes of tasks belonging to given job. The `interval` argument determines delay in seconds between next status checks. || 
     42||='''monitor_task''' =|| `<jobId>` `<taskId>` `[<interval>]` || monitors status changes of allocations belonging to the given tasks. The `interval` argument determines delay in seconds between next status checks. || 
     43||='''task_info''' =|| `<jobId>` `<taskId>` `[<showDesc>` `[<limit>]]` || displays information about the given task. If the `showDesc` is `true` the task description is shown. If the `limit` argument is specified the history of the task is limited to given value. =|| 
     44||='''register_task_notification''' =|| `<jobId>` `<taskId>` `<url>` || registers task's notification consumer || 
     45||='''list_task_notifications''' =|| `<jobId>` `<taskId>` || lists task's notifications || 
     46||='''cancel_task''' =|| `<jobId>` `<taskId>` || cancels execution of the given task || 
     47||='''commit_task''' =|| `<jobId>` `<taskId>` || commits the given task to be processed by the system || 
     48||='''reserve_resources''' =|| `[<taskId>]` `<job_desc>` (QCG or JSDL) || reserve resources that meet either the wole job or given task requirements. The reservation identifier is returned. This functionality is not implemented yet! || 
     49||='''reservation_info''' =|| `<reservationId>` || return complex information concerning the given reservation: list of reserved resources, local identifiers of reservations, reservation time slot. This functionality id not implemented yet! || 
     50||='''cancel_reservation''' =|| `<reservationId>` || releases reserved resources. This functionality is not implemented yet! || 
     51 
     52 
     53List of Job statuses: 
     54    * UNCOMMITTED - the job was submitted with two phase commit option and waits to be committed, 
     55    * SUBMITTED – the job was submitted to the system and is executed by the system, 
     56    * SUSPENDED – the job was suspended, 
     57    * ACTIVE – the job is active, at least one task is processed, 
     58    * FINISHED – the job was completed, 
     59    * FAILED – the job (at least one crucial task belonging to the job) failed 
     60    * CANCELED – the job was canceled by the user, 
     61    * BROKEN - one or more of crucial tasks failed, system waits until active tasks will finish and change the status of the job to FAILED.|  
     62 
     63List of Task statuses: 
     64    * UNSUBMITTED – the task cannot be started because of dependencies, 
     65    * UNCOMMITED - the task waits to be committed, 
     66    * QUEUED – the task was put into the queue and waits for execution, 
     67    * PREPROCESSING – system makes some actions needed to start the task (looks for the resource, stages in files), 
     68    * PENDING – the task is pending in the queueing-system, 
     69    * RUNNING – the task is active, 
     70    * STOPPED – the task was finished or was checkpointed, but system did not start staging out files, 
     71    * POSTPROCESSING – system makes some actions needed to complete the task, for example stages out files, cleares working environment, etc., 
     72    * FINISHED – the task was completed, 
     73    * SUSPENDED – the task was suspended, 
     74    * FAILED – the task failed, 
     75    * CANCELED – the task was canceled by the user. 
     76== Usage examples == 
     77 
     78The example presented below is the QCG-Broker Job Profile describing the parameter-sweep experiment executing a set of UNIX calendar tasks for the predefined space of "month" parameter. 
     79 
     80{{{ 
     81#!div style="font-size: 90%" 
     82{{{#!xml 
     83<qcgJob appId="calendar_example"> 
     84        <task persistent="true" taskId="calendar"> 
     85                <execution type="single"> 
     86                        <executable> 
     87                                <execFile> 
     88                                        <file> 
     89                                                <location type="URL">file:////usr/bin/cal</location> 
     90                                        </file> 
     91                                </execFile> 
     92                        </executable> 
     93                        <arguments> 
     94                                <value>${PS_month}</value> 
     95                                <value>2010</value> 
     96                        </arguments> 
     97                        <stdout> 
     98                                <file> 
     99                                        <location type="URL">${TASK_DIR}/stdout.txt</location> 
     100                                </file> 
     101                        </stdout> 
     102                </execution> 
     103                <parametersSweep> 
     104                        <parameter> 
     105                                <name>month</name> 
     106                                <value> 
     107                                        <loop> 
     108                                                <start>1</start> 
     109                                                <end>12</end> 
     110                                                <step>1</step> 
     111                                                <except> 
     112                                                        <value>3</value> 
     113                                                        <value>6</value> 
     114                                                </except> 
     115                                        </loop> 
     116                                </value> 
     117                        </parameter> 
     118                </parametersSweep> 
     119        </task> 
     120</qcgJob> 
     121}}} 
     122}}} 
     123 
     124=== submit_job === 
     125* `submit_job <job_profile>` - submits job. `<job_profile>` must be the path to the file containing the Job Profile. 
     126{{{ 
     127#!div style="font-size: 90%" 
     128{{{#!sh 
     129qcg-client submit_job ../examples/usecase8.xml QCG 
     130Your identity: C=PL,O=GRID,O=PSNC,CN=Tomasz Piontek 
     131Creating proxy, please wait... 
     132Proxy verify OK 
     133Your proxy is valid until Tue May 17 02:55:47 CEST 2011 
     134UserDN = /C=PL/O=GRID/O=PSNC/CN=Tomasz Piontek 
     135ProxyLifetime = 0 Days 11 Hours 59 Minutes 57 Seconds 
     136 
     137jobId = 1305550554579_calendar_example_5366 
     138}}} 
     139}}} 
     140 
     141=== list_jobs === 
     142* `list_jobs [status] [limit]` - lists jobs. Optionally it is possible to specify status or limits the output to some number of recent jobs. 
     143{{{ 
     144#!div style="font-size: 90%" 
     145{{{#!sh 
     146qcg-client list_jobs 5 
     147UserDN = /C=PL/O=GRID/O=PSNC/CN=Tomasz Piontek 
     148ProxyLifetime = 0 Days 11 Hours 58 Minutes 47 Seconds 
     149 
     150Number of jobs: 5 
     151List of jobs:  
     1521301904727887_calendar_example_1403 
     1531304020897352_calendar_example_4252 
     1541304065465905_calendar_example_9526 
     1551305287977790_calendar_example_4779 
     1561305550554579_calendar_example_5366 
     157}}} 
     158}}} 
     159 
     160=== job_info === 
     161* `job_info <jobId> <showJobProfile>` - displays information about the given job. The `<showJobProfile>` argument of boolean type specifies whether the Job Profile should be displayed or not. 
     162{{{ 
     163#!div style="font-size: 90%" 
     164{{{#!sh 
     165qcg-client job_info 1305550554579_calendar_example_5366 false 
     166UserDN = /C=PL/O=GRID/O=PSNC/CN=Tomasz Piontek 
     167ProxyLifetime = 0 Days 11 Hours 58 Minutes 18 Seconds 
     168 
     169UserDN: /C=PL/O=GRID/O=PSNC/CN=Tomasz Piontek 
     170Project:  
     171Status: FINISHED 
     172StatusDesc:  
     173SubmissionTime: Mon May 16 14:55:54 CEST 2011 
     174FinishTime: Mon May 16 14:56:42 CEST 2011 
     175Number of tasks: 10 
     176Tasks: calendar_PSit0 calendar_PSit1 calendar_PSit2 calendar_PSit3 calendar_PSit4 calendar_PSit5 calendar_PSit6 calendar_PSit7 calendar_PSit8 calendar_PSit9  
     177}}} 
     178{{{#!sh 
     179$ qcg-client job_info 1305550554579_calendar_example_5366 
     180UserDN = /C=PL/O=GRID/O=PSNC/CN=Tomasz Piontek 
     181ProxyLifetime = 0 Days 11 Hours 58 Minutes 6 Seconds 
     182 
     183UserDN: /C=PL/O=GRID/O=PSNC/CN=Tomasz Piontek 
     184Project:  
     185Status: FINISHED 
     186StatusDesc:  
     187SubmissionTime: Mon May 16 14:55:54 CEST 2011 
     188FinishTime: Mon May 16 14:56:42 CEST 2011 
     189Number of tasks: 10 
     190Tasks: calendar_PSit0 calendar_PSit1 calendar_PSit2 calendar_PSit3 calendar_PSit4 calendar_PSit5 calendar_PSit6 calendar_PSit7 calendar_PSit8 calendar_PSit9  
     191DescriptionType: GRMS 
     192UserDescription:  
     193<qcgJob appId="calendar_example"> 
     194  <task persistent="true" taskId="calendar"> 
     195    <execution type="single"> 
     196      <executable> 
     197        <execFile> 
     198          <file> 
     199            <location type="URL">file:////usr/bin/cal</location> 
     200          </file> 
     201        </execFile> 
     202      </executable> 
     203      <arguments> 
     204        <value>${PS_month}</value> 
     205        <value>2010</value> 
     206      </arguments> 
     207      <stdout> 
     208        <file> 
     209          <location type="URL">${TASK_DIR}/stdout.txt</location> 
     210        </file> 
     211      </stdout> 
     212    </execution> 
     213    <parametersSweep> 
     214      <parameter> 
     215        <name>month</name> 
     216        <value> 
     217          <loop> 
     218            <start>1</start> 
     219            <end>12</end> 
     220            <step>1</step> 
     221            <except> 
     222              <value>3</value> 
     223              <value>6</value> 
     224            </except> 
     225          </loop> 
     226        </value> 
     227      </parameter> 
     228    </parametersSweep> 
     229  </task> 
     230</qcgJob> 
     231 
     232QCGDescription:  
     233<grmsJob appId="calendar_example"> 
     234  <task persistent="true" taskId="calendar_PSit0"> 
     235    <execution type="single"> 
     236      <executable> 
     237        <execFile> 
     238          <file> 
     239            <location type="URL">file:////usr/bin/cal</location> 
     240          </file> 
     241        </execFile> 
     242      </executable> 
     243      <arguments> 
     244        <value>1.0</value> 
     245        <value>2010</value> 
     246      </arguments> 
     247      <stdout> 
     248        <file> 
     249          <location type="URL">${TASK_DIR}/stdout.txt</location> 
     250        </file> 
     251      </stdout> 
     252    </execution> 
     253  </task> 
     254  <task persistent="true" taskId="calendar_PSit1"> 
     255    <execution type="single"> 
     256      <executable> 
     257        <execFile> 
     258          <file> 
     259            <location type="URL">file:////usr/bin/cal</location> 
     260          </file> 
     261        </execFile> 
     262      </executable> 
     263      <arguments> 
     264        <value>2.0</value> 
     265        <value>2010</value> 
     266      </arguments> 
     267      <stdout> 
     268        <file> 
     269          <location type="URL">${TASK_DIR}/stdout.txt</location> 
     270        </file> 
     271      </stdout> 
     272    </execution> 
     273  </task> 
     274  <task persistent="true" taskId="calendar_PSit2"> 
     275    <execution type="single"> 
     276      <executable> 
     277        <execFile> 
     278          <file> 
     279            <location type="URL">file:////usr/bin/cal</location> 
     280          </file> 
     281        </execFile> 
     282      </executable> 
     283      <arguments> 
     284        <value>4.0</value> 
     285        <value>2010</value> 
     286      </arguments> 
     287      <stdout> 
     288        <file> 
     289          <location type="URL">${TASK_DIR}/stdout.txt</location> 
     290        </file> 
     291      </stdout> 
     292    </execution> 
     293  </task> 
     294  <task persistent="true" taskId="calendar_PSit3"> 
     295    <execution type="single"> 
     296      <executable> 
     297        <execFile> 
     298          <file> 
     299            <location type="URL">file:////usr/bin/cal</location> 
     300          </file> 
     301        </execFile> 
     302      </executable> 
     303      <arguments> 
     304        <value>5.0</value> 
     305        <value>2010</value> 
     306      </arguments> 
     307      <stdout> 
     308        <file> 
     309          <location type="URL">${TASK_DIR}/stdout.txt</location> 
     310        </file> 
     311      </stdout> 
     312    </execution> 
     313  </task> 
     314  <task persistent="true" taskId="calendar_PSit4"> 
     315    <execution type="single"> 
     316      <executable> 
     317        <execFile> 
     318          <file> 
     319            <location type="URL">file:////usr/bin/cal</location> 
     320          </file> 
     321        </execFile> 
     322      </executable> 
     323      <arguments> 
     324        <value>7.0</value> 
     325        <value>2010</value> 
     326      </arguments> 
     327      <stdout> 
     328        <file> 
     329          <location type="URL">${TASK_DIR}/stdout.txt</location> 
     330        </file> 
     331      </stdout> 
     332    </execution> 
     333  </task> 
     334  <task persistent="true" taskId="calendar_PSit5"> 
     335    <execution type="single"> 
     336      <executable> 
     337        <execFile> 
     338          <file> 
     339            <location type="URL">file:////usr/bin/cal</location> 
     340          </file> 
     341        </execFile> 
     342      </executable> 
     343      <arguments> 
     344        <value>8.0</value> 
     345        <value>2010</value> 
     346      </arguments> 
     347      <stdout> 
     348        <file> 
     349          <location type="URL">${TASK_DIR}/stdout.txt</location> 
     350        </file> 
     351      </stdout> 
     352    </execution> 
     353  </task> 
     354  <task persistent="true" taskId="calendar_PSit6"> 
     355    <execution type="single"> 
     356      <executable> 
     357        <execFile> 
     358          <file> 
     359            <location type="URL">file:////usr/bin/cal</location> 
     360          </file> 
     361        </execFile> 
     362      </executable> 
     363      <arguments> 
     364        <value>9.0</value> 
     365        <value>2010</value> 
     366      </arguments> 
     367      <stdout> 
     368        <file> 
     369          <location type="URL">${TASK_DIR}/stdout.txt</location> 
     370        </file> 
     371      </stdout> 
     372    </execution> 
     373  </task> 
     374  <task persistent="true" taskId="calendar_PSit7"> 
     375    <execution type="single"> 
     376      <executable> 
     377        <execFile> 
     378          <file> 
     379            <location type="URL">file:////usr/bin/cal</location> 
     380          </file> 
     381        </execFile> 
     382      </executable> 
     383      <arguments> 
     384        <value>10.0</value> 
     385        <value>2010</value> 
     386      </arguments> 
     387      <stdout> 
     388        <file> 
     389          <location type="URL">${TASK_DIR}/stdout.txt</location> 
     390        </file> 
     391      </stdout> 
     392    </execution> 
     393  </task> 
     394  <task persistent="true" taskId="calendar_PSit8"> 
     395    <execution type="single"> 
     396      <executable> 
     397        <execFile> 
     398          <file> 
     399            <location type="URL">file:////usr/bin/cal</location> 
     400          </file> 
     401        </execFile> 
     402      </executable> 
     403      <arguments> 
     404        <value>11.0</value> 
     405        <value>2010</value> 
     406      </arguments> 
     407      <stdout> 
     408        <file> 
     409          <location type="URL">${TASK_DIR}/stdout.txt</location> 
     410        </file> 
     411      </stdout> 
     412    </execution> 
     413  </task> 
     414  <task persistent="true" taskId="calendar_PSit9"> 
     415    <execution type="single"> 
     416      <executable> 
     417        <execFile> 
     418          <file> 
     419            <location type="URL">file:////usr/bin/cal</location> 
     420          </file> 
     421        </execFile> 
     422      </executable> 
     423      <arguments> 
     424        <value>12.0</value> 
     425        <value>2010</value> 
     426      </arguments> 
     427      <stdout> 
     428        <file> 
     429          <location type="URL">${TASK_DIR}/stdout.txt</location> 
     430        </file> 
     431      </stdout> 
     432    </execution> 
     433  </task> 
     434</qcgJob> 
     435}}} 
     436}}} 
     437 
     438=== tasks_statuses === 
     439* `tasks_statuses <jobId>` - lists tasks constituting the given job with their statuses. 
     440{{{ 
     441#!div style="font-size: 90%" 
     442{{{#!sh 
     443qcg-client tasks_statuses 1305550554579_calendar_example_5366 
     444UserDN = /C=PL/O=GRID/O=PSNC/CN=Tomasz Piontek 
     445ProxyLifetime = 0 Days 11 Hours 41 Minutes 30 Seconds 
     446 
     447Number of tasks: 10 
     448Tasks statuses:  
     449calendar_PSit7  : FINISHED 
     450calendar_PSit6  : FINISHED 
     451calendar_PSit5  : FINISHED 
     452calendar_PSit4  : FINISHED 
     453calendar_PSit3  : FINISHED 
     454calendar_PSit2  : FINISHED 
     455calendar_PSit1  : FINISHED 
     456calendar_PSit0  : FINISHED 
     457calendar_PSit9  : FINISHED 
     458calendar_PSit8  : FINISHED 
     459------ SUMMARY -------- 
     460Number of tasks: 10 
     461FINISHED        : 10 
     462}}} 
     463}}} 
     464 
     465=== task_info === 
     466* `task_info <jobId> <taskId>` - displays information about the given job 
     467{{{ 
     468#!div style="font-size: 90%" 
     469{{{#!sh 
     470qcg-client task_info 1305550554579_calendar_example_5366 calendar_PSit0 
     471UserDN = /C=PL/O=GRID/O=PSNC/CN=Tomasz Piontek 
     472ProxyLifetime = 0 Days 11 Hours 40 Minutes 11 Seconds 
     473 
     474TaskType: SINGLE 
     475SubmissionTime: Mon May 16 14:55:57 CEST 2011 
     476FinishTime: Mon May 16 14:56:27 CEST 2011 
     477ProxyLifetime: PT0S 
     478Status: FINISHED 
     479StatusDesc:  
     480StartTime: Mon May 16 14:56:04 CEST 2011 
     481DescriptionType: <task persistent="true" taskId="calendar_PSit0"> 
     482  <execution type="single"> 
     483    <executable> 
     484      <execFile> 
     485        <file> 
     486          <location type="URL">file:////usr/bin/cal</location> 
     487        </file> 
     488      </execFile> 
     489    </executable> 
     490    <arguments> 
     491      <value>1.0</value> 
     492      <value>2010</value> 
     493    </arguments> 
     494    <stdout> 
     495      <file> 
     496        <location type="URL">${TASK_DIR}/stdout.txt</location> 
     497      </file> 
     498    </stdout> 
     499  </execution> 
     500</task> 
     501 
     502 
     503Coallocation:  
     504UserDN: /C=PL/O=GRID/O=PSNC/CN=Tomasz Piontek 
     505HostName: grass1.man.poznan.pl 
     506ProcessesCount: 1 
     507ProcessesGroupId:  
     508Status: FINISHED 
     509StatusDescription:  
     510SubmissionTime: Mon May 16 14:56:04 CEST 2011 
     511FinishTime: Mon May 16 14:56:21 CEST 2011 
     512LocalSubmissionTime: Mon May 16 14:56:06 CEST 2011 
     513LocalStartTime: Mon May 16 14:56:10 CEST 2011 
     514LocalFinishTime: Mon May 16 14:56:10 CEST 2011 
     515}}} 
     516}}}