Skip to content

Commit

Permalink
Fix ExeUnit interaction in architecture-snapshot
Browse files Browse the repository at this point in the history
  • Loading branch information
kamirr committed Nov 4, 2024
1 parent 9b8aafc commit 8e5063b
Showing 1 changed file with 15 additions and 31 deletions.
46 changes: 15 additions & 31 deletions arch-snapshot/arch.md
Original file line number Diff line number Diff line change
Expand Up @@ -2247,40 +2247,19 @@ time.
over the Internet –
[ya-runtime-http-auth](https://github.com/golemfactory/ya-runtime-http-auth).

#### Interaction between Golem Node and ExeUnits
ExeUnits are controlled by the Golem Node using GSB, the same message-passing
protocol that is used for internal implementation of the Node as well as
inter-node communication.

In case of the Generic ExeUnits the GSB messages are split into two services:
- Counters Service
- `GetCounters` returns the Usage Counters relevant for the pricing according
to the choosen payment model.
- `SetCounter` overrides the value of a specific counter.
- `Shutdown` informs the service of imminent shutdown.
- Transfer Service
- `DeployImage` transfers the GVMI image and starts the underlying Runtime.*
- `TransferResource` transfers a resource (usually a file) between
the Provider and the Runtime.*
- `AddVolumes` creates additional points within Runtime filesystem writing
to which will allow files to be accessed via `TransferResource` by the
Requestor. That is, `TransferResource` cannot operate on arbitrary paths
when accessing Runtime data, but is instead limited to the *Volumes*
created by this GSB call.
- `AbortTransfers` cancels all ongoing transfers.
- `Shutdown` informs the service of imminent shutdown.

*Note regarding transfers: The destination of a transfer must always implement
a specific GSB-based interface, but the source can be either a symmetric GSB-API
*or* an HTTP resource. For the details of the GSB Transfer APIs, see
[gftp implementation](https://github.com/golemfactory/yagna/tree/master/core/gftp).

Additionally, some GSB endpoints are exposed directly to the Requestor Agent,
such as:
#### Interaction between Requestor and ExeUnit
ExeUnits expose 4 GSB endpoints to be directly called by the Provider:
- `Exec`
- Executes the ExeScript on the ExeUnit, see [ExeUnit Commands](#exeunit-commands).
- `GetExecBatchResults`
- Returns the results of the batch.
- `StreamExecBatchResults`
- Streams the results of the batch as it progresses.
- `GetRunningCommand`
- Returns the currently running command from the batch

(Details below)
#### Interaction between Provider and ExeUnit
- Periodic reporting of Counters' values to the Provider via GSB

#### ExeUnit Commands
The Requestor Agent does not control the ExeUnit by GSB, but by using
Expand All @@ -2290,6 +2269,11 @@ to the `Exec` GSB message that is then sent directly to the ExeUnit.
The specification of the command (so-called `ExeScriptCommand`) can be found
in [ya-client OpenAPI Activity Specification](https://github.com/golemfactory/ya-client/blob/master/specs/activity-api.yaml).

Note regarding `Transfer` command: The destination of a transfer must always
implement a specific GSB-based interface, but the source can be either
a symmetric GSB-API *or* an HTTP resource. For the details of the GSB Transfer
APIs, see [gftp implementation](https://github.com/golemfactory/yagna/tree/master/core/gftp).

##### Batches
Commands are to be sent in *Batches* which are considered done after each
command has completed in order.
Expand Down

0 comments on commit 8e5063b

Please sign in to comment.