Skip to content

Commit

Permalink
Add deploy progress spec description
Browse files Browse the repository at this point in the history
  • Loading branch information
nieznanysprawiciel committed Feb 8, 2024
1 parent be1310a commit e442ab1
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 5 deletions.
10 changes: 5 additions & 5 deletions specs/capabilities.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Golem Capability List

| Capability | Yagna package version | Backwards-compatible? | Description |
|------------|-----------------------|-----------------------|-------------|
| Multi-Activity Agreement | 0.5.0 | Yes | Negotiate ability to create multiple activities under single Agreement. Use (which?) property in Demand/Offer to indicate node's support for Multi-Activity. If counterparty does not support Multi-Activity, the node falls back to single Activity per Agreement behaviour. |
| Restart Proposal Negotiations | 0.7.0 | Yes | Agent is allowed to restart negotiations, by sending `Counter Proposal`, after he rejected Proposal at some point. Counter-party will receive regular `ProposalEvent` in this case. Only Agent rejecting Proposal has initiative in restarting negotiations, rejected Agent can only wait for this to happen. To indicate, that Proposal rejection isn't final and negotiations can be restarted later, Agent can set `golem.proposal.rejection.is-final` (bool) field in `Reason` structure. If this value is set to false, Agent can free any state related to this negotiation. The same field can be set in `Reason` sent in `Reject Agreement` operation. Requestor can send new counter Proposal after some period of time or propose the same Agreement for the second time. (No change to specification) |
| | | | |
| Capability | Yagna package version | Backwards-compatible? | Description | Property |
|-------------------------------|-----------------------|-----------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------|
| Multi-Activity Agreement | 0.5.0 | Yes | Negotiate ability to create multiple activities under single Agreement. Use (which?) property in Demand/Offer to indicate node's support for Multi-Activity. If counterparty does not support Multi-Activity, the node falls back to single Activity per Agreement behaviour. | |
| Restart Proposal Negotiations | 0.7.0 | Yes | Agent is allowed to restart negotiations, by sending `Counter Proposal`, after he rejected Proposal at some point. Counter-party will receive regular `ProposalEvent` in this case. Only Agent rejecting Proposal has initiative in restarting negotiations, rejected Agent can only wait for this to happen. To indicate, that Proposal rejection isn't final and negotiations can be restarted later, Agent can set `golem.proposal.rejection.is-final` (bool) field in `Reason` structure. If this value is set to false, Agent can free any state related to this negotiation. The same field can be set in `Reason` sent in `Reject Agreement` operation. Requestor can send new counter Proposal after some period of time or propose the same Agreement for the second time. (No change to specification) | |
| Command progress reporting | (not released) | Yes | ExeUnit can report progress of executed commands. [Specification](./command-progress.md) | `golem.activity.caps.transfer.report-progress` `golem.activity.caps.transfer.deploy-progress` |
50 changes: 50 additions & 0 deletions specs/command-progress.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Command progress reporting

Downloading large images and files poses problem for Requestor controlling ExeUnit.
Since he doesn't have any information about Provider's internet bandwidth, there is no
way to estimate download time. Slow internet connection is indistinguishable from Provider
that just doesn't work and is unable to finish task. This results in wasted resources and
non-optimal Requestor behavior.


This specification describes generic mechanisms allowing to report progress of different
commands from ExeUnit to Reqeustors. Moreover, it describes current implementation of ExeUnit.

## Specification

### Capabilities

ExeUnit supporting progress reporting should put following properties in the Offer:
- `golem.activity.caps.transfer.report-progress` - if he can report `transfer` command progress
- `golem.activity.caps.deploy.report-progress` - if he can report `deploy` command progress

To support progress for any other command, specification should be extended with new properties.
Current ExeUnit implementation supports only these 2 commands.

### Progress parameters

To enable progress events Requestor agent has to attach progress parameters to `ExeScriptCommand`.
Example `deploy` and `transfer` command:
```json
[
{
"deploy": {
"progress" : { "updateInterval" : "300ms", "updateStep" : null }
}
},
{
"transfer": {
"from": "http://34.244.4.185:8000/LICENSE",
"to": "container:/input/file_in",
"progress" : { "updateInterval" : null, "updateStep" : 1048576 }
}
}
]
```

`ProgressArgs` structure is described [here](https://golemfactory.github.io/ya-client/index.html?urls.primaryName=Activity%20API#model-ProgressArgs).

### Progress event

### Listening to events

0 comments on commit e442ab1

Please sign in to comment.