The py-fl-manager project provides easy integration with NVFlare.
Warning
This project is currently in alpha.
Note
The documentation is in progress. Some sections may be incomplete, outdated, or missing details.
The base docker image used is
fl-manager:dev, somake dev/buildshould be executed first.
See available examples at examples. Currently, only nvflare_mnist is available.
Access the example folder. There is a project.yml with the FL project configuration and a set of folders with jobs examples.
- Start by provisioning the workspace with
nvflare provision.
- For now, (04/02/2025):
- Copy and paste the job's folders inside
transferfrom the admin folder. - Change the
PYTHON_EXECUTABLEvariable inside the.env. - Change
fed_admin.jsonoverseer endpoint from 'server1' to 'localhost'.
- Copy and paste the job's folders inside
- Run
docker compose buildanddocker compose upto initialize the simulation workspace. - Login into the admin CLI (
startup.sh) script. - Submit job!
For (1), the following command can be run to achieve it: EXAMPLE=nvflare_mnist make dev/provision.
This repository provides a configuration for SonarScanner. Some missing parameters that should be set before running are the following:
sonar.projectKey=${PROJECT_KEY}
sonar.projectName=${PROJECT_NAME}
sonar.token=${SONAR_TOKEN}A self-hosted SonarQube can be deployed to perform a local analysis.
- Deploy
SonarQubewithdocker run --name sonarqube-custom -p 9000:9000 sonarqube:community. - Access
SonarQubeand configure a project (default credentials admin:admin). - Create a Project and copy the token.
- Execute tests with coverage using
make dev/test-cov. - Change in
coverage.xmlthe<source>/opt/project/fl_manager</source>root to<source>/usr/src/fl_manager</source>, this enables the coverage support in this local scan. - Fill the properties file with the missing values.
- Run
docker run --rm --network host -e SONAR_HOST_URL="http://localhost:9000" -v $(pwd):/usr/src sonarsource/sonar-scanner-cli
All packages follow semantic versioning. This means, all versions with the same major must be compatible between them. This way, packages can evolve independently between them. When a major release needs to be done, all packages must be bumped to the new major.
- Execute
make uv_runtime/run. - Create the necessary folders if they do not exist.
- Run
uv init --no-readme --no-pin-python --lib --name $NAME $PATH. - Mark
srcas source root. Create subfolders for namespace. - Add build target (in new package
.toml) to the namespace package.
We use pre-commit hooks.
Probably there will be other methods to install pre-commit we use the following steps:
- Install
pipxwith (system's)pip(i.e.pip install pipx). - Install
pre-commitwithpipx(i.e.pipx install pre-commit). - Follow the instructions that are printed after the execution of the step 2 command, to ensure that
pre-commitis in the path. - Run
pre-commit install.
Check .pre-commit-config.yaml to check what hooks are installed!
