Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "PTP/designs/3.x/rm proxy"

< PTP‎ | designs
(Proxy Events)
(Resource Manager Commands)
Line 15: Line 15:
 
; Protocol for commands: 1. The RM creates a transaction id for the command.<br>  2. The RM sends the command plus the transaction id to the proxy.<br> (A version number should be maintained for the protocol.)
 
; Protocol for commands: 1. The RM creates a transaction id for the command.<br>  2. The RM sends the command plus the transaction id to the proxy.<br> (A version number should be maintained for the protocol.)
  
; Wire protocol for a command: Commands are currently sent as transformed (tohex) ascii strings.<br> They contain (this needs more thought): COMMAND, TRANSACTION_ID, DATA.
+
; Wire protocol for a command: Commands are currently sent as transformed (tohex) ascii strings.<br> They command message contains: {MESSAGE_LENGTH (8 byte hex integer), TRANSACTION_ID (8 byte integer), COMMAND (4 byte hex integer), COMMAND_ARGS}, where, MESSAGE_LENGTH is length of the message in bytes (excluding the MESSAGE_LENGTH item) and COMMAND_ARGS is a list of command arguments separated by spaces.
  
; Initialize ("INIT"): Command to initialize the proxy.  After this command has been received, the proxy is ready to receive and process other commands from the RM.  Initialization data may be passed on the command line when the proxy is run.
+
; Initialize (CMD_INIT): Command to initialize the proxy.  It has one argument, the wire protocol version number.  After this command has been received, the proxy is ready to receive and process other commands from the RM.  Initialization data may be passed on the command line when the proxy is run.  The proxy asynchronously returns an OK/FAIL event completion of the command.
  
; Start events ("SEND_EVENTS"): Command to start sending events back to the RMInitially the proxy sends back the full machine state, but sends only state changes as diffs thereafter.
+
; Model definition (CMD_MODEL_DEF): Command to start the model definition sequenceThe proxy responds by a series of ATTR_DEF, LAUNCH_DEF, and ELEMENT_DEF events.  Attributes (see below) are meta-data describing data from the proxy that the RM is expected to receive and possibly display in the UI.  The sequence is terminated by an OK/FAIL event.
  
; Stop events ("HALT_EVENTS"): Command to halt the event stream to the RM.
+
; Start events (CMD_START_EVENTS): Command to start sending events back to the RM.  Initially the proxy sends back the full machine state, but sends only state changes as diffs thereafter.
  
; Finish ("FINISH"): Command for the proxy to cleanup and exit.
+
; Stop events (CMD_START_EVENTS): Command to halt the event stream to the RM.  The proxy responds by stoping the event stream, sending an OK event for the start event transaction, and finally sending an OK event for the stop event transaction.
  
; Attribute definition ("DEF_ATTRS"): Command requesting that proxy send a list of attributesAttributes (see below) are meta-data describing data from the proxy that the RM is expected to receive and possibly display in the UI.
+
; List event filters (CMD_LIST_FILTERS): Command to list the set of filters used to limit the event streamThe proxy responds by returning a filter list event and then an OK/FAIL event.
  
; Submit job ("SUBMIT"): Command to submit a job.
+
; Set event filters (CMD_SET_FILTERS): Command to set a set of filters used to limit the event stream.  The proxy resonds with an OK/FAIL event.
 +
 
 +
; Finish (CMD_QUIT): Command for the proxy to cleanup and exit.  Proxy responds with an OK/FAIL event.
 +
 
 +
; Submit job (CMD_SUBMIT_JOB): Command to submit a job.
  
 
; Others: Kill job, ...
 
; Others: Kill job, ...
  
 +
; Suggestions for resource manager commands (from Dave Wootton): Additional commands that might be useful include commands to query node availability, query resource pools, query job classes, query job queues, query what's running on the machine, what's running on nodes, change job priority, cancel pending jobs (vs killing a running job), disconnect from and reconnect to proxy. If the proxy is expected to inform the resource manager of the complete state of the machine, queues, etc, at startup, some of these queries might not be required.  NOTE that some of these will be including in the event stream.
  
 
=== Proxy Events  ===
 
=== Proxy Events  ===

Revision as of 11:19, 9 January 2007

Overview

This is a preliminary design for the PTP Resource Management events and proxy communication system. This probably should be folded back into the Resource Management Design once everything is fleshed out.

Resource Manager Proxy

The Resource Manager (RM) communicates with proxy agents to gather information about the state of machines, nodes, queues, jobs, and processes. The proxy may be located remotely.

The RM first starts a proxy and then sends commands to it.

Resource Manager Commands

RM commands are fully asynchronous. They are send from the RM to the proxy. The proxy is expected to respond to commands, but any returned data must be send back asynchronously as separate events.

Protocol for commands
1. The RM creates a transaction id for the command.
2. The RM sends the command plus the transaction id to the proxy.
(A version number should be maintained for the protocol.)
Wire protocol for a command
Commands are currently sent as transformed (tohex) ascii strings.
They command message contains: {MESSAGE_LENGTH (8 byte hex integer), TRANSACTION_ID (8 byte integer), COMMAND (4 byte hex integer), COMMAND_ARGS}, where, MESSAGE_LENGTH is length of the message in bytes (excluding the MESSAGE_LENGTH item) and COMMAND_ARGS is a list of command arguments separated by spaces.
Initialize (CMD_INIT)
Command to initialize the proxy. It has one argument, the wire protocol version number. After this command has been received, the proxy is ready to receive and process other commands from the RM. Initialization data may be passed on the command line when the proxy is run. The proxy asynchronously returns an OK/FAIL event completion of the command.
Model definition (CMD_MODEL_DEF)
Command to start the model definition sequence. The proxy responds by a series of ATTR_DEF, LAUNCH_DEF, and ELEMENT_DEF events. Attributes (see below) are meta-data describing data from the proxy that the RM is expected to receive and possibly display in the UI. The sequence is terminated by an OK/FAIL event.
Start events (CMD_START_EVENTS)
Command to start sending events back to the RM. Initially the proxy sends back the full machine state, but sends only state changes as diffs thereafter.
Stop events (CMD_START_EVENTS)
Command to halt the event stream to the RM. The proxy responds by stoping the event stream, sending an OK event for the start event transaction, and finally sending an OK event for the stop event transaction.
List event filters (CMD_LIST_FILTERS)
Command to list the set of filters used to limit the event stream. The proxy responds by returning a filter list event and then an OK/FAIL event.
Set event filters (CMD_SET_FILTERS)
Command to set a set of filters used to limit the event stream. The proxy resonds with an OK/FAIL event.
Finish (CMD_QUIT)
Command for the proxy to cleanup and exit. Proxy responds with an OK/FAIL event.
Submit job (CMD_SUBMIT_JOB)
Command to submit a job.
Others
Kill job, ...
Suggestions for resource manager commands (from Dave Wootton)
Additional commands that might be useful include commands to query node availability, query resource pools, query job classes, query job queues, query what's running on the machine, what's running on nodes, change job priority, cancel pending jobs (vs killing a running job), disconnect from and reconnect to proxy. If the proxy is expected to inform the resource manager of the complete state of the machine, queues, etc, at startup, some of these queries might not be required. NOTE that some of these will be including in the event stream.

Proxy Events

The proxy responds to commands from the RM by sending events back to the RM.

Protocol for events
1. The proxy completes (or at least initiates) the command.
2. The proxy sends an event containing the transaction id back to the RM. Any data are returned with the event after the transaction id.
Wire protocol for an event
Events are currently sent as transformed (tohex) ascii strings.
They contain: LENGTH(8 hex digits) TRANSACTION_ID(8 hex digits) CODE(4 hex digits) " " DATA.
FAILURE_EVENT
Sent if a failure occurs while processing a command.
ATTR_DEF_EVENT
A list of attributes that the proxy may send as data.
LAUNCH_CONFIG_EVENT
A list of attributes needed to launch a job, e.g., every queue needs to send a list of attribute ids needed to submitted a job
JOB_SUBMISSION_EVENT
Notification that a job has been submitted for execution. The job id will be returned as part of the event.
Others
Machine change, host change, queue change, job status change, ...

Attributes

Attributes are used so that data sent to the RM is self describing. Attributes are meta-data describing actual data. Attribute ids must be unique (who generates them then?). An attribute has a:

   id:
   type:
   min_value:
   max_value:
   default_value:
   optional:

Back to the top