-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
51 lines (44 loc) · 1.2 KB
/
docker-compose.yml
File metadata and controls
51 lines (44 loc) · 1.2 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
# docker-compose.yml
version: '3.8'
networks:
fl-net:
driver: bridge
services:
fl-api:
build: .
container_name: fl-api-server
command: python3 scratch/main.py --port 5005
networks:
- fl-net
volumes:
- .:/app
ns3-simulation:
build: .
container_name: ns3-simulation-runner
depends_on:
- fl-api
networks:
- fl-net
environment:
- FL_API_URL=http://fl-api:5005
# Keep the container alive and interactive for the shell
stdin_open: true # Add this line
tty: true # Add this line
command: >
bash -c "
set -e;
echo 'Configuring and building ns-3 simulation in DEBUG mode...';
# IMPORTANT: Build in debug mode for GDB
./ns3 configure --build-profile=debug;
./ns3 build;
while ! curl -s http://fl-api:5005/ping > /dev/null; do
echo 'Waiting for FL API server...';
sleep 2;
done;
echo 'FL API server is responsive. Starting ns-3 simulation.';
# Run the simulation. If it fails (crashes), start a bash shell.
./ns3 run 'simulation_main' || bash;
"
volumes:
- .:/app
- ./results:/app/results