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
1. **Build the Federated Learning Application Image**
89
+
=== Deploy the Application
89
90
91
+
. build the Federated Learning Application Image
92
+
+
90
93
*Note*: You can directly use the pre-built image `quay.io/myan/federated-learning-app:latest`.
91
94
92
-
**a.** Navigate to the Flower framework example:
93
-
94
-
```bash
95
-
cd federated-learning-controller/examples/flower
96
-
```
97
-
98
-
**b.** *(Optional)* Modify the model code located in `flower/app-torch`, then build and push the image:
99
-
100
-
```bash
101
-
export REGISTRY=<your-registry>
102
-
export IMAGE_TAG=<your-image-tag>
103
-
make build-app-image
104
-
make push-app-image
105
-
```
106
-
95
+
.. Navigate to the Flower framework example:
96
+
+
97
+
[source,bash]
98
+
----
99
+
$ cd federated-learning-controller/examples/flower
100
+
----
101
+
102
+
.. *(Optional)* Modify the model code located in `flower/app-torch`, then build and push the image:
103
+
+
104
+
[source,bash]
105
+
----
106
+
$ export REGISTRY=<your-registry>
107
+
$ export IMAGE_TAG=<your-image-tag>
108
+
$ make build-app-image
109
+
$ make push-app-image
110
+
----
111
+
+
107
112
The image will be named `<REGISTRY>/flower-app-torch:<IMAGE_TAG>`.
108
-
-
109
-
2. **Deploy the Application to the Hub Cluster**
110
113
114
+
. Deploy the Application to the Hub Cluster
115
+
+
111
116
The current server and client use the same image. You can also use the pre-built image `quay.io/myan/flower-app-torch:latest`. After creating the resource, the server will deploy to the hub cluster, and the clients will deploy to managed clusters.
3. **Schedule the Application on Managed Clusters**
150
+
----
147
151
152
+
. Schedule the Application on Managed Clusters
153
+
+
148
154
The above configuration schedules only clusters with a `ClusterClaim` having the key `federated-learning-sample.client-data`. You can combine this with other scheduling policies (refer to the Placement API for details).
**c.** After the training and aggregation rounds complete, the status becomes `Completed`:
209
+
----
209
210
210
-
```
211
+
.. After the training and aggregation rounds complete, the status becomes `Completed`:
212
+
+
213
+
[source,bash]
214
+
----
211
215
status:
212
216
listeners:
213
217
- address: 172.18.0.2:31166
@@ -216,6 +220,8 @@ status:
216
220
type: NodePort
217
221
message: Model training successful. Check storage for details
218
222
phase: Completed
219
-
```
223
+
----
220
224
221
-
**d.** The MNIST model is saved in the PVC `model-pvc`. You can download and verify it, here is a sample for [verification](https://github.com/open-cluster-management-io/addon-contrib/blob/main/federated-learning-controller/examples/notebooks/1.hub-evaluation.ipynb).
225
+
.. Download and Verify the Trained Model
226
+
+
227
+
After training is complete and the status is Completed, the MNIST model is saved in the `model-pvc` PersistentVolumeClaim. You can download and evaluate the trained model by following this link:https://github.com/open-cluster-management-io/addon-contrib/blob/main/federated-learning-controller/examples/notebooks/1.hub-evaluation.ipynb[verification notebook].
0 commit comments