forked from mlhubber/mlmodels
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
78 lines (62 loc) · 1.8 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
########################################################################
#
# Makefile for MLHub model Archive
#
########################################################################
APP=mlmodels
VER=1.0.0
INC_BASE = .
INC_PANDOC = $(INC_BASE)/pandoc.mk
INC_GIT = $(INC_BASE)/git.mk
INC_AZURE = $(INC_BASE)/azure.mk
INC_CLEAN = $(INC_BASE)/clean.mk
define HELP
Makefile for Hub of Machine Learning Models.
Local targets:
localhub Generate and install Packages.yaml on localhost.
mlhub Generate and install Packages.yaml on mlhub.ai.
Packages.yaml Generate meta-data file for the repository.
endef
export HELP
help::
@echo "$$HELP"
ifneq ("$(wildcard $(INC_PANDOC))","")
include $(INC_PANDOC)
endif
ifneq ("$(wildcard $(INC_GIT))","")
include $(INC_GIT)
endif
ifneq ("$(wildcard $(INC_AZURE))","")
include $(INC_AZURE)
endif
ifneq ("$(wildcard $(INC_CLEAN))","")
include $(INC_CLEAN)
endif
########################################################################
# PACKAGES
########################################################################
REPO_HOST = mlhub.ai
BASE_PATH = /var/www/html
REPO_PATH = pool/main
REPO_USER = root
REPO_SSH = $(REPO_USER)@$(REPO_HOST)
DESCRIPTIONS = \
clothes-recommender-py/DESCRIPTION.yaml \
iris-r/DESCRIPTION.yaml \
movie-recommender-r/DESCRIPTION.yaml \
rain-tomorrow/DESCRIPTION.yaml
.PHONY: localhub
localhub: Packages.yaml
sudo cp $< $(BASE_PATH)/
sudo chmod -R a+rX $(BASE_PATH)/
.PHONY: mlhub
mlhub: Packages.yaml Packages.html
rsync -avzh $^ $(REPO_SSH):$(BASE_PATH)/
ssh $(REPO_SSH) chmod -R a+rX $(BASE_PATH)/
Packages.yaml: $(DESCRIPTIONS)
cat $^ > $@
Packages.rst:
echo "Pre-built machine learning models available here::\n" > $@
ml avail | grep ' : ' | sed 's/^/ /' >> $@
realclean::
rm -f Packages.html Packages.yaml Packages.rst