Installation
Note: This code has been written and tested on Ubuntu and should work seamlessly on any Linux-based distribution. Windows users may need to adjust some steps.
📋 Prerequisites
- Git
- Python 3.x
- pip (Python package installer)
- Miniconda (recommended for environment management)
🚀 Getting Started
Follow these steps to set up and use this repository:
- Clone the Repository
git clone https://github.com/nclabteam/FedEasy.git
-
After cloning, navigate to the cloned directory and open the terminal.
-
Ensure
pipis installed. If not, install it using:
sudo apt install python3-pip
- We will use Miniconda to create a virtual environment. Download Miniconda with: (If you already have Conda installed, skip steps 4 and 5.)
curl https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -o Miniconda3-latest-Linux-x86_64.sh
- Then install Miniconda using the command below:
bash Miniconda3-latest-Linux-x86_64.sh
- Create a new virtual environment using Conda:
conda env create -f environment.yaml
This will create a virtual environment named venv-fedeasy based on the environment.yaml file.
- Activate the virtual environment:
conda deactivate
conda activate venv-fedeasy
-
You can change the configuration as per your needs in the
config.yamlfile. -
To scale clients to a few hundred, we can run Flower in simulation mode on a single machine like this:
python main.py
or
python main.py --config /path/to/config.yaml
This script reads the configuration from the config.yaml file and starts the simulation.
The outputs will be saved in the out directory.