Skip to content

Commit

Permalink
Add option to use cache during building
Browse files Browse the repository at this point in the history
  • Loading branch information
JMGaljaard committed May 25, 2021
1 parent e52ec88 commit c4cc602
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
13 changes: 4 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ MAINTAINER Bart Cox <[email protected]>
# Run build without interactive dialogue
ARG DEBIAN_FRONTEND=noninteractive

# Set required environmental variables for the working setup.
ENV GLOO_SOCKET_IFNAME=eth0
ENV TP_SOCKET_IFNAME=eth0

Expand All @@ -19,7 +20,9 @@ RUN apt-get update \

# Copy the current folder to the working directory
ADD setup.py requirements.txt ./
RUN python3 -m pip install -r requirements.txt

# Use cache for pip, otherwise we repeatedly pull from repository
RUN --mount=type=cache,target=/root/.cache/pip python3 -m pip install -r requirements.txt

ADD configs configs

Expand All @@ -28,13 +31,5 @@ ADD fltk fltk
# Install newest version of library
RUN python3 -m setup install



# Expose the container's port to the host OS
EXPOSE 5000

# Run command by default for the executing container
# CMD ["python3", "/opt/Generatrix/rpc_parameter_server.py", "--world_size=2", "--rank=0", "--master_addr=192.168.144.2"]

#CMD python3 /opt/federation-lab/rpc_parameter_server.py --world_size=$WORLD_SIZE --rank=$RANK --master_addr=10.5.0.11
CMD python3 /opt/federation-lab/federated_learning.py $RANK $WORLD_SIZE 10.5.0.11
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@ Pytorch Distributed ([docs](https://pytorch.org/tutorials/beginner/dist_overview
The goal if this project is to launch Federated Learning nodes in truly distribution fashion.

This project is tested with Ubuntu 20.04 and python {3.7, 3.8}.

### Building locally

To build locally, run the following command in the project root directory.

```bash
DOCKER_BUILDKIT=1 docker build . --tag fltk
```
### Global idea
Pytorch distributed works based on a world_size and ranks. The ranks should be between 0 and world_size-1.
Generally, the federator has rank 0 and the clients have ranks between 1 and world_size-1.
Expand Down

0 comments on commit c4cc602

Please sign in to comment.