Skip to content

phrp720/flower-testbed

Repository files navigation

Flower Testbed

A Testbed Experiment Platform for testing Flower federated learning algorithms.

docker build package release Latest release

📑 Table of Contents

About

Flower Testbed is an open-source platform for experimenting with federated learning algorithms using the Flower framework. It provides a comprehensive environment for testing, monitoring, and managing federated learning experiments across different computational resources.

Key Capabilities

  • Algorithm Management: Upload and test custom FL algorithms
  • Model Tracking: Export model states at each federated round
  • Metrics Monitoring: Real-time tracking of training metrics
  • Multi-Framework Support: PyTorch, TensorFlow, sklearn, JAX, and more
  • Resource Flexibility: CPU/GPU support with configurable client resources

Getting Started

Installation

Development Setup

Prerequisites
  • Node.js 20+
  • pnpm
  • Docker & Docker Compose
  • Python 3.9+ (for Flower experiments)

Steps:

  1. Clone the repository

    git clone https://github.com/phrp720/flower-testbed.git
    cd flower-testbed
  2. Install dependencies

    pnpm deps
  3. Copy environment configuration

    cp .env.example .env
  4. Start PostgreSQL database

    docker compose -f deployments/development/docker-compose.yml up -d
  5. Push database schema

    pnpm db:push
  6. Start the development server

    pnpm dev
  7. Open the dashboard

    Navigate to http://localhost:3000/ in your web browser.

    The default credentials are admin:admin

Production Setup

  1. For each release, a deployment.zip file is provided.You can find it in the Releases

    This archive contains everything required to deploy the application, including:

    • The Flower application
    • PostgreSQL
    • A .env.example example file for configuration
  2. Download and unzip the deployment.zip file.

  3. Open the .env.example file, update the configuration values as needed and rename it to .env.

  4. Start the application using Docker Compose:

    docker compose up -d

Usage

Creating an Experiment

  1. Select Framework: Choose your ML framework (PyTorch, TensorFlow, etc.)

  2. Upload Files:

    • Algorithm (required): Your FL strategy implementation (.py)
    • Model (optional): Pre-trained model checkpoint (.pt, .pth)
    • Config (optional): Training configuration (.py, .json, .yaml)
    • Dataset (optional): Custom dataset implementation (.py, .csv)
  3. Configure Parameters:

    • Number of clients
    • Number of rounds
    • Client fraction (% of clients per round)
    • Local epochs
    • Learning rate
  4. Start Experiment: Click "Start Experiment" to begin

Tip

You can download templates for Algorithm, Config,Strategy and Dataset files to get started quickly.

Note

The application supports only Pytorch for now. Support for TensorFlow is coming soon.

Contributing

This is a research project. Contributions, issues, and feature requests are welcome!

License

This project is licensed under the MIT license.

See LICENSE for more information.