-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathMakefile
41 lines (24 loc) · 1.13 KB
/
Makefile
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
IP_ADDR := $(shell hostname -I | awk '{print $$1}')
N_DEVICES := $(shell nvidia-smi -L | wc -l)
build_base:
docker build --no-cache -t $(NAME)_base:latest -f ../base.dockerfile .
build_service:
tar -hczvf src.tar.gz src
docker build --no-cache --build-arg NAME=$(NAME) -t $(NAME):latest -f ../service.dockerfile .
rm src.tar.gz
build_all_base:
cd services/api && make -f ../../Makefile build_base NAME=api
cd services/ray_head && make -f ../../Makefile build_base NAME=ray_head
cd services/ray_worker && make -f ../../Makefile build_base NAME=ray_worker
build_all_service:
cd services/api && make -f ../../Makefile build_service NAME=api
cd services/ray_head && make -f ../../Makefile build_service NAME=ray_head
cd services/ray_worker && make -f ../../Makefile build_service NAME=ray_worker
up:
export HOST_IP=${IP_ADDR} N_DEVICES=${N_DEVICES} && docker compose -f compose/$(word 2,$(MAKECMDGOALS))/docker-compose.yml up --detach
down:
export HOST_IP=${IP_ADDR} N_DEVICES=${N_DEVICES} && docker compose -f compose/$(word 2,$(MAKECMDGOALS))/docker-compose.yml down
ta:
make down dev
make build_all_service
make up dev