forked from ifzhang/FairMOT
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
57 lines (52 loc) · 1.38 KB
/
Makefile
File metadata and controls
57 lines (52 loc) · 1.38 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
.PHONY: help
help:
@echo "make: The okay-est command line tool"
@echo
@echo "usage: make <command> [CMD_ARGS='command args']"
@echo
@echo "<command> is one of:"
@echo
@printf "%16s: %s\n" "build" "Build docker image"
@printf "%16s: %s\n" "clean" "Deletes all temporary files"
@printf "%16s: %s\n" "shell" "Run docker in interactive mode"
@echo
@echo "Additional arguments:"
@echo
@printf "\t%24s %s\n" "- CPU_ONLY to run docker without GPU support"
@echo
@echo "Examples:"
@echo
@echo " Default shell mode (ok for GCP machine with GPU)"
@echo " make shell"
@echo
@echo " Shell mode CPU only :"
@echo " make shell CPU_ONLY=1"
@echo
image_name = fairmot
shell=/bin/bash
enable_gpu = --gpus all
docker_run_args = --ipc=host
volumes = -v ${HOME}/.netrc:/root/.netrc \
-v ${HOME}/.bash_history:/root/.bash_history \
-v ${HOME}/data:/app/data \
-v $(shell pwd):/app/FairMOT
user_id = $(shell id -u)
group_id = $(shell id -g)
user_group = ${user_id}:${group_id}
run_as_user = --user ${user_group}
workdir = -w /app/FairMOT
ifeq (${CPU_ONLY}, 1)
$(info CPU ONLY)
enable_gpu =
endif
.PHONY: build
build:
@docker build --target local -t ${image_name} .
.PHONY: clean
clean:
@find . -name "*.pyc" -exec rm -f {} \;
.PHONY: shell
shell:
@docker run ${enable_gpu} \
--rm -it ${docker_run_args} ${volumes} \
${run_as_user} ${workdir} ${image_name}