forked from VOICEVOX/voicevox_engine
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
200 lines (173 loc) · 7.74 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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
CMD=
NOCACHE=
ARGS:=
ifeq ($(NOCACHE),1)
ARGS:=$(ARGS) --no-cache
endif
# Ubuntu 20.04
.PHONY: build-linux-docker-ubuntu20.04
build-linux-docker-ubuntu20.04:
docker buildx build . \
-t voicevox/voicevox_engine:cpu-ubuntu20.04-latest \
--target runtime-env \
--progress plain \
--build-arg BASE_IMAGE=ubuntu:focal \
--build-arg BASE_RUNTIME_IMAGE=ubuntu:focal \
--build-arg ONNXRUNTIME_URL=https://github.com/microsoft/onnxruntime/releases/download/v1.10.0/onnxruntime-linux-x64-1.10.0.tgz \
--build-arg VOICEVOX_CORE_LIBRARY_NAME=libcore_cpu_x64.so $(ARGS)
.PHONY: run-linux-docker-ubuntu20.04
run-linux-docker-ubuntu20.04:
docker run --rm -it \
-p '127.0.0.1:50021:50021' $(ARGS) \
voicevox/voicevox_engine:cpu-ubuntu20.04-latest $(CMD)
.PHONY: build-linux-docker-nvidia-ubuntu20.04
build-linux-docker-nvidia-ubuntu20.04:
docker buildx build . \
-t voicevox/voicevox_engine:nvidia-ubuntu20.04-latest \
--target runtime-nvidia-env \
--progress plain \
--build-arg BASE_IMAGE=ubuntu:focal \
--build-arg BASE_RUNTIME_IMAGE=nvidia/cuda:11.4.2-cudnn8-runtime-ubuntu20.04 \
--build-arg ONNXRUNTIME_URL=https://github.com/microsoft/onnxruntime/releases/download/v1.10.0/onnxruntime-linux-x64-gpu-1.10.0.tgz \
--build-arg VOICEVOX_CORE_LIBRARY_NAME=libcore_gpu_x64_nvidia.so $(ARGS)
.PHONY: run-linux-docker-nvidia-ubuntu20.04
run-linux-docker-nvidia-ubuntu20.04:
docker run --rm -it \
--gpus all \
-p '127.0.0.1:50021:50021' $(ARGS) \
voicevox/voicevox_engine:nvidia-ubuntu20.04-latest $(CMD)
# Ubuntu 18.04
.PHONY: build-linux-docker-ubuntu18.04
build-linux-docker-ubuntu18.04:
docker buildx build . \
-t voicevox/voicevox_engine:cpu-ubuntu18.04-latest \
--target runtime-env \
--progress plain \
--build-arg BASE_IMAGE=ubuntu:bionic \
--build-arg BASE_RUNTIME_IMAGE=ubuntu:bionic \
--build-arg ONNXRUNTIME_URL=https://github.com/microsoft/onnxruntime/releases/download/v1.10.0/onnxruntime-linux-x64-1.10.0.tgz \
--build-arg VOICEVOX_CORE_LIBRARY_NAME=libcore_cpu_x64.so $(ARGS)
.PHONY: run-linux-docker-ubuntu18.04
run-linux-docker-ubuntu18.04:
docker run --rm -it \
-p '127.0.0.1:50021:50021' $(ARGS) \
voicevox/voicevox_engine:cpu-ubuntu18.04-latest $(CMD)
.PHONY: build-linux-docker-nvidia-ubuntu18.04
build-linux-docker-nvidia-ubuntu18.04:
docker buildx build . \
-t voicevox/voicevox_engine:nvidia-ubuntu18.04-latest \
--target runtime-nvidia-env \
--progress plain \
--build-arg BASE_IMAGE=ubuntu:bionic \
--build-arg BASE_RUNTIME_IMAGE=nvidia/cuda:11.4.2-cudnn8-runtime-ubuntu18.04 \
--build-arg ONNXRUNTIME_URL=https://github.com/microsoft/onnxruntime/releases/download/v1.10.0/onnxruntime-linux-x64-gpu-1.10.0.tgz \
--build-arg VOICEVOX_CORE_LIBRARY_NAME=libcore_gpu_x64_nvidia.so $(ARGS)
.PHONY: run-linux-docker-nvidia-ubuntu18.04
run-linux-docker-nvidia-ubuntu18.04:
docker run --rm -it \
--gpus all \
-p '127.0.0.1:50021:50021' $(ARGS) \
voicevox/voicevox_engine:nvidia-ubuntu18.04-latest $(CMD)
# VOICEVOX Core env for test
.PHONY: build-linux-docker-download-core-env-ubuntu18.04
build-linux-docker-download-core-env-ubuntu18.04:
docker buildx build . \
-t voicevox/voicevox_engine:download-core-env-ubuntu18.04 \
--target download-core-env \
--progress plain \
--build-arg BASE_IMAGE=ubuntu:bionic $(ARGS)
.PHONY: run-linux-docker-download-core-env-ubuntu18.04
run-linux-docker-download-core-env-ubuntu18.04:
docker run --rm -it $(ARGS) \
voicevox/voicevox_engine:download-core-env-ubuntu18.04 $(CMD)
# ONNX Runtime env for test
.PHONY: build-linux-docker-download-onnxruntime-env-ubuntu18.04
build-linux-docker-download-onnxruntime-env-ubuntu18.04:
docker buildx build . \
-t voicevox/voicevox_engine:download-onnxruntime-env-ubuntu18.04 \
--target download-onnxruntime-env \
--progress plain \
--build-arg BASE_IMAGE=ubuntu:bionic $(ARGS)
.PHONY: run-linux-docker-download-onnxruntime-env-ubuntu18.04
run-linux-docker-download-onnxruntime-env-ubuntu18.04:
docker run --rm -it $(ARGS) \
voicevox/voicevox_engine:download-onnxruntime-env-ubuntu18.04 $(CMD)
# Python env for test
.PHONY: build-linux-docker-compile-python-env
build-linux-docker-compile-python-env:
docker buildx build . \
-t voicevox/voicevox_engine:compile-python-env \
--target compile-python-env \
--progress plain \
--build-arg BASE_IMAGE=ubuntu:focal $(ARGS)
.PHONY: run-linux-docker-compile-python-env
run-linux-docker-compile-python-env:
docker run --rm -it $(ARGS) \
voicevox/voicevox_engine:compile-python-env $(CMD)
# Build linux binary in Docker
## Ubuntu 20.04
.PHONY: build-linux-docker-build-ubuntu20.04
build-linux-docker-build-ubuntu20.04:
docker buildx build . \
-t voicevox/voicevox_engine:build-cpu-ubuntu20.04-latest \
--target build-env \
--progress plain \
--build-arg BASE_IMAGE=ubuntu:focal \
--build-arg BASE_RUNTIME_IMAGE=ubuntu:focal \
--build-arg ONNXRUNTIME_URL=https://github.com/microsoft/onnxruntime/releases/download/v1.10.0/onnxruntime-linux-x64-1.10.0.tgz \
--build-arg VOICEVOX_CORE_LIBRARY_NAME=libcore_cpu_x64.so $(ARGS)
.PHONY: run-linux-docker-build-ubuntu20.04
run-linux-docker-build-ubuntu20.04:
docker run --rm -it \
-v "$(shell pwd)/cache/Nuitka:/home/user/.cache/Nuitka" \
-v "$(shell pwd)/build:/opt/voicevox_engine_build" $(ARGS) \
voicevox/voicevox_engine:build-cpu-ubuntu20.04-latest $(CMD)
.PHONY: build-linux-docker-build-nvidia-ubuntu20.04
build-linux-docker-build-nvidia-ubuntu20.04:
docker buildx build . \
-t voicevox/voicevox_engine:build-nvidia-ubuntu20.04-latest \
--target build-env \
--progress plain \
--build-arg BASE_IMAGE=ubuntu:focal \
--build-arg BASE_RUNTIME_IMAGE=nvidia/cuda:11.4.2-cudnn8-runtime-ubuntu20.04 \
--build-arg ONNXRUNTIME_URL=https://github.com/microsoft/onnxruntime/releases/download/v1.10.0/onnxruntime-linux-x64-gpu-1.10.0.tgz \
--build-arg VOICEVOX_CORE_LIBRARY_NAME=libcore_gpu_x64_nvidia.so $(ARGS)
.PHONY: run-linux-docker-build-nvidia-ubuntu20.04
run-linux-docker-build-nvidia-ubuntu20.04:
docker run --rm -it \
-v "$(shell pwd)/cache/Nuitka:/home/user/.cache/Nuitka" \
-v "$(shell pwd)/build:/opt/voicevox_engine_build" $(ARGS) \
voicevox/voicevox_engine:build-nvidia-ubuntu20.04-latest $(CMD)
## Ubuntu 18.04
.PHONY: build-linux-docker-build-ubuntu18.04
build-linux-docker-build-ubuntu18.04:
docker buildx build . \
-t voicevox/voicevox_engine:build-cpu-ubuntu18.04-latest \
--target build-env \
--progress plain \
--build-arg BASE_IMAGE=ubuntu:bionic \
--build-arg BASE_RUNTIME_IMAGE=ubuntu:bionic \
--build-arg ONNXRUNTIME_URL=https://github.com/microsoft/onnxruntime/releases/download/v1.10.0/onnxruntime-linux-x64-1.10.0.tgz \
--build-arg VOICEVOX_CORE_LIBRARY_NAME=libcore_cpu_x64.so $(ARGS)
.PHONY: run-linux-docker-build-ubuntu18.04
run-linux-docker-build-ubuntu18.04:
docker run --rm -it \
-v "$(shell pwd)/cache/Nuitka:/home/user/.cache/Nuitka" \
-v "$(shell pwd)/build:/opt/voicevox_engine_build" $(ARGS) \
voicevox/voicevox_engine:build-cpu-ubuntu18.04-latest $(CMD)
.PHONY: build-linux-docker-build-nvidia-ubuntu18.04
build-linux-docker-build-nvidia-ubuntu18.04:
docker buildx build . \
-t voicevox/voicevox_engine:build-nvidia-ubuntu18.04-latest \
--target build-env \
--progress plain \
--build-arg BASE_IMAGE=ubuntu:bionic \
--build-arg BASE_RUNTIME_IMAGE=nvidia/cuda:11.4.2-cudnn8-runtime-ubuntu18.04 \
--build-arg ONNXRUNTIME_URL=https://github.com/microsoft/onnxruntime/releases/download/v1.10.0/onnxruntime-linux-x64-gpu-1.10.0.tgz \
--build-arg VOICEVOX_CORE_LIBRARY_NAME=libcore_gpu_x64_nvidia.so $(ARGS)
.PHONY: run-linux-docker-build-nvidia-ubuntu18.04
run-linux-docker-build-nvidia-ubuntu18.04:
docker run --rm -it \
-v "$(shell pwd)/cache/Nuitka:/home/user/.cache/Nuitka" \
-v "$(shell pwd)/build:/opt/voicevox_engine_build" $(ARGS) \
voicevox/voicevox_engine:build-nvidia-ubuntu18.04-latest $(CMD)