Skip to content

Commit

Permalink
Merge branch 'develop' into feature/401-scripts-for-certificate-and-i…
Browse files Browse the repository at this point in the history
…p-address-registration
  • Loading branch information
mvesin committed Jan 23, 2023
2 parents 1d96503 + e3a75d6 commit fea6189
Show file tree
Hide file tree
Showing 13 changed files with 80 additions and 75 deletions.
1 change: 1 addition & 0 deletions AUTHORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ Each author can mention his/her name only or give more information in the follow
- Yann Fraboni
- Thibaud Kloczko
- Lena Le Quintrec
- Nathan Lapel
- Jonathan Levy
- Marco Lorenzi
- Riham Nehmeh
Expand Down
2 changes: 1 addition & 1 deletion envs/development/conda/fedbiomed-gui.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ dependencies:
- pip:
# nn
- torch >=1.8.0,<2.0.0
- torchvision >=0.9.0,<0.14.0
- torchvision >=0.9.0,<0.15.0
- monai >=1.0.0,<1.1.0
# other
- pandas >=1.2.3,<2.0.0
Expand Down
2 changes: 1 addition & 1 deletion envs/development/conda/fedbiomed-node-macosx.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ dependencies:
- pip:
# nn
- torch >=1.8.0,<2.0.0
- torchvision >=0.9.0,<0.14.0
- torchvision >=0.9.0,<0.15.0
- opacus >=1.2.0,<1.3.0
- monai >=1.0.0,<1.1.0
# other
Expand Down
2 changes: 1 addition & 1 deletion envs/development/conda/fedbiomed-node.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ dependencies:
- pip:
# nn
- torch >=1.8.0,<2.0.0
- torchvision >=0.9.0,<0.14.0
- torchvision >=0.9.0,<0.15.0
- opacus >=1.2.0,<1.3.0
- monai >=1.0.0,<1.1.0
# other
Expand Down
2 changes: 1 addition & 1 deletion envs/development/conda/fedbiomed-researcher-macosx.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ dependencies:
- pip:
# nn
- torch >=1.8.0,<2.0.0
- torchvision >=0.9.0,<0.14.0
- torchvision >=0.9.0,<0.15.0
- opacus >=1.2.0,<1.3.0
- monai >=1.0.0,<1.1.0
# other
Expand Down
2 changes: 1 addition & 1 deletion envs/development/conda/fedbiomed-researcher.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ dependencies:
- pip:
# nn
- torch >=1.8.0,<2.0.0
- torchvision >=0.9.0,<0.14.0
- torchvision >=0.9.0,<0.15.0
- opacus >=1.2.0,<1.3.0
- monai >=1.0.0,<1.1.0
# other
Expand Down
4 changes: 2 additions & 2 deletions envs/vpn/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Supported operating systems for using containers :
Pre-requisites for using containers :

* **`docker >= 20.10.0`** is needed to build mqtt, see [there](https://wiki.alpinelinux.org/wiki/Release_Notes_for_Alpine_3.14.0#faccessat2). With older docker version it fails with a `make: sh: Operation not permitted`
* **`docker-compose` >= 1.27.0 and < 2.0** is needed for extended file format for [GPU support in docker](https://docs.docker.com/compose/gpu-support/) even if you're not using GPU in container.
* **`docker-compose` >= 1.27.0** is needed for extended file format for [GPU support in docker](https://docs.docker.com/compose/gpu-support/) even if you're not using GPU in container.
- some distributions (eg Ubuntu 20.04) don't provide a package with a recent enough version.
- Type `docker-compose --version` to check installed version.
- You can use your usual package manager to install up-to-date version (eg: `sudo apt-get update && sudo apt-get install docker-compose` for apt, `sudo dnf clean metadata && sudo dnf update docker-compose` for dnf).
Expand Down Expand Up @@ -579,7 +579,7 @@ Before using a GPU for Fed-BioMed in a `node` docker container, you need to meet
- not supported on MacOS (few Nvidia cards, docker virtualized)
* **Nvidia drivers and CUDA >= 11.5.0** (the version used by Fed-BioMed container with GPU support)
* **[Nvidia container toolkit](https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/install-guide.html)**
* **`docker-compose` version >= 1.27.0 and < 2.0** (already installed for container support)
* **`docker-compose` version >= 1.27.0** (already installed for container support)
Installation guidelines for requirements:
Expand Down
2 changes: 1 addition & 1 deletion envs/vpn/conda/fedbiomed-gui.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ dependencies:
- pip:
# nn
- torch >=1.8.0,<2.0.0
- torchvision >=0.9.0,<0.14.0
- torchvision >=0.9.0,<0.15.0
- monai >=1.0.0,<1.1.0
# other
- pandas >=1.2.3,<2.0.0
Expand Down
2 changes: 1 addition & 1 deletion envs/vpn/conda/fedbiomed-node.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ dependencies:
- pip:
# nn
- torch >=1.8.0,<2.0.0
- torchvision >=0.9.0,<0.14.0
- torchvision >=0.9.0,<0.15.0
- opacus >=1.2.0,<1.3.0
- monai >=1.0.0,<1.1.0
# other
Expand Down
2 changes: 1 addition & 1 deletion envs/vpn/conda/fedbiomed-researcher.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ dependencies:
- pip:
# nn
- torch >=1.8.0,<2.0.0
- torchvision >=0.9.0,<0.14.0
- torchvision >=0.9.0,<0.15.0
- opacus >=1.2.0,<1.3.0
- monai >=1.0.0,<1.1.0
# other
Expand Down
66 changes: 34 additions & 32 deletions envs/vpn/docker/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,38 @@
version: "3.7"

#
# node component template
x-node:
&standard-node
container_name: fedbiomed-vpn-node
hostname: fedbiomed-vpn-node
build:
context: ../../..
dockerfile: envs/vpn/docker/node/build_files/Dockerfile
args:
- CONTAINER_UID
- CONTAINER_GID
- CONTAINER_USER
- CONTAINER_GROUP
image: fedbiomed/vpn-node
environment:
# enable overloading build-time id with a run-time id
- CONTAINER_UID
- CONTAINER_GID
- CONTAINER_USER
- CONTAINER_GROUP
cap_add:
- net_admin
- sys_module
devices:
- /dev/net/tun
volumes:
- ./node/run_mounts/config:/config # contains VPN configurations
- ./node/run_mounts/data:/data # datasets can be added here
- ./node/run_mounts/etc:/fedbiomed/etc # contains fedbiomed config files
- ./node/run_mounts/var:/fedbiomed/var # contains fedbiomed db, exp results ...
- ./node/run_mounts/envs/common:/fedbiomed/envs/common # contains fedbiomed default training plans...

services:
#
# intermediate step : image for building wireguard for base image
Expand Down Expand Up @@ -78,38 +112,6 @@ services:
- ./vpnserver/run_mounts/config:/config # contains VPN configurations
ports:
- 51820:51820/udp # wireguard server
#
# node component
x-node:
&standard-node
container_name: fedbiomed-vpn-node
hostname: fedbiomed-vpn-node
build:
context: ../../..
dockerfile: envs/vpn/docker/node/build_files/Dockerfile
args:
- CONTAINER_UID
- CONTAINER_GID
- CONTAINER_USER
- CONTAINER_GROUP
image: fedbiomed/vpn-node
environment:
# enable overloading build-time id with a run-time id
- CONTAINER_UID
- CONTAINER_GID
- CONTAINER_USER
- CONTAINER_GROUP
cap_add:
- net_admin
- sys_module
devices:
- /dev/net/tun
volumes:
- ./node/run_mounts/config:/config # contains VPN configurations
- ./node/run_mounts/data:/data # datasets can be added here
- ./node/run_mounts/etc:/fedbiomed/etc # contains fedbiomed config files
- ./node/run_mounts/var:/fedbiomed/var # contains fedbiomed db, exp results ...
- ./node/run_mounts/envs/common:/fedbiomed/envs/common # contains fedbiomed default training plans...

# not using gpu
node:
Expand Down
64 changes: 33 additions & 31 deletions envs/vpn/docker/docker-compose_run_node.yml
Original file line number Diff line number Diff line change
@@ -1,36 +1,38 @@
version: "3.7"

#
# Minimal configuration for only running a node component from a saved image
#
# Minimal dockerfile permits minimal file tree
# because *all* files dependencies referenced in `docker-compose.yml`
# (eg: `./*/build_files`, `./*/run_mounts/config/config.env`)
# need to exist for *all* containers everytime we run a docker-compose command
# thus we would have to copy file trees for vpnserver, researcher, etc. when only
# running a node
x-node:
&standard-node
container_name: fedbiomed-vpn-node
hostname: fedbiomed-vpn-node
image: fedbiomed/vpn-node
environment:
# enable overloading build-time id with a run-time id
- CONTAINER_UID
- CONTAINER_GID
- CONTAINER_USER
- CONTAINER_GROUP
cap_add:
- net_admin
- sys_module
devices:
- /dev/net/tun
volumes:
- ./node/run_mounts/config:/config # contains VPN configurations
- ./node/run_mounts/data:/data # datasets can be added here
- ./node/run_mounts/etc:/fedbiomed/etc # contains fedbiomed config files
- ./node/run_mounts/var:/fedbiomed/var # contains fedbiomed db, exp results ...
- ./node/run_mounts/envs/common:/fedbiomed/envs/common # contains fedbiomed default training plans..

services:
#
# Minimal configuration for only running a node component from a saved image
#
# Minimal dockerfile permits minimal file tree
# because *all* files dependencies referenced in `docker-compose.yml`
# (eg: `./*/build_files`, `./*/run_mounts/config/config.env`)
# need to exist for *all* containers everytime we run a docker-compose command
# thus we would have to copy file trees for vpnserver, researcher, etc. when only
# running a node
x-node:
&standard-node
container_name: fedbiomed-vpn-node
hostname: fedbiomed-vpn-node
image: fedbiomed/vpn-node
environment:
# enable overloading build-time id with a run-time id
- CONTAINER_UID
- CONTAINER_GID
- CONTAINER_USER
- CONTAINER_GROUP
cap_add:
- net_admin
- sys_module
devices:
- /dev/net/tun
volumes:
- ./node/run_mounts/config:/config # contains VPN configurations
- ./node/run_mounts/data:/data # datasets can be added here
- ./node/run_mounts/etc:/fedbiomed/etc # contains fedbiomed config files
- ./node/run_mounts/var:/fedbiomed/var # contains fedbiomed db, exp results ...
- ./node/run_mounts/envs/common:/fedbiomed/envs/common # contains fedbiomed default training plans..
# not using gpu
node:
<< : *standard-node
Expand Down
4 changes: 2 additions & 2 deletions tests/test_medical_datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ def test_nifti_folder_dataset_09_dataloader(self):
dataset = NIFTIFolderDataset(self.root)
batch_size = len(dataset) // 2
loader = DataLoader(dataset, batch_size=batch_size, shuffle=True)
img_batch, targets = iter(loader).next()
img_batch, targets = next(iter(loader))

self.assertEqual(len(targets), batch_size)
self.assertEqual(len(img_batch), batch_size)
Expand Down Expand Up @@ -704,7 +704,7 @@ def _assert_batch_types_and_sizes(self, dataset: Dataset):
AssertionError if test fails
"""
data_loader = DataLoader(dataset, batch_size=self.batch_size)
(images, demographics), targets = iter(data_loader).next() # get the first iteration of dataloader
(images, demographics), targets = next(iter(data_loader)) # get the first iteration of dataloader

self.assertIsInstance(images, dict)
self.assertIsInstance(targets, dict)
Expand Down

0 comments on commit fea6189

Please sign in to comment.