GLOBUS_GRAM_PROTOCOL_DEFINITION(3)
π globus_gram_protocol_definition(3) π
okay bestie, buckle up β this is globus_gram_protocol_definition(3) from the Library Functions Manual, section 3, and it's the whole tea on the GRAM Protocol. it's giving β¨ networking lore β¨ and we're doing it line by line, no skips, no cap.
π NAME π
globus_gram_protocol_definition β GRAM Protocol Definition. periodt.
The GRAM Protocol is what handles all the communication between the Gatekeeper, the Job Manager, and GRAM Clients. It's built on a subset of the HTTP/1.1 protocol β like, the itty-bitty subset β with a small set of message types and responses sent as the body of the HTTP requests and responses. This document describes GRAM Protocol version 2. π
π Framing π
GRAM messages are framed inside HTTP/1.1 messages. BUT β and this is the important part, bestie β only a tiny slice of the HTTP spec is actually used or understood by the GRAM system. All GRAM requests are HTTP POST messages. That's it. That's the vibe.
Only these HTTP headers are understood:
HostContent-Type(set to"application/x-globus-gram"in all cases)Content-LengthConnection(set to"close"in all HTTP responses)
And only these status codes are supported in the response's HTTP Status-Lines:
200 OK403 Forbidden404 Not Found500 Internal Server Error400 Bad Request
that's the whole menu, we don't do extras here π«Ά
π¦ Message Format π¦
All messages use the carriage return (ASCII value 13) followed by line feed (ASCII value 10) sequence to delimit lines. In all cases, a blank line separates the HTTP header from the message body. π§
All application/x-globus-gram message bodies are made of attribute names followed by a colon, a space, and then the value of the attribute.
Now here's the cute part: when the value might contain a newline or a double-quote character, a special escaping rule is used to encapsulate the complete string. This encapsulation consists of:
- surrounding the string with double-quotes, and
- escaping all double-quote and backslash characters within the string with a backslash.
All other characters are sent without modification. so chill, nothing else gets touched β¨
For example, the string:
rsl: &( executable = "/bin/echo" )
( arguments = "hello" )
becomes:
rsl: "&( executable = \"bin/echo\" )
(arguments = \"hello\" )"
This is the only form of quoting which application/x-globus-gram messages support. Use of % HEX HEX escapes (such as seen in URL encodings) is not meaningful for this protocol. like, don't even try it, bestie π
π Message Types π
π Ping Request π
A ping request is used to verify that the gatekeeper is configured properly to handle a named service. The ping request consists of the following:
POST ping/job-manager-name HTTP/1.1
Host: host-name
Content-Type: application/x-globus-gram
Content-Length: message-size
protocol-version: version
The values of the message-specific strings are:
job-manager-nameβ the name of the service to have the gatekeeper check. The service name corresponds to one of the gatekeeper's configured grid-services, and is usually of the form"jobmanager-<em>scheduler-type</em>".host-nameβ the name of the host on which the gatekeeper is running. This exists only for compatibility with the HTTP/1.1 protocol.message-sizeβ the length of the content of the message, not including the HTTP/1.1 header.versionβ the version of the GRAM protocol which is being used. For the protocol defined in this document, the value must be the string"2".
πΈ Job Request πΈ
A job request is used to schedule a job remotely using GRAM. (the original page says "the ping request consists of the HTTP framing described above" here β we're just quoting it, don't come for me π) with the request-URI consisting of job-manager-name, where job-manager-name is the name of the service to use to schedule the job. The format of a job request message consists of the following:
POST job-manager-name[@user-name] HTTP/1.1
Host: host-name
Content-Type: application/x-globus-gram
Content-Length: message-size
protocol-version: version
job-state-mask: mask
callback-url: callback-contact
rsl: rsl-description
The values of the emphasized text items are as below:
job-manager-nameβ the name of the service to submit the job request to. The service name corresponds to one of the gatekeeper's configured grid-services, and is usually of the form"jobmanager-<em>scheduler-type</em>".user-nameβ starting with GT4.0, a client may request that a certain account be used by the gatekeeper to start the job manager. This is done optionally by appending the@symbol and the local user name that the job should be run as to thejob-manager-name. If the@and username are not present, then the first grid map entry will be used. If the client credential is not authorized in the grid map to use the specified account, an authorization error will occur in the gatekeeper. π¨host-nameβ the name of the host on which the gatekeeper is running. This exists only for compatibility with the HTTP/1.1 protocol.message-sizeβ the length of the content of the message, not including the HTTP/1.1 header.versionβ the version of the GRAM protocol which is being used. For the protocol defined in this document, the value must be the string"2".maskβ an integer representation of the job state mask. This value is obtained from a bitwise-OR of the job state values which the client wishes to receive job status callbacks about. The meanings of the various job state values are defined in the GRAM Protocol API documentation.callback-contactβ ahttpsURL which defines a GRAM protocol listener which will receive job state updates. The from a bitwise-OR of the job state values which the client wishes to receive job status callbacks about. The job status update messages are defined below.rsl-descriptionβ a quoted string containing the RSL description of the job request.
β Status Request β
A status request is used by a GRAM client to get the current job state of a running job. This type of message can only be sent to a job manager's job-contact (as returned in the reply to a job request message). The format of a job request message consists of the following:
POST job-contact HTTP/1.1
Host: host-name
Content-Type: application/x-globus-gram
Content-Length: message-size
protocol-version: version
"status"
The values of the emphasized text items are as below:
job-contactβ the job contact string returned in a response to a job request message, or determined by querying the MDS system.host-nameβ the name of the host on which the job manager is running. This exists only for compatibility with the HTTP/1.1 protocol.message-sizeβ the length of the content of the message, not including the HTTP/1.1 header.versionβ the version of the GRAM protocol which is being used. For the protocol defined in this document, the value must be the string"2".
π Callback Register Request π
A callback register request is used by a GRAM client to register a new callback contact to receive GRAM job state updates. This type of message can only be sent to a job manager's job-contact (as returned in the reply to a job request message). The format of a job request message consists of the following:
POST job-contact HTTP/1.1
Host: host-name
Content-Type: application/x-globus-gram
Content-Length: message-size
protocol-version: version
"register <em>mask</em> <em>callback-contact</em>"
The values of the emphasized text items are as below:
job-contactβ the job contact string returned in a response to a job request message, or determined by querying the MDS system.host-nameβ the name of the host on which the job manager is running. This exists only for compatibility with the HTTP/1.1 protocol.message-sizeβ the length of the content of the message, not including the HTTP/1.1 header.versionβ the version of the GRAM protocol which is being used. For the protocol defined in this document, the value must be the string"2".maskβ an integer representation of the job state mask. This value is obtained from a bitwise-OR of the job state values which the client wishes to receive job status callbacks about. The meanings of the various job state values are defined in the GRAM Protocol API documentation.callback-contactβ ahttpsURL which defines a GRAM protocol listener which will receive job state updates. The from a bitwise-OR of the job state values which the client wishes to receive job status callbacks about. The job status update messages are defined below.
π Callback Unregister Request π
A callback unregister request is used by a GRAM client to request that the job manager no longer send job state updates to the specified callback contact. This type of message can only be sent to a job manager's job-contact (as returned in the reply to a job request message). The format of a job request message consists of the following:
POST job-contact HTTP/1.1
Host: host-name
Content-Type: application/x-globus-gram
Content-Length: message-size
protocol-version: version
"unregister <em>callback-contact</em>"
The values of the emphasized text items are as below:
job-contactβ the job contact string returned in a response to a job request message, or determined by querying the MDS system.host-nameβ the name of the host on which the job manager is running. This exists only for compatibility with the HTTP/1.1 protocol.message-sizeβ the length of the content of the message, not including the HTTP/1.1 header.versionβ the version of the GRAM protocol which is being used. For the protocol defined in this document, the value must be the string"2".callback-contactβ ahttpsURL which defines a GRAM protocol listener which should no longer receive job state updates. The from a bitwise-OR of the job state values which the client wishes to receive job status callbacks about. The job status update messages are defined below.
π₯ Job Cancel Request π₯
A job cancel request is used by a GRAM client to request that the job manager terminate a job. This type of message can only be sent to a job manager's job-contact (as returned in the reply to a job request message). The format of a job request message consists of the following:
POST job-contact HTTP/1.1
Host: host-name
Content-Type: application/x-globus-gram
Content-Length: message-size
protocol-version: version
"cancel"
The values of the emphasized text items are as below:
job-contactβ the job contact string returned in a response to a job request message, or determined by querying the MDS system.host-nameβ
and that's literally where part 1 cuts off, bestie π the host-name deets (and everything after) roll in with the next part, so don't go anywhere π
host-nameβ the name of the host where the job manager is chillin'. lowkey it only exists for HTTP/1.1 compatibility, no cap πmessage-sizeβ how long the content of the message is. that's the body only, bestie, the HTTP/1.1 header does NOT count πversionβ which version of the GRAM protocol we're on. for the protocol in this doc, it literally must be the string"2". periodt β¨
π‘ Job Signal Request π‘
So a job signal request is what a GRAM client sends when it wants the job manager to process a signal for a job. and like, the arguments to the different signals? those are all discussed over in the globus_gram_protocol_job_signal_t documentation, go check it π«Ά
POST job-contact HTTP/1.1
Host: host-name
Content-Type: application/x-globus-gram
Content-Length: message-size
protocol-version: version
"<em>signal</em>"
and the values of those emphasized bits, bestie, are giving:
job-contactβ the job contact string that came back in a response to a job request message, or that you found by querying the MDS system πhost-nameβ the name of the host running the job manager. only here for HTTP/1.1 compatibility, fr fr.message-sizeβ the length of the content of the message, not counting the HTTP/1.1 header.versionβ the GRAM protocol version in use. for the protocol in this document it must be the string"2". no negotiating πsignalβ a quoted string holding the signal number and its parameters.
π¦ Job State Updates π¦
okay so the job status update message is what the job manager sends out to all registered callback contacts the second the job's status changes. main character energy, it announces itself. here's the format:
POST callback-contact HTTP/1.1
Host: host-name
Content-Type: application/x-globus-gram
Content-Length: message-size
protocol-version: version
job-manager-url: job-contact
status: status-code
failure-code: failure-code
and the values of the emphasized items:
callback-contactβ the callback contact string that got registered with the job manager, either by being passed as the callback-contact in a job request message, or in a callback register message πhost-nameβ the host part of the callback-contact URL. exists only for HTTP/1.1 compatibility, iykyk.message-sizeβ the length of the content of the message, not including the HTTP/1.1 header.versionβ the GRAM protocol version being used. for the protocol in this doc, it must be the string"2"πjob-contactβ the job contact of the job that changed states. the glow-up (or the flop) in question π
π Proxy Delegation π
A proxy delegation message is sent by the client to the job manager to kick off a delegation handshake, and the whole point is generating a brand-new proxy credential for the job manager. that credential then gets used by the job manager β or by the job itself β when it makes further secured connections. here's the format:
POST callback-contact HTTP/1.1
Host: host-name
Content-Type: application/x-globus-gram
Content-Length: message-size
protocol-version: version
"renew"
So if a successful (200) reply comes back for this message, the client proceeds with a GSI delegation handshake. the tokens in that handshake get framed with a 4 byte big-endian token length header. then those framed tokens get wrapped using the GLOBUS_IO_SECURE_CHANNEL_MODE_SSL_WRAP wrapping mode. and the job manager frames its response tokens the exact same way, no notes. after the job manager receives its final delegation token, it responds with another response message telling you whether the delegation was processed or not. that response message? it's a standard GRAM response message β¨
π‘οΈ Note on Security Attributes π‘οΈ
the following security attributes are needed to communicate with the Gatekeeper, don't skip these bestie:
- Authentication must be done using GSSAPI mutual authentication π€
- Messages must be wrapped with support for the delegation message. when you're using Globus I/O, you do this by using the
GLOBUS_IO_SECURE_CHANNEL_MODE_GSI_WRAPwrapping mode π₯
π Changes π
2004-08-11β Added information about gridmap choosing π
and that's a wrap, bestie π this was globus_gram_protocol, Version 13.6, dated 2004-08-11, and yes the page title is still doing its little globus_gra..._definition(3) truncation moment π slay, go read the other pages, ily, bye π
π¦ where this page comes from
- fedora 43: globus-gram-protocol-doc 13.6-10.fc43 Β· Apache-2.0
- fedora 44: globus-gram-protocol-doc 13.6-11.fc44 Β· Apache-2.0
- ubuntu resolute: libglobus-gram-protocol-doc 13.6-3build2 Β· Apache-2.0
- ubuntu stonking: libglobus-gram-protocol-doc 13.6-4 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms