The QCG-Advance Client offers an access to the full functionality of the QCG system. '''IMPORTANT:''' For users who do not need advanced capabilities of the QCG system, the QCG-Simple client is strongly recommended. = Job Profile = Every 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]]. Examples of Job Profiles describing basic use cases are distributed with QCG-Broker and can be found in `/examples directory`. = Usage = The QCG-Groker command-line java based client can operate in two modes: * '''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, * '''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. The usage of the client depends on the mode: * for batch mode: "`qcg-client OPRATION [ARG1 .. ARGn]`" * 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. '''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. == Operations == Regardless from the mode the QCG-Broker java based command-line client supports following list of operations: ||= '''Operation''' =||= '''Arguments''' =||= '''Description''' =|| ||='''submit_job''' =|| `` `[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. || ||='''list_jobs''' =|| `[]` `[]` || 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. || ||='''list_user_jobs''' =|| `` `[]` `[]` || lists jobs belonging to the given `user`. The functionality is destined for administrative purposes. || ||='''test_description''' =|| `` `[QCG or JSDL]` || validates job description || ||='''translate_description''' =|| `` JSDL || translates job description to native QCG-Broker one || ||='''job_info''' =|| `` `[]` || return complex information about the given job. If the `showJobDesc is` `true` the job description is shown. || ||='''cancel_job''' =|| `` || cancels execution of the given job || ||='''commit_job''' =|| `` || 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. || ||='''list_tasks''' =|| `` `[]` || lists tasks belonging to given job. Optionally it is possible to specify the task's status. Possible task statuses are listed below the table. || ||='''tasks_statuses''' =|| `` `[]` || lists tasks constituting the given job with their statuses. If the `summary` argument is `true` some additionall statistics is displayed. || ||='''register_job_notification''' || `` `` || registers notification consumer for the given job || ||='''list_job_notifications''' =|| `` || lists notifications registered for the given job || ||='''register_tasks_notification''' =|| `` `` || register notification for all tasks of the given job || ||='''monitor_job''' =|| `` `[]` || monitors status changes of tasks belonging to given job. The `interval` argument determines delay in seconds between next status checks. || ||='''monitor_task''' =|| `` `` `[]` || monitors status changes of allocations belonging to the given tasks. The `interval` argument determines delay in seconds between next status checks. || ||='''task_info''' =|| `` `` `[` `[]]` || 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. =|| ||='''register_task_notification''' =|| `` `` `` || registers task's notification consumer || ||='''list_task_notifications''' =|| `` `` || lists task's notifications || ||='''cancel_task''' =|| `` `` || cancels execution of the given task || ||='''commit_task''' =|| `` `` || commits the given task to be processed by the system || ||='''reserve_resources''' =|| `[]` `` (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! || ||='''reservation_info''' =|| `` || return complex information concerning the given reservation: list of reserved resources, local identifiers of reservations, reservation time slot. This functionality id not implemented yet! || ||='''cancel_reservation''' =|| `` || releases reserved resources. This functionality is not implemented yet! || List of Job statuses: * UNCOMMITTED - the job was submitted with two phase commit option and waits to be committed, * SUBMITTED – the job was submitted to the system and is executed by the system, * SUSPENDED – the job was suspended, * ACTIVE – the job is active, at least one task is processed, * FINISHED – the job was completed, * FAILED – the job (at least one crucial task belonging to the job) failed * CANCELED – the job was canceled by the user, * BROKEN - one or more of crucial tasks failed, system waits until active tasks will finish and change the status of the job to FAILED.| List of Task statuses: * UNSUBMITTED – the task cannot be started because of dependencies, * UNCOMMITED - the task waits to be committed, * QUEUED – the task was put into the queue and waits for execution, * PREPROCESSING – system makes some actions needed to start the task (looks for the resource, stages in files), * PENDING – the task is pending in the queueing-system, * RUNNING – the task is active, * STOPPED – the task was finished or was checkpointed, but system did not start staging out files, * POSTPROCESSING – system makes some actions needed to complete the task, for example stages out files, cleares working environment, etc., * FINISHED – the task was completed, * SUSPENDED – the task was suspended, * FAILED – the task failed, * CANCELED – the task was canceled by the user. == Usage examples == The 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. {{{ #!div style="font-size: 90%" {{{#!xml file:////usr/bin/cal ${PS_month} 2010 ${TASK_DIR}/stdout.txt month 1 12 1 3 6 }}} }}} === submit_job === * `submit_job ` - submits job. `` must be the path to the file containing the Job Profile. {{{ #!div style="font-size: 90%" {{{#!sh qcg-client submit_job ../examples/usecase8.xml QCG Your identity: C=PL,O=GRID,O=PSNC,CN=Tomasz Piontek Creating proxy, please wait... Proxy verify OK Your proxy is valid until Tue May 17 02:55:47 CEST 2011 UserDN = /C=PL/O=GRID/O=PSNC/CN=Tomasz Piontek ProxyLifetime = 0 Days 11 Hours 59 Minutes 57 Seconds jobId = 1305550554579_calendar_example_5366 }}} }}} === list_jobs === * `list_jobs [status] [limit]` - lists jobs. Optionally it is possible to specify status or limits the output to some number of recent jobs. {{{ #!div style="font-size: 90%" {{{#!sh qcg-client list_jobs 5 UserDN = /C=PL/O=GRID/O=PSNC/CN=Tomasz Piontek ProxyLifetime = 0 Days 11 Hours 58 Minutes 47 Seconds Number of jobs: 5 List of jobs: 1301904727887_calendar_example_1403 1304020897352_calendar_example_4252 1304065465905_calendar_example_9526 1305287977790_calendar_example_4779 1305550554579_calendar_example_5366 }}} }}} === job_info === * `job_info ` - displays information about the given job. The `` argument of boolean type specifies whether the Job Profile should be displayed or not. {{{ #!div style="font-size: 90%" {{{#!sh qcg-client job_info 1305550554579_calendar_example_5366 false UserDN = /C=PL/O=GRID/O=PSNC/CN=Tomasz Piontek ProxyLifetime = 0 Days 11 Hours 58 Minutes 18 Seconds UserDN: /C=PL/O=GRID/O=PSNC/CN=Tomasz Piontek Project: Status: FINISHED StatusDesc: SubmissionTime: Mon May 16 14:55:54 CEST 2011 FinishTime: Mon May 16 14:56:42 CEST 2011 Number of tasks: 10 Tasks: calendar_PSit0 calendar_PSit1 calendar_PSit2 calendar_PSit3 calendar_PSit4 calendar_PSit5 calendar_PSit6 calendar_PSit7 calendar_PSit8 calendar_PSit9 }}} {{{#!sh $ qcg-client job_info 1305550554579_calendar_example_5366 UserDN = /C=PL/O=GRID/O=PSNC/CN=Tomasz Piontek ProxyLifetime = 0 Days 11 Hours 58 Minutes 6 Seconds UserDN: /C=PL/O=GRID/O=PSNC/CN=Tomasz Piontek Project: Status: FINISHED StatusDesc: SubmissionTime: Mon May 16 14:55:54 CEST 2011 FinishTime: Mon May 16 14:56:42 CEST 2011 Number of tasks: 10 Tasks: calendar_PSit0 calendar_PSit1 calendar_PSit2 calendar_PSit3 calendar_PSit4 calendar_PSit5 calendar_PSit6 calendar_PSit7 calendar_PSit8 calendar_PSit9 DescriptionType: GRMS UserDescription: file:////usr/bin/cal ${PS_month} 2010 ${TASK_DIR}/stdout.txt month 1 12 1 3 6 QCGDescription: file:////usr/bin/cal 1.0 2010 ${TASK_DIR}/stdout.txt file:////usr/bin/cal 2.0 2010 ${TASK_DIR}/stdout.txt file:////usr/bin/cal 4.0 2010 ${TASK_DIR}/stdout.txt file:////usr/bin/cal 5.0 2010 ${TASK_DIR}/stdout.txt file:////usr/bin/cal 7.0 2010 ${TASK_DIR}/stdout.txt file:////usr/bin/cal 8.0 2010 ${TASK_DIR}/stdout.txt file:////usr/bin/cal 9.0 2010 ${TASK_DIR}/stdout.txt file:////usr/bin/cal 10.0 2010 ${TASK_DIR}/stdout.txt file:////usr/bin/cal 11.0 2010 ${TASK_DIR}/stdout.txt file:////usr/bin/cal 12.0 2010 ${TASK_DIR}/stdout.txt }}} }}} === tasks_statuses === * `tasks_statuses ` - lists tasks constituting the given job with their statuses. {{{ #!div style="font-size: 90%" {{{#!sh qcg-client tasks_statuses 1305550554579_calendar_example_5366 UserDN = /C=PL/O=GRID/O=PSNC/CN=Tomasz Piontek ProxyLifetime = 0 Days 11 Hours 41 Minutes 30 Seconds Number of tasks: 10 Tasks statuses: calendar_PSit7 : FINISHED calendar_PSit6 : FINISHED calendar_PSit5 : FINISHED calendar_PSit4 : FINISHED calendar_PSit3 : FINISHED calendar_PSit2 : FINISHED calendar_PSit1 : FINISHED calendar_PSit0 : FINISHED calendar_PSit9 : FINISHED calendar_PSit8 : FINISHED ------ SUMMARY -------- Number of tasks: 10 FINISHED : 10 }}} }}} === task_info === * `task_info ` - displays information about the given job {{{ #!div style="font-size: 90%" {{{#!sh qcg-client task_info 1305550554579_calendar_example_5366 calendar_PSit0 UserDN = /C=PL/O=GRID/O=PSNC/CN=Tomasz Piontek ProxyLifetime = 0 Days 11 Hours 40 Minutes 11 Seconds TaskType: SINGLE SubmissionTime: Mon May 16 14:55:57 CEST 2011 FinishTime: Mon May 16 14:56:27 CEST 2011 ProxyLifetime: PT0S Status: FINISHED StatusDesc: StartTime: Mon May 16 14:56:04 CEST 2011 DescriptionType: file:////usr/bin/cal 1.0 2010 ${TASK_DIR}/stdout.txt Coallocation: UserDN: /C=PL/O=GRID/O=PSNC/CN=Tomasz Piontek HostName: grass1.man.poznan.pl ProcessesCount: 1 ProcessesGroupId: Status: FINISHED StatusDescription: SubmissionTime: Mon May 16 14:56:04 CEST 2011 FinishTime: Mon May 16 14:56:21 CEST 2011 LocalSubmissionTime: Mon May 16 14:56:06 CEST 2011 LocalStartTime: Mon May 16 14:56:10 CEST 2011 LocalFinishTime: Mon May 16 14:56:10 CEST 2011 }}} }}}