Skip to content

Commit

Permalink
Multiple changes
Browse files Browse the repository at this point in the history
* Batch rename of `console` -> `shell`
* Shrink titles
* Add `tutorials/` for notebooks
* Lot of reshuffling

Signed-off-by: Shah, Karan <[email protected]>
  • Loading branch information
MasterSkepticista committed Dec 18, 2024
1 parent f39c43f commit 38312d5
Show file tree
Hide file tree
Showing 23 changed files with 807 additions and 508 deletions.
4 changes: 0 additions & 4 deletions docs/about/features.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
.. # Copyright (C) 2020-2024 Intel Corporation
.. # SPDX-License-Identifier: Apache-2.0
==========
Features
==========

Expand Down
4 changes: 2 additions & 2 deletions docs/about/features_index/fed_eval.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.. # Copyright (C) 2020-2024 Intel Corporation
.. # SPDX-License-Identifier: Apache-2.0
Federated Evaluation with OpenFL
Federated Evaluation
=======================================

Introduction to Federated Evaluation
Expand All @@ -28,7 +28,7 @@ To demonstrate usage of the task runner API (aggregator-based workflow) for fede

This script can be directly executed as follows:

.. code-block:: console
.. code-block:: shell
$ python test_hello_federation.py --template torch_cnn_mnist_fed_eval
Expand Down
16 changes: 8 additions & 8 deletions docs/about/features_index/interactive.rst
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ The use of mutual Transport Layer Security (mTLS) is recommended for deployments
STEP 1: Install Open Federated Learning (OpenFL)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Install OpenFL in a virtual Python\*\ environment. See :ref:`install_package` for details.
Install OpenFL in a virtual Python\*\ environment. See :ref:`installation` for details.

.. _step1_start_the_director:

Expand All @@ -84,7 +84,7 @@ Start the Director on a node with at least two open ports. See :ref:`openfl_ll_c

1. Create a Director workspace with a default config file.

.. code-block:: console
.. code-block:: shell
$ fx director create-workspace -p path/to/director_workspace_dir
Expand All @@ -98,13 +98,13 @@ Start the Director on a node with at least two open ports. See :ref:`openfl_ll_c

If mTLS protection is not set up, run this command.

.. code-block:: console
.. code-block:: shell
$ fx director start --disable-tls -c director_config.yaml
If you have a federation with PKI certificates, run this command.

.. code-block:: console
.. code-block:: shell
$ fx director start -c director_config.yaml \
-rc cert/root_ca.crt \
Expand Down Expand Up @@ -145,7 +145,7 @@ The use of mTLS is recommended for deployments in untrusted environments to esta
STEP 1: Install OpenFL
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Install OpenFL in a Python\*\ virtual environment. See :ref:`install_package` for details.
Install OpenFL in a Python\*\ virtual environment. See :ref:`installation` for details.


.. _step1_start_the_envoy:
Expand All @@ -155,7 +155,7 @@ STEP 2: Start the Envoy

1. Create an Envoy workspace with a default config file and shard descriptor Python\*\ script.

.. code-block:: console
.. code-block:: shell
$ fx envoy create-workspace -p path/to/envoy_workspace_dir
Expand All @@ -179,7 +179,7 @@ STEP 2: Start the Envoy

If mTLS protection is not set up, run this command.

.. code-block:: console
.. code-block:: shell
ENVOY_NAME=envoy_example_name
Expand All @@ -192,7 +192,7 @@ STEP 2: Start the Envoy
If you have a federation with PKI certificates, run this command.

.. code-block:: console
.. code-block:: shell
$ ENVOY_NAME=envoy_example_name
Expand Down
2 changes: 0 additions & 2 deletions docs/about/features_index/privacy_meter.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
Privacy Meter
==============

On the Integration of Privacy and OpenFL
-----------------------------------------------
Federated learning (FL) enables parties to learn from each other without sharing their data. In FL, parties share the local update about a global model in each round with a server. The server aggregates the local updates from all parties to produce the next version of the global model, which will be used by all parties as the initialization for training in the next round.

Although each party's data remains local, the shared local updates and aggregate global model each round can leak significant information about the private local training datasets. Specifically, the server can infer information about (even potentially reconstruct) the private data from each party based on their shared local update. Even when the server is trusted, collaborating parties of FL can infer other parties' sensitive data based on the updated global model in each round due to the fact that it is influenced by all local model updates. Due to this serious privacy issue, enabling parties to audit their privacy loss becomes a compelling need.
Expand Down
62 changes: 31 additions & 31 deletions docs/about/features_index/taskrunner.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
.. _running_the_task_runner:

================
Task Runner API
TaskRunner API
================

Let's take a deeper dive into the Task Runner API. If you haven't already, we suggest checking out the :ref:`quick_start` for a primer on doing a simple experiment on a single node.
Expand Down Expand Up @@ -123,7 +123,7 @@ Bare Metal Approach

Ensure you have installed the OpenFL package on every node (aggregator and collaborators) in the federation.

See :ref:`install_package` for details.
See :ref:`installation` for details.



Expand All @@ -149,7 +149,7 @@ STEP 1: Create a Workspace

1. Start a Python 3.9 (>=3.9, <3.12) virtual environment and confirm OpenFL is available.

.. code-block:: console
.. code-block:: shell
$ fx
Expand All @@ -158,7 +158,7 @@ STEP 1: Create a Workspace

Set the environment variables to use the :code:`keras_cnn_mnist` as the template and :code:`${HOME}/my_federation` as the path to the workspace directory.

.. code-block:: console
.. code-block:: shell
$ export WORKSPACE_TEMPLATE=keras_cnn_mnist
$ export WORKSPACE_PATH=${HOME}/my_federation
Expand All @@ -173,14 +173,14 @@ STEP 1: Create a Workspace

See the complete list of available templates.

.. code-block:: console
.. code-block:: shell
$ fx workspace create --prefix ${WORKSPACE_PATH}
4. Create a workspace directory for the new federation project.

.. code-block:: console
.. code-block:: shell
$ fx workspace create --prefix ${WORKSPACE_PATH} --template ${WORKSPACE_TEMPLATE}
Expand All @@ -191,13 +191,13 @@ STEP 1: Create a Workspace

5. Change to the workspace directory.

.. code-block:: console
.. code-block:: shell
$ cd ${WORKSPACE_PATH}
6. Install the workspace requirements:

.. code-block:: console
.. code-block:: shell
$ pip install -r requirements.txt
Expand All @@ -211,7 +211,7 @@ STEP 1: Create a Workspace
The protobuf file with the initial weights is found in **${WORKSPACE_TEMPLATE}_init.pbuf**.


.. code-block:: console
.. code-block:: shell
$ fx plan initialize

Expand All @@ -222,19 +222,19 @@ STEP 1: Create a Workspace

- OPTION 1: override the auto populated FQDN value with the :code:`-a` flag.

.. code-block:: console
.. code-block:: shell
$ fx plan initialize -a aggregator-hostname.internal-domain.com
- OPTION 2: override the apparent FQDN of the system by setting an FQDN environment variable.

.. code-block:: console
.. code-block:: shell
$ export FQDN=x.x.x.x
and initializing the FL plan

.. code-block:: console
.. code-block:: shell
$ fx plan initialize
Expand Down Expand Up @@ -275,49 +275,49 @@ Setting Up the Certificate Authority

1. Change to the path of your workspace:

.. code-block:: console
.. code-block:: shell
$ cd WORKSPACE_PATH
2. Set up the aggregator node as the `certificate authority <https://en.wikipedia.org/wiki/Certificate_authority>`_ for the federation.

All certificates will be signed by the aggregator node. Follow the instructions and enter the information as prompted. The command will create a simple database file to keep track of all issued certificates.

.. code-block:: console
.. code-block:: shell
$ fx workspace certify
3. Run the aggregator certificate creation command, replacing :code:`AFQDN` with the actual `fully qualified domain name (FQDN) <https://en.wikipedia.org/wiki/Fully_qualified_domain_name>`_ for the aggregator node.

.. code-block:: console
.. code-block:: shell
$ fx aggregator generate-cert-request --fqdn AFQDN
.. note::

On Linux\*\, you can discover the FQDN with this command:

.. code-block:: console
.. code-block:: shell
$ hostname --all-fqdns | awk '{print $1}'
.. note::

You can override the apparent FQDN by setting it explicitly via the :code:`--fqdn` parameter.

.. code-block:: console
.. code-block:: shell
$ fx aggregator generate-cert-request --fqdn AFQDN
If you omit the :code:`--fdqn` parameter, then :code:`fx` will automatically use the FQDN of the current node assuming the node has been correctly set with a static address.

.. code-block:: console
.. code-block:: shell
$ fx aggregator generate-cert-request
4. Run the aggregator certificate signing command, replacing :code:`AFQDN` with the actual `fully qualified domain name (FQDN) <https://en.wikipedia.org/wiki/Fully_qualified_domain_name>`_ for the aggregator node.

.. code-block:: console
.. code-block:: shell
$ fx aggregator certify --fqdn AFQDN
Expand All @@ -326,7 +326,7 @@ Setting Up the Certificate Authority

You can override the apparent FQDN of the system by setting an FQDN environment variable (:code:`export FQDN=AFQDN`) before signing the certificate.

.. code-block:: console
.. code-block:: shell
$ fx aggregator certify --fqdn AFQDN
Expand All @@ -351,7 +351,7 @@ Exporting the Workspace

1. Export the workspace so that it can be imported to the collaborator nodes.

.. code-block:: console
.. code-block:: shell
$ fx workspace export
Expand All @@ -370,7 +370,7 @@ Importing the Workspace

2. Import the workspace archive.

.. code-block:: console
.. code-block:: shell
$ fx workspace import --archive WORKSPACE.zip
Expand All @@ -380,7 +380,7 @@ Importing the Workspace

Replace :code:`COL_LABEL` with the label you assigned to the collaborator. This label does not have to be the FQDN; it can be any unique alphanumeric label.

.. code-block:: console
.. code-block:: shell
$ fx collaborator create -n {COL_LABEL} -d {DATA_PATH:optional}
$ fx collaborator generate-cert-request -n {COL_LABEL}
Expand All @@ -403,7 +403,7 @@ Importing the Workspace

4. On the aggregator node (i.e., the certificate authority in this example), sign the Collaborator CSR Package from the collaborator nodes.

.. code-block:: console
.. code-block:: shell
$ fx collaborator certify --request-pkg /PATH/TO/col_{COL_LABEL}_to_agg_cert_request.zip
Expand All @@ -419,7 +419,7 @@ Importing the Workspace

5. On the collaborator node, import the signed certificate and certificate chain into your workspace.

.. code-block:: console
.. code-block:: shell
$ fx collaborator certify --import /PATH/TO/agg_to_col_{COL_LABEL}_signed_cert.zip
Expand All @@ -435,7 +435,7 @@ STEP 3: Start the Federation

1. Start the Aggregator.

.. code-block:: console
.. code-block:: shell
$ fx aggregator start
Expand All @@ -449,7 +449,7 @@ STEP 3: Start the Federation

2. Run the Collaborator.

.. code-block:: console
.. code-block:: shell
$ fx collaborator start -n {COLLABORATOR_LABEL}
Expand Down Expand Up @@ -481,7 +481,7 @@ Post Experiment
Experiment owners may access the final model in its native format.
Among other training artifacts, the aggregator creates the last and best aggregated (highest validation score) model snapshots. One may convert a snapshot to the native format and save the model to disk by calling the following command from the workspace:

.. code-block:: console
.. code-block:: shell
$ fx model save -i model_protobuf_path.pth -o save_model_path
Expand Down Expand Up @@ -515,12 +515,12 @@ Option 1: Deploy a Federation in a Docker Container
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

.. note::
You have to built an OpenFL image. See :ref:`install_docker` for details.
You have to built an OpenFL image. See :ref:`installation` for details.


1. Run the OpenFL image.

.. code-block:: console
.. code-block:: shell
$ docker run -it --network host openfl
Expand All @@ -539,7 +539,7 @@ Option 2: Deploy Your Workspace in a Docker Container

1. Build an image with the workspace you created.

.. code-block:: console
.. code-block:: shell
$ fx workspace dockerize
Expand Down
Loading

0 comments on commit 38312d5

Please sign in to comment.