-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
101 lines (76 loc) · 2.89 KB
/
Makefile
File metadata and controls
101 lines (76 loc) · 2.89 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
PYTHON=python
PIP=pip
PROJECT_DIR=quickstart-compose
.PHONY: install test run-local lint build simulate docker-setup docker-up docker-down docker-test docker-verify docker-state docker-tls docker-certs docker-clients docker-add-clients platform platform-stop platform-logs showcase
install:
cd complete/fl && $(PIP) install -e .
test:
cd complete/fl && pytest -q
simulate:
cd complete/fl && flwr run .
run-local: simulate
lint:
cd complete/fl && python -m flake8 . && python -m black --check .
build:
cd complete/fl && python -m build
# Docker Compose commands
docker-setup:
@echo "Setting up Docker Compose environment..."
git clone --depth=1 --branch v1.22.0 https://github.com/adap/flower.git _tmp \
&& mv _tmp/framework/docker/complete . \
&& rm -rf _tmp
@echo "Creating Flower project..."
flwr new $(PROJECT_DIR) --framework PyTorch --username flower
@echo "Setting PROJECT_DIR environment variable..."
@echo "export PROJECT_DIR=$(PROJECT_DIR)" >> .env
docker-up:
@echo "Starting Docker Compose services..."
export PROJECT_DIR=$(PROJECT_DIR) && docker compose up --build -d
docker-down:
@echo "Stopping Docker Compose services..."
docker compose down
docker-test:
@echo "Testing Docker Compose setup..."
export PROJECT_DIR=$(PROJECT_DIR) && docker compose up --build -d
@echo "Waiting for services to be ready..."
sleep 30
@echo "Running Flower project..."
flwr run $(PROJECT_DIR) local-deployment --stream
@echo "Stopping services..."
docker compose down
docker-logs:
docker compose logs -f
docker-verify:
@echo "Verifying Docker Compose setup..."
./test-docker-compose.sh
docker-state:
@echo "Starting services with state persistence..."
cd complete && export PROJECT_DIR=$(PROJECT_DIR) && docker compose -f compose.yml -f with-state.yml up --build -d
docker-tls:
@echo "Starting services with TLS encryption..."
cd complete && export PROJECT_DIR=$(PROJECT_DIR) && docker compose -f compose.yml -f with-tls.yml up --build -d
docker-certs:
@echo "Generating TLS certificates..."
cd complete && docker compose -f certs.yml run --rm --build gen-certs
docker-combined:
@echo "Starting services with state persistence and TLS..."
cd complete && export PROJECT_DIR=$(PROJECT_DIR) && docker compose -f compose.yml -f with-tls.yml -f with-state.yml up --build -d
docker-clients:
@echo "Running federated learning with Docker container clients..."
./run-docker-clients.sh
docker-add-clients:
@echo "Adding more client containers to the setup..."
./add-more-clients.sh
# Platform commands
platform:
@echo "Launching complete federated learning platform with UI..."
./launch-platform.sh
platform-stop:
@echo "Stopping federated learning platform..."
cd complete && docker compose -f compose-with-ui.yml down
platform-logs:
@echo "Viewing platform logs..."
cd complete && docker compose -f compose-with-ui.yml logs -f
showcase:
@echo "Starting platform showcase..."
./showcase-platform.sh