-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
101 lines (82 loc) · 2.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
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
SHELL := /bin/bash
BASE_PROJECTS := \
cuda-with-prereqs \
cuda-with-prereqs-and-tensorrt \
cuda-cudnn-with-prereqs \
cuda-cudnn-with-prereqs-and-tensorrt \
mini-cuda-base \
mini-cuda-with-prereqs
ESRGAN_PROJECTS := \
real-esrgan
GFPGAN_PROJECTS := \
gfpgan
STABLE_DIFFUSION_PROJECTS := \
basujindal-stable-diffusion \
compvis-stable-diffusion \
invokeai \
invokeai-xformers
TRAINER_PROJECTS := \
kohya_ss
BASE_COMPOSE := $(addsuffix -compose, $(BASE_PROJECTS))
BASE_IMAGES := $(addsuffix -images, $(BASE_PROJECTS))
ESRGAN_COMPOSE := $(addsuffix -compose, $(ESRGAN_PROJECTS))
ESRGAN_IMAGES := $(addsuffix -images, $(ESRGAN_PROJECTS))
GFPGAN_COMPOSE := $(addsuffix -compose, $(GFPGAN_PROJECTS))
GFPGAN_IMAGES := $(addsuffix -images, $(GFPGAN_PROJECTS))
STABLE_DIFFUSION_COMPOSE := $(addsuffix -compose, $(STABLE_DIFFUSION_PROJECTS))
STABLE_DIFFUSION_IMAGES := $(addsuffix -images, $(STABLE_DIFFUSION_PROJECTS))
TRAINER_COMPOSE := $(addsuffix -compose, $(TRAINER_PROJECTS))
TRAINER_IMAGES := $(addsuffix -images, $(TRAINER_PROJECTS))
ALL_COMPOSE := \
$(BASE_COMPOSE) \
$(ESRGAN_COMPOSE) \
$(GFPGAN_COMPOSE) \
$(STABLE_DIFFUSION_COMPOSE) \
$(TRAINER_COMPOSE)
ALL_IMAGES := \
$(BASE_IMAGES) \
$(ESRGAN_IMAGES) \
$(GFPGAN_IMAGES) \
$(STABLE_DIFFUSION_IMAGES) \
$(TRAINER_IMAGES)
.PHONY: all
all: all-images
# Docker compose files
.PHONY: all-compose
all-compose: $(ALL_COMPOSE)
#.PHONY: $(ALL_COMPOSE)
%-compose: %
${MAKE} -C $</ compose
# Docker images
.PHONY: all-images
all-images: $(ALL_IMAGES)
#.PHONY: $(ALL_IMAGES)
%-images: %
${MAKE} -C $</ image
# Scripts
.PHONY: script-permissions
script-permissions:
find . -name "*.sh" -exec git update-index --chmod=-x {} \;
find . \( \
-name "build.sh" \
-o \
-name "create-compose-file.sh" \
-o \
-name "create-container.sh" \
\) -exec git update-index --chmod=+x {} \;
.PHONY: clean
clean:
@find . \( \
-name .nopublish \
-o \
-name "log.*" \
\) -exec rm -v {} \;
.PHONY: veryclean
veryclean: clean
@find . \( \
-name .*.md5 \
-o \
-name .prevdigest \
-o \
-name .previd \
\) -exec rm -v {} \;