Skip to content

Commit

Permalink
fixing merge conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
ybouilla committed May 16, 2023
2 parents 8de4262 + 49055cf commit f7eb21b
Show file tree
Hide file tree
Showing 45 changed files with 614 additions and 110 deletions.
5 changes: 3 additions & 2 deletions .gitlab/merge_request_templates/Default.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,12 @@ The `CREDIT.md` file and `credit/` directory shall be completed and updated acco

General:

* give a glance to [DoD](https://fedbiomed.gitlabpages.inria.fr/latest/developer/Fed-BioMed_DoD.pdf)
* check [coding rules and coding style](https://fedbiomed.gitlabpages.inria.fr/latest/developer/usage_and_tools/#coding-style)
* give a glance to [DoD](http://fedbiomed.org/latest/developer/Fed-BioMed_DoD.pdf)
* check [coding rules and coding style](http://fedbiomed.org/latest/developer/usage_and_tools/#coding-style)
* check docstrings (eg run `tests/docstrings/check_docstrings`)

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.)
* if modified a component with versioning (config files, breakpoint, messaging protocol) then update the version following the rules in `common/utils/_versions.py`
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Here is a brief summary of how it is structured:

## Getting started

Please **read carefully** [the Developer guide on the Fed-BioMed webpage](https://fedbiomed.gitlabpages.inria.fr/latest/developer/usage_and_tools/).
Please **read carefully** [the Developer guide on the Fed-BioMed webpage](http://fedbiomed.org/latest/developer/usage_and_tools/).

When done please contact `fedbiomed _at_ inria _dot_ fr` to receive your contributor credentials consisting of: an account on `gitlab.inria.fr` with access to the gitlab repository, the registration to the developer mailing lists, the invitation to the developers team's Discord server. Please feel free to ask for a meeting on Discord to meet Fed-BioMed developers, to explain your interests in the framework and envisagd contributions, to ask questions, etc.

Expand Down
9 changes: 4 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Fed-BioMed is an open source project focused on empowering biomedical research u

The project is currently based on Python, PyTorch and Scikit-learn, and enables developing and deploying federated learning analysis in real-world machine learning applications.

The code is regularly released and available on the **master** branch of this repository. The documentation of the releases can be found at https://fedbiomed.gitlabpages.inria.fr
The code is regularly released and available on the **master** branch of this repository. The documentation of the releases can be found at http://fedbiomed.org

Curious users may also be interested by the current developments, occuring in the **develop** branch (https://gitlab.inria.fr/fedbiomed/fedbiomed/-/tree/develop)
According to our coding rules, the develop branch is usable, tests and tutorials will run, but the documentation may be not fully available or desynchronized with the code. We only provide support for the last release (currently v4.3) aka the master branch.
Expand All @@ -24,9 +24,9 @@ It runs also smoothly on macOSX (mostly tested on macOSX 12: Monterey).

This README.md file provide a quick start/installation guide for Linux.

Full installation instruction are also available at: https://fedbiomed.gitlabpages.inria.fr/latest/tutorials/installation/0-basic-software-installation/
Full installation instruction are also available at: http://fedbiomed.org/latest/tutorials/installation/0-basic-software-installation/

An installation guide is also provided for Windows10, which relies on WSL2: https://fedbiomed.gitlabpages.inria.fr/latest/user-guide/installation/windows-installation/
An installation guide is also provided for Windows10, which relies on WSL2: http://fedbiomed.org/latest/user-guide/installation/windows-installation/


### Prerequisites :
Expand Down Expand Up @@ -356,7 +356,7 @@ without paying action on visual of the site.
./tests/docstrings/check_docstrings
```

Developer should do the last test on gitlabpages.
Developer should do the last test before pushing documentation release.

## Using Tensorboard

Expand Down Expand Up @@ -649,4 +649,3 @@ ${FEDBIOMED_DIR}/scripts/fedbiomed_mpc (node | researcher) *WORKDIR* exec --help
${FEDBIOMED_DIR}/scripts/fedbiomed_mpc (node | researcher) *WORKDIR* shamir-server-key --help
```

3 changes: 2 additions & 1 deletion RELEASE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Fed-BioMed release HOWTO

Make coordinated release of software (this repo) and documentation (published on `fedbiomed.gitlabpages.inria.fr`)
Make coordinated release of software (this repo) and documentation (published on `http://fedbiomed.org`)
* using same version tag
* corresponding to same software version
* **release software before documentation** (for API documentation)
Expand Down Expand Up @@ -35,6 +35,7 @@ git checkout -b release/$RELEASE_TAG
- in the `release` branch, do the release time updates:
* `CHANGELOG.md`
* `README.md` : change `v4.` occurences ; change `version 4` if major release
* `fedbiomed/common/constants.py` : change `v4.`
- in the `release` branch, commit the release time updates
```bash
git commit -a
Expand Down
1 change: 1 addition & 0 deletions envs/development/conda/fedbiomed-gui.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ dependencies:
- jsonschema >=4.2.0,< 4.2.1
- requests >=2.25.1,<3.0.0
- git
- packaging >=23.0,<24.0
# sklearn
# scipy >= 1.9 from conda-forge needs recent GLIBC thus causes issue 389
# with many current systems
Expand Down
1 change: 1 addition & 0 deletions envs/development/conda/fedbiomed-node-macosx.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ dependencies:
- validators >=0.18.2,<0.19.0
- tqdm >=4.59.0,<5.0.0
- git
- packaging >=23.0,<24.0
# these two have to be aligned
- cryptography ~=39.0
- pyopenssl ~=23.0
Expand Down
1 change: 1 addition & 0 deletions envs/development/conda/fedbiomed-node.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ dependencies:
- validators >=0.18.2,<0.19.0
- tqdm >=4.59.0,<5.0.0
- git
- packaging >=23.0,<24.0
# these two have to be aligned
- cryptography ~=39.0
- pyopenssl ~=23.0
Expand Down
1 change: 1 addition & 0 deletions envs/development/conda/fedbiomed-researcher-macosx.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ dependencies:
- validators >=0.18.2,<0.19.0
- tqdm >=4.59.0,<5.0.0
- git
- packaging >=23.0,<24.0
# these two have to be aligned
- cryptography ~=39.0
- pyopenssl ~=23.0
Expand Down
1 change: 1 addition & 0 deletions envs/development/conda/fedbiomed-researcher.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ dependencies:
- validators >=0.18.2,<0.19.0
- tqdm >=4.59.0,<5.0.0
- git
- packaging >=23.0,<24.0
# these two have to be aligned
- cryptography ~=39.0
- pyopenssl ~=23.0
Expand Down
4 changes: 2 additions & 2 deletions envs/vpn/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@ Use the node gui from outside the gui container :
By default, only connections from `localhost` are authorized. To enable connection to the GUI from any IP address
- specify the bind IP address at container launch time (eg: your node public IP address `NODE_IP`, or `0.0.0.0` to listen on all node addresses)
```bash
[user@node $] GUI_HOST=0.0.0.0 docker-compose up -d gui
[user@node $] GUI_SERVER_IP=0.0.0.0 docker-compose up -d gui
```
- connect to `http://${NODE_IP}:8484`
- **warning** allowing connections from non-`localhost` exposes the gui to attacks from the network. Only use with proper third party security measures (web proxy, firewall, etc.) Currently, the provided gui container does not include a user authentication mechanism or encrypted communications for the user.
Expand Down Expand Up @@ -566,7 +566,7 @@ my_notebook.ipynb
## GPU support in container
You can access the host machine GPU accelerator from a node container to speed up training.
- reminder: Fed-BioMed currently [supports only](https://fedbiomed.gitlabpages.inria.fr/user-guide/nodes/using-gpu/) (1) Nvidia GPUs (2) for PyTorch training (3) on node side
- reminder: Fed-BioMed currently [supports only](http://fedbiomed.org/latest/user-guide/nodes/using-gpu/) (1) Nvidia GPUs (2) for PyTorch training (3) on node side
Before using a GPU for Fed-BioMed in a `node` docker container, you need to meet the requirements for the host machine:
Expand Down
1 change: 1 addition & 0 deletions envs/vpn/conda/fedbiomed-gui.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ dependencies:
- jsonschema >=4.2.0,< 4.2.1
- requests >=2.25.1,<3.0.0
- git
- packaging >=23.0,<24.0
# sklearn
# scipy >= 1.9 from conda-forge needs recent GLIBC thus causes issue 389
# with many current systems
Expand Down
1 change: 1 addition & 0 deletions envs/vpn/conda/fedbiomed-node.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ dependencies:
- validators >=0.18.2,<0.19.0
- tqdm >=4.59.0,<5.0.0
- git
- packaging >=23.0,<24.0
# these two have to be aligned
- cryptography ~=39.0
- pyopenssl ~=23.0
Expand Down
1 change: 1 addition & 0 deletions envs/vpn/conda/fedbiomed-researcher.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ dependencies:
- validators >=0.18.2,<0.19.0
- tqdm >=4.59.0,<5.0.0
- git
- packaging >=23.0,<24.0
# these two have to be aligned
- cryptography ~=39.0
- pyopenssl ~=23.0
Expand Down
10 changes: 6 additions & 4 deletions envs/vpn/docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -196,15 +196,16 @@ services:
environment:
# enable overloading build-time id with a run-time id
- SSL_ON=true
- GUI_SERVER_NAME
- NGINX_PORT_SSL=8443
- NGINX_PORT_NOSSL=8484
- CONTAINER_UID
- CONTAINER_GID
- CONTAINER_USER
- CONTAINER_GROUP
ports:
- "${GUI_HOST:-127.0.0.1}:8484:8484" # nginx + flask HTTP server
- "${GUI_HOST:-127.0.0.1}:8443:8443" # nginx + gunicorn HTTPS server
- "${GUI_SERVER_IP:-127.0.0.1}:8484:8484" # nginx + flask HTTP server
- "${GUI_SERVER_IP:-127.0.0.1}:8443:8443" # nginx + gunicorn HTTPS server
volumes:
# caution: /data /etc /var directory must be shared with node
- ./gui/run_mounts/certs:/certs
Expand All @@ -225,15 +226,16 @@ services:
environment:
# enable overloading build-time id with a run-time id
- SSL_ON=true
- GUI_SERVER_NAME
- NGINX_PORT_SSL=8444
- NGINX_PORT_NOSSL=8485
- CONTAINER_UID
- CONTAINER_GID
- CONTAINER_USER
- CONTAINER_GROUP
ports:
- "${GUI_HOST:-127.0.0.1}:8485:8485" # nginx + gunicorn HTTP server
- "${GUI_HOST:-127.0.0.1}:8444:8444" # nginx + gunicorn HTTPS server
- "${GUI_SERVER_IP:-127.0.0.1}:8485:8485" # nginx + gunicorn HTTP server
- "${GUI_SERVER_IP:-127.0.0.1}:8444:8444" # nginx + gunicorn HTTPS server
volumes:
# caution: /data /etc /var directory must be shared with node
- ./gui2/run_mounts/certs:/certs
Expand Down
10 changes: 6 additions & 4 deletions envs/vpn/docker/docker-compose_run_node.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,15 +88,16 @@ services:
environment:
# enable overloading build-time id with a run-time id
- SSL_ON=true
- GUI_SERVER_NAME
- NGINX_PORT_SSL=8443
- NGINX_PORT_NOSSL=8484
- CONTAINER_UID
- CONTAINER_GID
- CONTAINER_USER
- CONTAINER_GROUP
ports:
- "${GUI_HOST:-127.0.0.1}:8484:8484" # nginx + flask HTTP server
- "${GUI_HOST:-127.0.0.1}:8443:8443" # nginx + gunicorn HTTPS server
- "${GUI_SERVER_IP:-127.0.0.1}:8484:8484" # nginx + flask HTTP server
- "${GUI_SERVER_IP:-127.0.0.1}:8443:8443" # nginx + gunicorn HTTPS server
volumes:
# caution: /data /etc /var directory must be shared with node
- ./gui/run_mounts/certs:/certs
Expand All @@ -113,15 +114,16 @@ services:
environment:
# enable overloading build-time id with a run-time id
- SSL_ON=true
- GUI_SERVER_NAME
- NGINX_PORT_SSL=8444
- NGINX_PORT_NOSSL=8485
- CONTAINER_UID
- CONTAINER_GID
- CONTAINER_USER
- CONTAINER_GROUP
ports:
- "${GUI_HOST:-127.0.0.1}:8485:8485" # nginx + flask HTTP server
- "${GUI_HOST:-127.0.0.1}:8444:8444" # nginx + gunicorn HTTPS server
- "${GUI_SERVER_IP:-127.0.0.1}:8485:8485" # nginx + flask HTTP server
- "${GUI_SERVER_IP:-127.0.0.1}:8444:8444" # nginx + gunicorn HTTPS server
volumes:
# caution: /data /etc /var directory must be shared with node
- ./gui2/run_mounts/certs:/certs
Expand Down
14 changes: 10 additions & 4 deletions envs/vpn/docker/gui/build_files/entrypoint.bash
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,20 @@ change_path_owner "/fedbiomed" "/home/$CONTAINER_BUILD_USER"
# To avoid envsubst to over write default nginx variables
export DOLLAR='$'

if [ -z "$GUI_SERVER_NAME" ]; then
export GUI_SERVER_NAME=127.0.0.1
fi

# Set Gunicorn PORT and HOST
export GUI_PORT=8000
export GUI_HOST=localhost

# Set variable for nginx handling with/without specific domain
if [ -z "$GUI_SERVER_NAME" ] ; then
export SERVER_NAME_DIRECTIVE=
export DEFAULT_FAIL=
export DEFAULT_SUCCEED=' default_server'
else
export SERVER_NAME_DIRECTIVE="server_name ${GUI_SERVER_NAME};"
export DEFAULT_FAIL=' default_server'
export DEFAULT_SUCCEED=
fi

echo "SSL activation status: $SSL_ON"

Expand Down
27 changes: 23 additions & 4 deletions envs/vpn/docker/gui/build_files/nginx/no-ssl.conf.template
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,19 @@ upstream fedbiomed_gunicorn {
server ${GUI_HOST}:${GUI_PORT};
}

server {

listen ${NGINX_PORT_NOSSL} ${DEFAULT_FAIL};

server_name "";
return 444;
}

server {
listen ${NGINX_PORT_NOSSL} default_server;
listen ${NGINX_PORT_NOSSL}${DEFAULT_SUCCEED};
listen [::]:${NGINX_PORT_NOSSL};

server_name $GUI_SERVER_NAME;
${SERVER_NAME_DIRECTIVE}

location / {
proxy_pass http://fedbiomed_gunicorn;
Expand All @@ -32,9 +39,21 @@ server {
}

server {
listen ${NGINX_PORT_SSL} ssl;

server_name $GUI_SERVER_NAME;
listen ${NGINX_PORT_SSL} ssl${DEFAULT_FAIL};

server_name "";

ssl_certificate ${SSL_CERTIFICATE};
ssl_certificate_key ${SSL_KEY};

return 444;
}

server {
listen ${NGINX_PORT_SSL} ssl${DEFAULT_SUCCEED};

${SERVER_NAME_DIRECTIVE}

ssl_certificate ${SSL_CERTIFICATE};
ssl_certificate_key ${SSL_KEY};
Expand Down
29 changes: 24 additions & 5 deletions envs/vpn/docker/gui/build_files/nginx/ssl.conf.template
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,19 @@ upstream fedbiomed_gunicorn {
server localhost:${GUI_PORT};
}

server {

listen ${NGINX_PORT_NOSSL} ${DEFAULT_FAIL};

server_name "";
return 444;
}

server {
listen ${NGINX_PORT_NOSSL} default_server;
listen [::]:${NGINX_PORT_NOSSL} default_server;
listen ${NGINX_PORT_NOSSL}${DEFAULT_SUCCEED};
listen [::]:${NGINX_PORT_NOSSL};

server_name $GUI_SERVER_NAME;
${SERVER_NAME_DIRECTIVE}

location / {
return 302 https://${DOLLAR}host:${NGINX_PORT_SSL}${DOLLAR}request_uri;
Expand All @@ -18,9 +25,21 @@ server {

server {

listen ${NGINX_PORT_SSL} ssl;
listen ${NGINX_PORT_SSL} ssl${DEFAULT_FAIL};

server_name "";

ssl_certificate ${SSL_CERTIFICATE};
ssl_certificate_key ${SSL_KEY};

return 444;
}

server {

listen ${NGINX_PORT_SSL} ssl${DEFAULT_SUCCEED};

server_name $GUI_SERVER_NAME;
${SERVER_NAME_DIRECTIVE}

ssl_certificate ${SSL_CERTIFICATE};
ssl_certificate_key ${SSL_KEY};
Expand Down
1 change: 1 addition & 0 deletions fedbiomed/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from fedbiomed.common.constants import __version__
5 changes: 5 additions & 0 deletions fedbiomed/common/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

"""Fed-BioMed constants/enums"""

from packaging.version import Version as FBM_Component_Version
from enum import Enum

CONFIG_FOLDER_NAME = "etc"
Expand Down Expand Up @@ -32,6 +33,10 @@

MPSPDZ_certificate_prefix = "MPSPDZ_certificate"

__version__ = FBM_Component_Version('4.3') # Fed-BioMed software version
__researcher_config_version__ = FBM_Component_Version('1') # researcher config file version
__node_config_version__ = FBM_Component_Version('1') # node config file version


class _BaseEnum(Enum):
"""
Expand Down
Loading

0 comments on commit f7eb21b

Please sign in to comment.