forked from instadeepai/Mava
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
executable file
·50 lines (39 loc) · 1.26 KB
/
Makefile
File metadata and controls
executable file
·50 lines (39 loc) · 1.26 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
# Check if GPU is available
NVCC_RESULT := $(shell which nvcc 2> NULL)
NVCC_TEST := $(notdir $(NVCC_RESULT))
ifeq ($(NVCC_TEST),nvcc)
GPUS=--gpus all
else
GPUS=
endif
# Set flag for docker run command
BASE_FLAGS=-it --rm -v $(PWD):/home/app/mava -w /home/app/mava
RUN_FLAGS=$(GPUS) $(BASE_FLAGS)
IMAGE=mava:latest
RUN_FLAGS_TENSORBOARD=$(GPUS) -p 6006:6006 $(BASE_FLAGS)
DOCKER_RUN=docker run $(RUN_FLAGS) $(IMAGE)
DOCKER_RUN_TENSORBOARD=docker run $(RUN_FLAGS_TENSORBOARD) $(IMAGE)
# Set example to run when using `make run`
# Default example
EXAMPLE=examples/debugging/simple_spread/feedforward/decentralised/run_maddpg.py
# make file commands
run:
$(DOCKER_RUN) python $(EXAMPLE) --base_dir /home/app/mava/logs/
bash:
$(DOCKER_RUN) bash
run-tensorboard:
$(DOCKER_RUN_TENSORBOARD) /bin/bash -c " tensorboard --bind_all --logdir /home/app/mava/logs/ & python $(EXAMPLE) --base_dir /home/app/mava/logs/; "
record:
$(DOCKER_RUN) /bin/bash -c "./startup.sh ; python $(MADDPG_RECORD) --base_dir /home/app/mava/logs/ "
build:
docker build --tag $(IMAGE) .
build_robocup:
docker build --tag $(IMAGE) -f ./Dockerfile.robocup .
build_sc2:
docker build --tag $(IMAGE) -f ./Dockerfile.sc2 .
push:
docker login
-docker push $(IMAGE)
docker logout
pull:
docker pull $(IMAGE)