Skip to content

Commit 030bac2

Browse files
committed
initial commit for superlink
0 parents  commit 030bac2

File tree

14 files changed

+1308
-0
lines changed

14 files changed

+1308
-0
lines changed

.dockerignore

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
.git/
2+
.github/
3+
.dockerignore
4+
Dockerfile
5+
6+
*~
7+
*.DS_Store
8+
*.egg-info/
9+
__pycache__/
10+
11+
.docker
12+
13+
.idea/
14+
.vscode/
15+
16+
examples/
17+
18+
venv/

.gitignore

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
*~
2+
*.DS_Store
3+
*.egg-info/
4+
__pycache__/
5+
6+
.docker
7+
8+
.idea/
9+
.vscode/
10+
11+
venv/

Dockerfile

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Python version can be changed, e.g.
2+
# FROM python:3.8
3+
# FROM ghcr.io/mamba-org/micromamba:1.5.1-focal-cuda-11.3.1
4+
FROM docker.io/python:3.12.1-slim-bookworm
5+
6+
LABEL org.opencontainers.image.authors="FedMed Demo" \
7+
org.opencontainers.image.title="FedMed Flower Server" \
8+
org.opencontainers.image.description="ChRIS plugin that launches the Flower coordinator"
9+
10+
ARG SRCDIR=/usr/local/src/fedmed-pl-server
11+
WORKDIR ${SRCDIR}
12+
13+
COPY requirements.txt .
14+
RUN --mount=type=cache,sharing=private,target=/root/.cache/pip pip install -r requirements.txt
15+
16+
COPY . .
17+
ARG extras_require=none
18+
RUN pip install .[${extras_require}] \
19+
&& cd / && rm -rf ${SRCDIR}
20+
WORKDIR /
21+
22+
EXPOSE 9091 9092 9093
23+
24+
CMD ["fedmed-pl-superlink"]

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2023 FNNDSC / BCH
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# FedMed Flower SuperLink
2+
3+
This repo contains the complete _ChRIS_ plugin that launches the Flower SuperLink for the FedMed demo. Run the commands below from inside `plugins/superlink_plugin/`. The SuperLink coordinates training, waits for a configurable number of Flower SuperNodes to connect over gRPC, and writes a JSON summary of the run and the weights file to `/outgoing`.
4+
5+
## Build
6+
```bash
7+
docker build -t fedmed/pl-superlink .
8+
```
9+
10+
## Run (example)
11+
```bash
12+
docker run --rm --name fedmed-superlink --network fedmed-net \
13+
-v $(pwd)/demo/server-in:/incoming:ro \
14+
-v $(pwd)/demo/server-out:/outgoing:rw \
15+
fedmed/pl-superlink \
16+
fedmed-pl-superlink --host 0.0.0.0 --port 9091 --rounds 1 --expected-clients 1 \
17+
/incoming /outgoing
18+
```
19+
20+
Use `docker inspect fedmed-superlink` to obtain the IPv4 address and pass it to SuperNode containers (Flower prefers literal addresses on Docker networks).

0 commit comments

Comments
 (0)