Mentions légales du service

Skip to content

Secagg default biprime setup #354

VESIN Marc requested to merge feature/354-setup-biprime-default into develop

MR description

  • unit tests

This MR addresses #354 (closed)

Content:

  • add default biprime(s) to component's database when fedbiomed_run xxx configuration create is called. If ALLOW_DEFAULTS_BIPRIME is True, then read list of default biprimes from DEFAULT_BIPRIMES_DIR (else list of default biprimes is empty). Add or update default biprimes to component database; remove from database the default biprimes that are not in the list.
  • add setup of biprime component element (triggered by SecaggRequest message). Setup can occur with a default biprime in the database, or with a new biprime computed (currently not implemented, dummy payload)
  • use default biprime default_biprime0 (the default biprime distributed with the library) in Experiment()
  • add removal of biprime component element from components database. Prevent researcher from deleting a default biprime in nodes' database.
  • update secagg tutorial notebook
  • extra: add saving of negotiated component in researcher's database both for biprime and server key (needed for biprime, homogeneity plus robustness by adding for server key)
  • extra: some refactoring for code factorization (SecaggManager in common, node and researcher *Secagg* can share some methods between server key and biprime)
  • fix: for server key and biprime, when re-using a secagg component saved in database, check that the parties lists from saved component is either None (can be used by every party) of a superset of the experiment's parties. This is not a security issue but will cause clear failures instead of timeouts in MP-SPDZ.

You can test with:

# clean configuration
source ./scripts/fedbiomed_environment clean
./scripts/fedbiomed_run  network

# create, configure, launch 2 nodes + 1 researcher

# not needed
# ./scripts/fedbiomed_run node config config-n1.ini configuration create
./scripts/fedbiomed_run node config config-n1.ini -am /data/mvesin/data
./scripts/fedbiomed_run node config config-n1.ini start
# not needed
# ./scripts/fedbiomed_run node config config-n2.ini configuration create
./scripts/fedbiomed_run node config config-n2.ini -am /data/mvesin/data
./scripts/fedbiomed_run node config config-n2.ini start
# not needed
# ./scripts/fedbiomed_run researcher configuration create
./scripts/fedbiomed_run researcher start

# initialize certificates for the 3 components
./scripts/fedbiomed_configure_secagg  node   # or researcher
./scripts/fedbiomed_run certificate-dev-setup

# then test with `notebooks/general-tutorial-secagg.ipynb`

Developer Certificate Of Origin (DCO)

By opening this merge request, you agree the Developer Certificate of Origin (DCO)

This DCO essentially means that:

  • you offer the changes under the same license agreement as the project, and
  • you have the right to do that,
  • you did not steal somebody else’s work.

License

Project code files should begin with these comment lines to help trace their origin:

# This file is originally part of Fed-BioMed
# SPDX-License-Identifier: Apache-2.0

Code files can be reused from another project with a compatible non-contaminating license. They shall retain the original license and copyright mentions. The CREDIT.md file and credit/ directory shall be completed and updated accordingly.

Guidelines for MR review

General:

Specific to some cases:

  • update all conda envs consistently (development and vpn, Linux and MacOS)
  • if modified researcher (eg new attributes in classes) check if breakpoint needs update (breakpoint/load_breakpoint in Experiment(), save_state/load_state in aggregators, strategies, secagg, etc.)
Edited by VESIN Marc

Merge request reports