You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/COMMS.md
+21-19Lines changed: 21 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,8 @@
1
1
# Communications
2
2
3
3
This document describes the components in EVE that are responsible for
4
-
communications between an EVE instance and a Controller. Read about the API for Device to Controller Communications [here](https://github.com/lf-edge/eve-api/tree/main/APIv2.md)
4
+
communications between an EVE instance and a Controller.
5
+
Read about the API for Device to Controller Communications [here](https://github.com/lf-edge/eve-api/tree/main/APIv2.md)
5
6
6
7
All of these are components of [pkg/pillar](../pkg/pillar/), which is the set
7
8
of process, commands and services responsible for managing an EVE device.
@@ -22,8 +23,8 @@ with the Controller does so directly; there is no local proxy or buffering
22
23
engine process that stands between these processes and the Controller.
23
24
24
25
However, common logic for communications is extracted out to the package
25
-
[pkg/pillar/zedcloud](../pkg/pillar/zedcloud/). Each service that needs to
26
-
communicate with the Controller imports the `zedcloud` package and uses its
26
+
[pkg/pillar/cloudconn](../pkg/pillar/cloudconn/). Each service that needs to
27
+
communicate with the Controller imports the `cloudconn` package and uses its
27
28
functions to communicate with the Controller.
28
29
29
30
The overall architecture is as follows.
@@ -37,7 +38,7 @@ The overall architecture is as follows.
37
38
| | | | |
38
39
v v v v v
39
40
+++ +++ +++ +++ +-+--+
40
-
|z| |z| |z| |z| | zc | *zc = zedcloud package
41
+
|c| |c| |c| |c| | cc | *cc = cloudconn package
41
42
|c| |c| |c| |c| | |
42
43
| | | | | | | | | |
43
44
| | | | | | | | | |
@@ -59,49 +60,50 @@ The overall architecture is as follows.
59
60
| pubsub |
60
61
+----------------------+
61
62
62
-
### zedcloud - communications
63
+
### cloudconn - communications
63
64
64
65
In EVE, the shared functionality for communications with the Controller is
65
-
encapsulated in the [zedcloud](../pkg/pillar/zedcloud) package. All services
66
-
communicate with the Controller using functions provided via the `zedcloud`
66
+
encapsulated in the [cloudconn](../pkg/pillar/cloudconn) package. All services
67
+
communicate with the Controller using functions provided via the `cloudconn`
67
68
package.
68
69
69
-
`zedcloud` is responsible for:
70
+
`cloudconn` is responsible for:
70
71
71
72
* Creating SSL channels
72
73
* mutual TLS (mTLS) and client authentication
73
74
* Handling http logic, including status codes
74
75
* Retries in case of loss of communication
75
76
* Using multiple management ports to communicate with the controller
76
77
77
-
`zedcloud` does _not_ currently handle protobuf analysis. It is blissfully
78
+
`cloudconn` does _not_ handle protobuf analysis. It is blissfully
78
79
unaware of the contents of most messages in both directions. It simply makes
79
80
the request on behalf of, and passes the response back to, the requesting
80
81
functions.
81
82
82
83
The logic in the services themselves do the following:
83
84
85
+
* Create an instance of `cloudconn.Client` using the `cloudconn.NewClient` method
84
86
* Package up any messages to be sent in protobuf
85
-
* Pass the message to functions in `zedcloud`
86
-
* Receive the response from `zedcloud`
87
+
* Pass the message to `Send*` methods of `cloudconn.Client`
88
+
* Receive the response from controller
87
89
* Unpack the received protobufs
88
90
89
91
### services
90
92
91
93
The following are a few of the key services that communicate with the
92
-
Controller via the functions provided in the `zedcloud` package.
94
+
Controller via `cloudconn.Client`.
93
95
94
96
#### zedagent
95
97
96
98
[zedconfig](../pkg/pillar/cmd/zedagent) is the service responsible for retrieving
97
99
configuration from the Controller and updating locally running services on EVE.
98
100
Like all other services communicating with the Controller, it does so through
99
-
functions provided by the `zedcloud` package.
101
+
the methods provided by `cloudconn.Client`.
100
102
101
103
`zedagent` is responsible for the following:
102
104
103
105
* Maintaining a regular cycle for retrieving configuration or updates from Controller.
104
-
* Requesting the configuration from the Controller via functions in `zedcloud`.
106
+
* Requesting the configuration from the Controller via methods provided by `cloudconn.Client`.
105
107
* Receiving the latest correct configuration in response to its request.
106
108
* Saving the latest correct configuration locally.
107
109
* Loading the initial (aka bootstrap) device configuration if present (see [CONFIG.md](./CONFIG.md))
@@ -111,7 +113,7 @@ functions provided by the `zedcloud` package.
111
113
112
114
[Loguploader](../pkg/pillar/cmd/loguploader) is the service responsible for
113
115
uploading device and application gzip logs to controller. It does
114
-
so through the functions provided by the `zedcloud` package.
116
+
so through the methods provided by `cloudconn.Client`.
115
117
116
118
#### client
117
119
@@ -124,14 +126,14 @@ configuration, as part of onboarding a new device to the Controller.
124
126
[Network interface manager](../pkg/pillar/cmd/nim) is responsible for managing
125
127
local network interfaces on the device, as well as checking connectivity to the
126
128
Controller and retrieving the config for testing communications purposes. All
127
-
communications with the Controller are performed via the functions provided by
128
-
the `zedcloud` package.
129
+
communications with the Controller are performed via the methods provided
130
+
by `cloudconn.Client`.
129
131
130
132
#### diag
131
133
132
134
[Diagnostics](../pkg/pillar/cmd/diag) is responsible for managing diagnostic
133
135
services on the device, and reporting to console for debugging if there are
134
136
issues. It does not send information to the Controller. However, among its
135
137
diagnostic tests, it does test the ability to reach both the ping and config endpoints
136
-
of the Controller. To connect and test these endpoints, it uses the functions
137
-
provided by the `zedcloud` package.
138
+
of the Controller. To connect and test these endpoints, it uses the methods provided
0 commit comments