This guide will help you set up and run your first federated learning experiment with synthetically generated datasets and simulated partcipants and server.
- Table of Contents
- What You'll Learn
- Architecture Overview
- Prerequisites
- Quick Setup
- Understanding the Components
- Accessing the Platform
- Next Steps
- Troubleshooting
By following this guide, you will:
- Set up a complete federated learning environment with 1 server and 2 simulated bank clients
- Understand the key components of the AIKYA platform
- Learn how to access and interact with the federated learning system
- Be ready to run your first federated learning experiments
AIKYA implements a federated learning architecture with the following key components:
- FL Server Orchestrator: Coordinates the federated learning process
- FL Server Aggregator: Combines model updates from clients using algorithms like FedAvg
- FL Server Database: Stores orchestration data and aggregation results
- Client Orchestrator: Manages local federated learning operations
- Client Agent: Handles model training and local computations
- Client Data Processor: Manages data preparation and feature engineering
- Client Database: Stores local training data and model artifacts
- Client UI: Bank-specific interface for data management and monitoring
- CPU: Minimum quad-core processor (ARM or x64 architecture)
- Memory: Minimum 8GB RAM (16GB recommended for better performance)
- Storage: At least 10GB free disk space
- Operating System:
- macOS with Zsh terminal
- Linux with Bash terminal
- Windows with WSL2 or Git Bash
-
Docker Desktop
- Although it is strongly recommended that you use a Docker Desktop version released in the last 6 months, ensure that you have a minimum
docker composeversion of2.17.0or higher and adockerAPI version of at least1.42. You can check the docker version by running:# find docker compose version docker compose version # find docker version docker version --format "Client API Version: {{.Client.APIVersion}} || Server Version: {{.Server.Version}}"
- The instructions here should work with Docker Desktop version
4.44.1and up.
- Although it is strongly recommended that you use a Docker Desktop version released in the last 6 months, ensure that you have a minimum
-
Terminal Access
- macOS: Built-in Terminal with Zsh
- Linux: Bash terminal
- Windows: WSL2 or Git Bash
Ensure Docker is running before proceeding. You can verify this by running:
docker run hello-world
To get started, clone the AIKYA repository and navigate to the build directory:
# First clone the AIKYA repository if you haven't already
git clone https://github.com/onyx-incubator/aikya-oss.git
# Navigate to the AIKYA build directory
cd aikya-oss/build-and-run
# OPTIONAL: Set Docker BuildKit progress to plain for cleaner output
export BUILDKIT_PROGRESS=plainFor the best experience, start with a clean Docker environment:
CAUTION: This will remove ALL Docker resources on your machine Skip this step if you have other important Docker containers/images
docker volume prune -af && docker network prune -f && docker system prune -afLaunch the server components that will coordinate the federated learning process:
docker compose -f compose-server.yml --env-file env-vars/server.vars.env up -d --buildThis command will:
- Build Docker images for all server components
- Start the server orchestrator (port
9000) - Start the server aggregator (port
9001) - Start the server database (port
3310)
Launch bank nodes that will participate in federated learning using the following commands
docker compose -f compose-client.yml --env-file env-vars/bank1.vars.env up -d --builddocker compose -f compose-client.yml --env-file env-vars/bank2.vars.env up -d --buildEach bank client includes:
- Client orchestrator (Bank1: port
8080, Bank2: port8081) - Client agent (Bank1: port
17000, Bank2: port17002) - Client data processor (Bank1: port
17001, Bank2: port17003) - Client database (Bank1: port
3306, Bank2: port3307) - Client web UI (Bank1: port
3000, Bank2: port3001)
Check that all containers are running successfully:
# List all running AIKYA containers with detailed information
docker container ls --no-trunc -f "name=aikya" \
--format "=== Container: '{{.Names}}' ===\n\n \
ID: '{{.ID}}'\n \
Image: '{{.Image}}'\n \
Status: '{{.Status}}'\n \
Ports: '{{.Ports}}'\n \
Networks: '{{.Networks}}'\n"You should see approximately 11 containers running:
- 4 server containers (aikya-fl-server-*)
- 7 client containers (aikya-client-bank1-, aikya-client-bank2-)
| Component | Purpose | Port | Access URL |
|---|---|---|---|
| Server Orchestrator | Coordinates FL process across clients | 9000 | http://localhost:9000 |
| Server Aggregator | Performs model aggregation (FedAvg, etc.) | 9001 | Internal Only |
| Server Database | Stores orchestration and aggregation data | 3310 | Internal only |
| Component | Purpose | Port | Access URL |
|---|---|---|---|
| Client Orchestrator | Manages local FL operations | 8080 | http://localhost:8080 |
| Client Agent | Handles model training | 17000 | Internal API |
| Client Data Processor | Manages data preparation | 17001 | Internal API |
| Client Database | Stores local training data | 3306 | Internal only |
| Client UI | Bank 1 web interface | 3000 | http://localhost:3000 |
| Component | Purpose | Port | Access URL |
|---|---|---|---|
| Client Orchestrator | Manages local FL operations | 8081 | http://localhost:8081 |
| Client Agent | Handles model training | 17002 | Internal API |
| Client Data Processor | Manages data preparation | 17003 | Internal API |
| Client Database | Stores local training data | 3307 | Internal only |
| Client UI | Bank 2 web interface | 3001 | http://localhost:3001 |
Once all containers are running, you can access the different interfaces:
- URL: http://localhost:3000
- Use this to: Manage Bank 1's local data, monitor training progress, view local model performance
- URL: http://localhost:3001
- Use this to: Manage Bank 2's local data, monitor training progress, view local model performance
Now that your AIKYA federated learning environment is running, you can:
- Load Sample Data: Use the client UIs to load sample datasets for credit card fraud detection or payment fraud
- Configure Experiments: Set up federated learning experiments with different algorithms (FedAvg, FedProx, etc.)
- Run Training: Start federated learning rounds and monitor the training progress
- Analyze Results: Review model performance and aggregation results through the web dashboards
For detailed experiment instructions, see the run-experiment.md guide.
# If containers fail to start, check Docker logs
docker compose -f compose-server.yml logs
# For specific container logs
docker logs <container-name>🔌 Port Conflicts If you get port binding errors, ensure no other services are using the required ports:
# Check what's using specific ports
lsof -i :3000 # or other port numbers
netstat -tulpn | grep :3000💾 Memory Issues If builds fail due to memory constraints:
- Close other applications to free up RAM
- Increase Docker Desktop memory allocation (Settings > Resources > Memory)
- Consider building components one at a time instead of all at once
🔄 Build Issues If Docker builds fail:
# Try rebuilding without cache
docker compose -f compose-server.yml build --no-cache🌐 Network Issues If services can't communicate:
# Verify Docker networks
docker network ls
docker network inspect aikya-fl-server-netIf you encounter issues:
- Check the container logs for specific error messages
- Ensure all prerequisites are installed correctly
- Verify Docker Desktop is running and has sufficient resources
- Consult the project documentation for advanced configuration options
To stop all AIKYA services:
# Stop all services gracefully
docker compose -f compose-server.yml down
docker compose -f compose-client.yml --env-file env-vars/bank1.vars.env down
docker compose -f compose-client.yml --env-file env-vars/bank2.vars.env down