Skip to content

Commit f4dcf3c

Browse files
committed
merging
Signed-off-by: Arne Broering <[email protected]>
2 parents fee8f41 + 478581b commit f4dcf3c

File tree

19 files changed

+1395
-200
lines changed

19 files changed

+1395
-200
lines changed

mkdocs.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,20 @@ nav:
2020
- concepts/applications/application-registry.md
2121
- concepts/applications/local-registries.md
2222
- Workload Fleet Managers:
23+
- concepts/workload-fleet-managers/device-client-onboarding.md
2324
- concepts/workload-fleet-managers/device-capabilities.md
2425
- concepts/workload-fleet-managers/workload-deployment.md
2526
- Edge Compute Devices:
2627
- concepts/edge-compute-devices/devices.md
2728
- Specification:
2829
- Margo Management Interface:
2930
- specification/margo-management-interface/api-requirements-and-security.md
30-
- specification/margo-management-interface/device-onboarding.md
3131
- specification/margo-management-interface/certificate-api.md
32+
- specification/margo-management-interface/device-client-onboarding.md
3233
- specification/margo-management-interface/device-capabilities.md
3334
- specification/margo-management-interface/desired-state.md
3435
- specification/margo-management-interface/deployment-status.md
36+
- specification/margo-management-interface/management-interface-swagger.md
3537
- Applications:
3638
- specification/applications/application-description.md
3739
- specification/applications/application-registry.md
@@ -80,6 +82,12 @@ markdown_extensions:
8082

8183
extra_css:
8284
- css/margo.css
85+
- assets/swagger-ui.css
86+
87+
extra_javascript:
88+
- assets/swagger-ui-bundle.js
89+
- assets/swagger-ui-standalone-preset.js
90+
8391

8492
extra:
8593
# https://squidfunk.github.io/mkdocs-material/setup/setting-up-the-footer/#generator-notice
@@ -107,3 +115,4 @@ plugins:
107115
variable_start_string: =@=
108116
variable_end_string: =@=
109117
- privacy
118+

src/specification/margo-management-interface/desired-state.linkml.yaml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@
22
id: http://specification.margo.org/desired_state_schema
33
name: DesiredState
44
description: >-
5-
The desired state is expressed as a
6-
[Kubernetes custom resource definition](https://kubernetes.io/docs/concepts/extend-kubernetes/api-extension/custom-resources/)
7-
and made available to the device's management client as a YAML document using the OpenGitOps pattern.
5+
Each workload is represented as an `ApplicationDeployment` YAML file that specifies its components, configuration, and parameters.
6+
This resource is delivered via the Desired State API and referenced by `id` in the Deployment Status API.
87
version: 1.0 #Arne: update later
98
prefixes:
109
linkml: https://w3id.org/linkml/

src/specification/margo-management-interface/resources/index.md.jinja2

Lines changed: 266 additions & 6 deletions
Large diffs are not rendered by default.

system-design/assets/swagger-ui-bundle.js

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

system-design/assets/swagger-ui-standalone-preset.js

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

system-design/assets/swagger-ui.css

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

system-design/concepts/workload-fleet-managers/device-capabilities.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# Device Capabilities
22

3-
The purpose of device capabilities reporting is to ensure the Workload Fleet Management (WFM) solution has the information needed to pair workloads with compatible edge devices. The device's capabilities are reported to the WFM web service using the Margo Management API.
3+
The purpose of device capabilities reporting is to ensure the Workload Fleet Management (WFM) solution has the information needed to pair workloads with compatible edge devices. The device's capabilities are reported to the WFM web service using the [Device Capabilities API](../../specification/margo-management-interface/device-capabilities.md).
44

55
### Device Capability Reporting
66

7-
The device owner MUST report their device's capabilities and characteristics, via the device API, when onboarding the device with the Workload Fleet Management solution. Additionally, during the lifecycle of the edge device, if there is a change that impacts the reported characteristics, the device MUST update the Workload Fleet Manager with the latest information via the management API.
7+
The device owner reports their device's capabilities and characteristics, via the device API, when onboarding the device with the Workload Fleet Management solution. Additionally, during the lifecycle of the edge device, if there is a change that impacts the reported characteristics, the device updates the Workload Fleet Manager with the latest information via the [Device Capabilities API](../../specification/margo-management-interface/device-capabilities.md).
88

9-
The following information MUST be provided:
9+
The following information is exchanged:
1010

1111
- Device Id
1212
- Device Vendor
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Device Client Onboarding
2+
3+
To enable workload management, the device's client first establishes trust and completes an onboarding process with the End Users' selected Workload Fleet Manager. This onboarding process enables late binding, which is a critical Margo non-functional requirement that enables a device to bind to any Margo-compatible Workload Fleet Manager.
4+
5+
The onboarding process includes several core functions:
6+
7+
- Establishing trust between the device and the WFM
8+
- Registering the device client and assigning a unique identifier
9+
- Reporting device capabilities to enable workload placement decisions
10+
11+
## Trust Establishment
12+
13+
Initial trust is established between the device's Workload Fleet Management (WFM) Client and the WFM using server-side TLS.
14+
Before the WFM Client can connect securely, it obtains the WFM's root CA certificate. This trust anchor can be:
15+
16+
- downloaded via the Certificate API, provided that an existing trusted channel is available, or
17+
- delivered out-of-band (e.g., preloaded by the device owner or transferred via USB)
18+
19+
Importing the WFM's root CA certificate enables the WFM Client to authenticate the WFM during TLS connections. Mutual TLS (mTLS) is deliberately avoided, as some deployment environments include network components or intermediaries that may not support or forward client-certificate authentication.
20+
Instead, transport security and server authentication are provided by server-side TLS, while client authentication and request integrity are performed at the application layer: the WFM Client uses its own X.509 certificate to create HTTP message signatures for each request. This approach maintains strong, certificate-based authenticity and integrity while accommodating a wide range of network architectures.
21+
22+
23+
## Certificates required
24+
25+
Both the WFM server and the WFM Client use X.509 certificates, but for different purposes. The WFM's certificate authenticates the server during TLS sessions. Each device client possesses a unique X.509 certificate used to sign its HTTP requests, enabling the WFM to verify the origin and integrity of every message. These certificates provide complementary security properties: TLS ensures transport confidentiality and server authenticity, while application-layer signatures provide client authentication and payload integrity. Private keys remain securely stored on the device, and all signing operations occur locally, reducing exposure to key compromise.
26+
27+
28+
## Unique Identifiers
29+
30+
The Workload Fleet Manager assigns a globally unique identifier to the device's management client during the onboarding process. This is needed to ensure unique interactions between each device with the Fleet Manager.
31+
32+
## Device Capability Reporting
33+
34+
After onboarding, the device client reports its capabilities to the WFM server using the device capability reporting API.
35+
36+
## Relevant Links
37+
38+
Please follow the subsequent links to view more technical information on the concepts described above:
39+
40+
- [API Security Details](../../specification/margo-management-interface/api-requirements-and-security.md)
41+
- [Certificate API](../../specification/margo-management-interface/certificate-api.md)
42+
- [Device Onboarding API](../../specification/margo-management-interface/device-client-onboarding.md)
43+
- [Device Capabilities](../../specification/margo-management-interface/device-capabilities.md)
Lines changed: 94 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,111 @@
11
# Workload Deployment
22

3-
Margo uses an [OpenGitOps](https://opengitops.dev/) approach for managing the edge device's desired state. The workload orchestration solution vendor maintains Git repositories, under their control, to push updates to the desired state for each device being managed. The device's management client is responsible for monitoring the device's assigned Git repository for any changes to the desired state that MUST be applied.
4-
> Action: The use of GitOps patterns for pulling desired state is still being discussed/investigated.
3+
This page describes how Margo manages the deployment and reconciliation of workloads on Edge Compute Devices.
54

5+
Workload deployment in Margo is based on a declarative Desired State model.
6+
A Workload Fleet Manager (WFM) defines the desired workloads for each Edge Compute Device, including what should run, how each workload should be configured, and the parameters needed for deployment and lifecycle management.
7+
Each device runs a Workload Fleet Management Client (WFM Client) that retrieves and applies this Desired State, while reporting progress and results back to the WFM.
8+
This model provides a consistent and observable way to manage workloads across distributed environments.
69

7-
### Desired State Requirements:
10+
## How it works
811

9-
> Note: Need to investigate best way to construct the Git Repository. Folder structure / Multiple applications per Edge Device/Cluster
10-
> Note: this is the recommendation from FluxCD <https://fluxcd.io/flux/guides/repository-structure/>
12+
The Workload Fleet Manager coordinates workloads across Edge Compute Devices.
13+
Operators use the WFM to define workloads, update deployments, and view rollout progress across devices.
14+
The WFM Client continuously reconciles the Desired State provided by the WFM with the workloads actually running on the device.
1115

12-
- The workload orchestration solution MUST store the device's [desired state documents](../../specification/margo-management-interface/desired-state.md) within a Git repository the device's management client can access.
13-
> Note: Git repository storage was selected to ensure secure storage and traceability pertaining to the workload's desire state(s).
14-
- The device's management client MUST monitor the device's Git repository for updates to the desired state using the URL and access token provided by the workload orchestration solution during onboarding.
16+
The WFM and WFM Clients communicate through two key interfaces:
1517

16-
### Workload Management Sequence of Operations
18+
- The [Desired State API](../../specification/margo-management-interface/desired-state.md), which distributes workload definitions to devices
19+
- The [Deployment Status API](../../specification/margo-management-interface/deployment-status.md), which collects deployment updates from devices
1720

18-
#### Desired State lifecycle:
21+
Together, these interfaces establish a feedback loop between the centralized manager and the distributed devices, ensuring workload consistency and visibility at scale.
1922

20-
1. The workload orchestration solution creates the [desired state documents](../../specification/margo-management-interface/desired-state.md) based on the end user's inputs when installing, updating or deleting an application.
21-
2. The workload orchestration solution pushes updates to the device's Git repository reflecting the changes to the desired state.
22-
3. The device's management client monitors its assigned Git repository for changes.
23-
4. When the device's management client notices a difference between the current (running) state and the desired state, it MUST pull down and attempt to apply the new desired state.
23+
## Desired State
2424

25-
#### Applying the Desired State:
25+
The Desired State defines the workloads that should run on each Edge Compute Device and the details of how they are deployed.
26+
It is represented by a [State Manifest](../../specification/margo-management-interface/desired-state.md#endpoints-state-manifest) that lists all workloads assigned to a device.
27+
The WFM exposes this manifest through the Desired State API.
2628

27-
1. The device attempts to apply the desired state to become new current state
28-
2. While the new desired state is being applied, the device's management client MUST report progress on state changes (see the [deployment state](#deployment-status) section below) using the [Device API](../../specification/margo-management-interface/deployment-status.md)
29+
Each workload is defined by an [ApplicationDeployment](../../specification/margo-management-interface/desired-state.md#applicationdeployment-yaml-definition), which describes:
2930

30-
#### Deployment Status
31+
- The Components that make up the workload, such as Helm charts or Compose-based container bundles
32+
- Configuration parameters and deployment profiles that control workload behavior
33+
- Target information identifying which devices or groups of devices the deployment applies to
3134

32-
The deployment status is sent to the workload orchestration web service using the [Device API](../../specification/margo-management-interface/deployment-status.md) when there is a change in the deployment state. This informs the workload orchestration web service of the current state as the new desired state is applied.
35+
The WFM can provide ApplicationDeployments in two formats:
3336

34-
The deployment status uses the following rules:
37+
- Individual YAML files, allowing incremental synchronization
38+
- A bundle archive that contains multiple ApplicationDeployments for bulk distribution
3539

36-
- The state is `Pending` once the device management client has received the updated desired state but has not started applying it. When reporting this state indicate the reason.
37-
- Such as waiting on Policy agent
38-
- Waiting on other applications in the 'Order of operations' to be completed.
39-
- The state is `Installing` once the device management client has started the process of applying the desired state.
40-
- The state is `Failure` if at any point the desired state fails to be applied. When reporting a `Failure` state the error message and error code MUST be reported
41-
- The state is `Success` once the desired state has been applied completely
40+
All files retrieved as part of the Desired State—manifests, ApplicationDeployment YAMLs, and bundle archives—are treated as immutable artifacts.
41+
Each artifact is referenced by a SHA-256 digest. The WFM Client validates these digests before applying updates to ensure authenticity and consistency.
4242

43+
## Reconciliation process
4344

44-
> Note: Drawing to be replaced with mermaid sequence diagram.
45-
![Workload Install Sequence Diagram (svg)](../../figures/workload-install-sequence.drawio.svg)
45+
Each WFM Client maintains the Desired State on its Edge Compute Device by running a continuous reconciliation loop.
46+
47+
1. **Retrieve the manifest:**
48+
The WFM Client periodically checks the WFM for updates to its State Manifest.
49+
When a new manifest version is available, the client initiates synchronization.
50+
51+
2. **Retrieve artifacts:**
52+
The WFM Client downloads the referenced ApplicationDeployment YAMLs or bundle archive.
53+
54+
3. **Verify integrity:**
55+
The WFM Client verifies that each artifact matches the digest declared in the manifest.
56+
If verification fails, the update is halted and the current workloads remain unchanged.
57+
58+
4. **Apply the Desired State:**
59+
The WFM Client compares the current workloads with those defined in the Desired State:
60+
61+
- Adds or updates workloads that have changed
62+
- Removes workloads that are no longer listed
63+
- Keeps workloads that remain valid and current
64+
65+
5. **Report status:**
66+
As the synchronization proceeds, the WFM Client reports its deployment status to the WFM through the Deployment Status API.
67+
68+
This continuous process allows the WFM to maintain awareness of workload rollout progress and ensures devices converge toward the Desired State.
69+
70+
## Deployment status
71+
72+
The Deployment Status API provides feedback from devices to the Workload Fleet Manager.
73+
The WFM Client reports progress, success, or failure during installation, update, and removal operations.
74+
This feedback allows the WFM to present an aggregated view of deployment health and state across the managed fleet.
75+
76+
A deployment status report includes:
77+
78+
- The identifier of the ApplicationDeployment
79+
- The current deployment state, which may be:
80+
81+
- Pending - the Desired State has been received but not yet applied
82+
- Installing - the workload is being deployed
83+
- Installed - the workload has been successfully applied
84+
- Removing or Removed - the workload is being or has been uninstalled
85+
- Failed - an error occurred during deployment
86+
87+
- Optional component-level progress information
88+
- Error codes and messages, when applicable
89+
90+
This information enables real-time monitoring and supports troubleshooting and auditing of workload operations.
91+
92+
## Sequence diagram
93+
94+
```mermaid
95+
sequenceDiagram
96+
participant WFM as Workload Fleet Manager
97+
participant Client as WFM Client (running on Edge Compute Device)
98+
99+
loop Periodic synchronization
100+
Client->>WFM: Retrieve Desired State (Desired State API)
101+
alt Desired State unchanged
102+
WFM-->>Client: No update available
103+
else Desired State updated
104+
WFM-->>Client: Provide new State Manifest
105+
Client->>WFM: Retrieve ApplicationDeployments or bundle
106+
Client->>Client: Apply workloads from Desired State
107+
Client->>WFM: Report deployment status (Deployment Status API)
108+
end
109+
end
110+
111+
```

system-design/personas-and-definitions/software-composition.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,8 @@ C4Component
279279
[workload]: technical-lexicon.md#workload
280280
[application]: technical-lexicon.md#application
281281
[component-registry]: technical-lexicon.md#component-registry
282-
[deployment-definition]: ../specification/margo-management-interface/desired-state.md/?h=applicationdeployment.md#applicationdeployment-definition
282+
[deployment-definition]: ../specification/margo-management-interface/desired-state.md#applicationdeployment-yaml-definition
283283
[provider-model]: technical-lexicon.md#provider-model
284284
[wfmc]: technical-lexicon.md#workload-fleet-management-client
285285
[deployment-profile]: ../specification/applications/application-description.md#deploymentprofile-attributes
286+

0 commit comments

Comments
 (0)