-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
125 lines (92 loc) · 3.65 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
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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
# ----------------------------------------------------------------------
# Robocup@Home ROS Noetic Docker Development
# ----------------------------------------------------------------------
#: Builds a Docker image with the corresponding Dockerfile file
# ----------------------------BUILD------------------------------------
# ---------hri----------
# NOTE: if the docker container is created with a non-root user, the following command should be executed
# in the host machine to provide access (after every machine reboot):
# sudo usermod -aG audio $USER # Make sure current user has access to audio resources.
# sudo chmod 777 /dev/snd/* # Allow access to audio devices.
DISPLAY_NAME := "home-hri-display"
# No GPU
hri.build:
@./docker/scripts/build.bash --area=hri
# CUDA 11.8 x86_64
hri.build.cuda:
@./docker/scripts/build.bash --area=hri --use-cuda
# Jetson devices
hri.build.jetson:
@./docker/scripts/build.bash --area=hri --jetson-l4t=35.4.1
# Display
hri.build.display:
@./docker/scripts/build.bash --area=hri --is-display
# ----------------------------CREATE------------------------------------
hri.create:
@(if [ ! -z ${DISPLAY} ]; then xhost +; fi)
@./docker/scripts/speech.bash
@./docker/scripts/run.bash --area=hri --is-speech --volumes=$(volumes) --name=$(name)
hri.create.cuda:
@(if [ ! -z ${DISPLAY} ]; then xhost +; fi)
@./docker/scripts/speech.bash
@./docker/scripts/run.bash --area=hri --use-cuda --is-speech --volumes=$(volumes) --name=$(name)
# For jetpack version 35.4.1, jetson images are special in the sense that they are specific to the jetpack version
hri.create.jetson:
@(if [ ! -z ${DISPLAY} ]; then xhost +; fi)
@./docker/scripts/speech.bash
@./docker/scripts/run.bash --area=hri --jetson-l4t=35.4.1 --is-speech --volumes=$(volumes) --name=$(name)
hri.create.display:
@(if [ ! -z ${DISPLAY} ]; then xhost +; fi)
@./docker/scripts/run.bash --area=hri --is-display --volumes=$(volumes) --name=$(DISPLAY_NAME)
# ----------------------------START------------------------------------
# Start containers
hri.up:
@./docker/scripts/speech.bash
@(if [ ! -z ${DISPLAY} ]; then xhost +; fi)
@docker start home-hri
hri.up.jetson:
@./docker/scripts/speech.bash
@(if [ ! -z ${DISPLAY} ]; then xhost +; fi)
@docker start home-hri
hri.up.display:
@docker start $(DISPLAY_NAME)
# ----------------------------STOP------------------------------------
# Stop containers
hri.down:
@docker stop home-hri
hri.down.display:
@docker stop $(DISPLAY_NAME)
# ----------------------------RESTART------------------------------------
# Restart containers
hri.restart:
@docker restart home-hri
hri.restart.display:
@docker restart $(DISPLAY_NAME)
# ----------------------------LOGS------------------------------------
# Logs of the container
hri.logs:
@docker logs --tail 50 home-hri
hri.logs.display:
@docker logs --tail 50 $(DISPLAY_NAME)
# ----------------------------SHELL------------------------------------
# Fires up a bash session inside the container
hri.shell:
@docker exec -it --user $(shell id -u):$(shell id -g) home-hri bash
hri.shell.display:
@docker exec -it --user $(shell id -u):$(shell id -g) $(DISPLAY_NAME) bash
hri.execute.display:
@docker exec -it $(DISPLAY_NAME) npm --prefix "/workspace/display/display" run start
# ----------------------------REMOVE------------------------------------
# Remove container
hri.remove:
@docker container rm home-hri
hri.remove.display:
@docker container rm $(DISPLAY_NAME)
# ----------------------------------------------------------------------
# General Docker Utilities
#: Show a list of images.
list-images:
@docker image ls
#: Show a list of containers.
list-containers:
@docker container ls -as