Skip to content

Commit 311ab02

Browse files
authored
Cherry pick commits from PRs 1088, 1100, 1120, 1140, and 1145 for documentation updates (#1153)
1 parent af3e20b commit 311ab02

File tree

21 files changed

+309
-597
lines changed

21 files changed

+309
-597
lines changed

docs/examples/xgboost.rst

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
Federated XGBoost
2+
=================
3+
4+
5+
Overview
6+
--------
7+
8+
NVFlare supports federated learning using popular gradient boosting library XGBoost.
9+
It uses XGBoost library with federated plugin (xgboost version >= 1.7.0rc1) to perform the learning.
10+
11+
Using XGBoost with NVFlare has following benefits compared with running federated XGBoost directly,
12+
13+
* XGBoost instance's life-cycle is managed by NVFlare. Both XGBoost client and server
14+
are started/stopped automatically by NVFlare workflow.
15+
* For histogram-based XGBoost federated server can be configured automatically with auto-assigned port number.
16+
* When mutual TLS is used, the certificates are managed by NVFlare using existing
17+
provisioning process.
18+
* No need to manually configure each instance. Instance specific parameters
19+
like code:`rank` are assigned automatically by the NVFlare controller.
20+
21+
Examples
22+
--------
23+
24+
Basic components to run XGBoost are already included with NVFlare distribution.
25+
Most XGBoost jobs can be created without custom code.
26+
27+
Please refer to :code:`NVFlare/examples/xgboost` for more details.

docs/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ NVIDIA FLARE is built on a componentized architecture that gives you the flexibi
3333

3434
Getting Started
3535
===============
36-
For first-time users and FL researchers, FLARE provides the FL Simulator that allows you to build, test, and deploy applications locally. The :ref:`Getting Started guide <getting_started>` covers installation and walks through an example application using the FL Simulator.
36+
For first-time users and FL researchers, FLARE provides the :ref:`fl_simulator` that allows you to build, test, and deploy applications locally. The :ref:`Getting Started guide <getting_started>` covers installation and walks through an example application using the FL Simulator.
3737

3838
When you are ready to for a secure, distributed deployment, the :ref:`Real World Federated Learning <real_world_fl>` section covers the tools and process required to deploy and operate a secure, real-world FLARE project.
3939

docs/programming_guide/provisioning_system.rst

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,67 @@ A new builder to write 'gateway.conf' can be implemented as follows (for referen
283283
f.write(f"name = {gw.name}\n")
284284
f.write(f"port = {port}\n")
285285

286+
.. _distribution_builder:
287+
288+
Case 4: adding a builder for enabling the creation of zip archives for the startup kits
289+
---------------------------------------------------------------------------------------
290+
DistributionBuilder was included in NVIDIA FLARE before version 2.2.1 but has been removed from the
291+
default builders. You can make this builder available and add it as a builder in project.yml if you want to zip the startup kits::
292+
293+
import os
294+
import shutil
295+
import subprocess
296+
297+
from nvflare.lighter.spec import Builder, Project
298+
from nvflare.lighter.utils import generate_password
299+
300+
class DistributionBuilder(Builder):
301+
def __init__(self, zip_password=False):
302+
"""Build the zip files for each folder.
303+
Creates the zip files containing the archives for each startup kit. It will add password protection if the
304+
argument (zip_password) is true.
305+
Args:
306+
zip_password: if true, will create zipped packages with passwords
307+
"""
308+
self.zip_password = zip_password
309+
310+
def build(self, project: Project, ctx: dict):
311+
"""Create a zip for each individual folder.
312+
Note that if zip_password is True, the zip command will be used to encrypt zip files. Users have to
313+
install this zip utility before provisioning. In Ubuntu system, use this command to install zip utility:
314+
sudo apt-get install zip
315+
Args:
316+
project (Project): project instance
317+
ctx (dict): the provision context
318+
"""
319+
wip_dir = self.get_wip_dir(ctx)
320+
dirs = [
321+
name
322+
for name in os.listdir(wip_dir)
323+
if os.path.isdir(os.path.join(wip_dir, name)) and "nvflare_" not in name
324+
]
325+
for dir in dirs:
326+
dest_zip_file = os.path.join(wip_dir, f"{dir}")
327+
if self.zip_password:
328+
pw = generate_password()
329+
run_args = ["zip", "-rq", "-P", pw, dest_zip_file + ".zip", ".", "-i", "startup/*"]
330+
os.chdir(dest_zip_file)
331+
try:
332+
subprocess.run(run_args)
333+
print(f"Password {pw} on {dir}.zip")
334+
except FileNotFoundError:
335+
raise RuntimeError("Unable to zip folders with password. Maybe the zip utility is not installed.")
336+
finally:
337+
os.chdir(os.path.join(dest_zip_file, ".."))
338+
else:
339+
shutil.make_archive(dest_zip_file, "zip", root_dir=os.path.join(wip_dir, dir), base_dir="startup")
340+
341+
If the above code is made available at ``nvflare.lighter.impl.workspace.DistributionBuilder``, add the following to your project.yml at the bottom of the list of builders::
342+
343+
path: nvflare.lighter.impl.workspace.DistributionBuilder
344+
args:
345+
zip_password: true
346+
286347
Takeaways for Custom Builders
287348
-----------------------------
288349
From the cases shown previously, implementing your own Builders only requires the following steps:

docs/publications_and_talks.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ NVIDIA FLARE related blogs and other media.
4040

4141
#### 2019
4242
* **2019-12** [Federated Learning powered by NVIDIA Clara](https://developer.nvidia.com/blog/federated-learning-clara/) (NVIDIA Technical Blog)
43+
* **2019-10** [What is federated learning - in Chinese](https://blogs.nvidia.com.tw/2019/10/13/what-is-federated-learning/) (NVIDIA Technical Blog)
4344
* **2019-10** [NVIDIA Research: First Privacy-Preserving Federated Learning System for Medical Imaging](https://www.youtube.com/watch?v=Jy7ozgwovgg) (NVIDIA video)
4445

4546
## Talks
@@ -58,3 +59,6 @@ Recent talks and Webinars covering federated learning research and NVIDIA FLARE.
5859
* **2021-09** [Federated Learning](https://www.youtube.com/watch?v=YeYO4JGTBb0&amp) ([MONAI MICCAI Bootcamp 2021](https://www.gpuhackathons.org/event/monai-miccai-bootcamp-2021))
5960
* **2021-03** [NVIDIA FLARE: An Open Federated Learning Platform](https://www.nvidia.com/en-us/on-demand/session/gtcspring22-se1991/) ([GTC Spring 2022](https://www.nvidia.com/gtc/))
6061
* **2021-03** [Federated Learning for Healthcare – Collaborative AI without Sharing Patient Data ](https://www.youtube.com/watch?v=xr_eJp3ctzw) ([Data Science Seminar](https://www.dkfz.de/en/datascience/seminar/Rieke.html))
62+
63+
#### 2020
64+
* **2020-11** [Federated Learning for Medical Imaging - in Chinese](https://www.youtube.com/watch?v=CiPdALrNEjU) (NVIDIA Taiwan)

docs/quickstart.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
##########
2+
Quickstart
3+
##########
4+
5+
See :ref:`quickstart`.

docs/real_world_fl.rst

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ This section shows how to use NVIDIA FLARE to deploy and operate an FL system.
88
A reference application will be used here to show provisioning and basic operation
99
of the system through the admin client. You will find information here about setting up the
1010
system with all the available components and the Admin API for
11-
operating FL. For more details on what you can do with apps with custom components and
11+
operating FL. For instructions on how to set up the :ref:`nvflare_dashboard_ui` added in 2.2.1 to
12+
help gather information to provision a project and distribute startup kits, see :ref:`dashboard_api`.
13+
For more details on what you can do with apps with custom components and
1214
the flexibility that the Controller and Worker APIs bring, see the :ref:`programming_guide`.
1315

1416
You can also see some `example applications <https://github.com/NVIDIA/NVFlare/tree/main/examples>`_ integrating with
@@ -24,5 +26,4 @@ to see the capabilities of the system and how it can be operated.
2426
real_world_fl/application
2527
real_world_fl/job
2628
real_world_fl/workspace
27-
real_world_fl/authorization
28-
29+
user_guide/federated_authorization

docs/real_world_fl/application.rst

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -107,16 +107,15 @@ the client config should have the following in order to configure it as an Execu
107107

108108
Configuration of Executor Tasks is ignored here.
109109

110-
Please follow :ref:`quickstart:Quickstart` to learn more.
110+
Please follow :ref:`quickstart` to learn more.
111111

112112
.. _troubleshooting_byoc:
113113

114114
Troubleshooting BYOC
115115
====================
116-
There is an ``enable_byoc`` flag for each participant that can be set at provisioning, and if that is disabled, even if
117-
you have custom code in your application folder, it will not be loaded. There is also a setting for ``allow_byoc``
118-
through the authorization rule groups. This controls whether or not apps containing BYOC code will be allowed to be
119-
uploaded and deployed.
116+
In 2.2.1, authorization has been redesigned and BYOC is no longer controlled through settings at provisioning, but
117+
instead by each site's authorization.json (in the local folder of the workspace). BYOC is a right and can be restricted
118+
to certain roles or even orgs or users. See :ref:`federated_authorization` for details.
120119

121120
*********
122121
Resources

0 commit comments

Comments
 (0)