forked from backend-developers-ltd/ComputeHorde
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstreaming_organic_job_no_volumes.puml.txt
62 lines (53 loc) · 2.34 KB
/
streaming_organic_job_no_volumes.puml.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
@startuml
Actor Client
participant Facilitator
participant Validator
participant Miner
participant Executor
participant Job
participant Storage
Client->Client: Generate a **client keypair** (via facilitator sdk)
Client->Facilitator: Send job details and the public key
Facilitator->Facilitator: Choose Validator and Miner
Facilitator->Validator: Send job details
Validator->Miner: Send initial job details
Miner->Miner: Check for a free executor,\npossibly spin up a new one
Miner->Executor: Pass initial job details
Executor->Miner: Report readiness (initial preparations done)
Miner->Validator: Report readiness (initial preparations done)
Validator->Miner: Send all job details
Miner->Executor: Send all job details
opt job requires fetching data
Executor->Storage: Fetch data
end
Executor->Job: Start Job process
activate Job #lightgreen
Executor-->Job: Attempt connecting to a\npredefined websocket route
Job->Executor: Report readiness for serving requests
Executor->Miner: Report readiness for serving requests
Miner->Validator: Report readiness for serving requests,\nprovide Job IP address, port and **Job public key**.\nThis is signed with Miner's hotkey.
Validator->Facilitator: Report readiness for serving requests,\nprovide Job IP address, port and **Job public key**
Facilitator->Client: Report readiness for serving requests,\nprovide Job IP address, port and **Job public key**
loop until Client terminates the job or timeout occurs
Client->Job: Send request, it can be a streamed or buffered\nHTTP or a websocket. Request is signed using **client keypair**.
activate Job #darkgreen
Job->Client: Reply. Before the transmission ends, sign input/output\ndigest (or full value(s) in case of texts)\nwith the private counterpart of **Job public key**.
deactivate Job
opt If this is a cross-validation request
Client->Client: Asses validity of the reposnse
opt if reponse is invalid
Client->Facilitator: Send info about malicious miner, signed\nwith a validator (not sn12 validator) hotkey.
end
end
end
Job->Executor: Report finish
deactivate Job
opt job requires uploading data
Executor->Storage: Upload data
end
Executor->Storage: Upload stdout and stderr
Executor->Miner: Report job done
Miner->Validator: Report job done
Validator->Facilitator: Report job done
Facilitator->Client: Report job done
@enduml