forked from alibaba/GraphScope
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
191 lines (145 loc) · 5.51 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
MKFILE_PATH := $(abspath $(lastword $(MAKEFILE_LIST)))
WORKING_DIR := $(dir $(MKFILE_PATH))
GAE_DIR := $(WORKING_DIR)/analytical_engine
GIE_DIR := $(WORKING_DIR)/interactive_engine
GLE_DIR := $(WORKING_DIR)/learning_engine/graph-learn
GAE_BUILD_DIR := $(GAE_DIR)/build
GLE_BUILD_DIR := $(GLE_DIR)/cmake-build
CLIENT_DIR := $(WORKING_DIR)/python
COORDINATOR_DIR := $(WORKING_DIR)/coordinator
K8S_DIR := $(WORKING_DIR)/k8s
DOCS_DIR := $(WORKING_DIR)/docs
VERSION ?= 0.18.0
BUILD_TYPE ?= release
# GAE build options
NETWORKX ?= ON
# testing build option
BUILD_TEST ?= OFF
# build java sdk option
ENABLE_JAVA_SDK ?= ON
# INSTALL_PREFIX is environment variable, but if it is not set, then set default value
ifeq ($(INSTALL_PREFIX),)
INSTALL_PREFIX := /opt/graphscope
endif
UNAME := $(shell uname)
ifeq ($(UNAME),Linux)
NUMPROC := $(shell grep -c ^processor /proc/cpuinfo)
SUFFIX := so
endif
ifeq ($(UNAME),Darwin)
NUMPROC := $(shell sysctl -n hw.ncpu)
SUFFIX := dylib
endif
## Common
.PHONY: all graphscope install clean
# all: graphscope
# graphscope: gle client coordinator gae gie
all: gle client coordinator gae gie
graphscope: all
install: gae-install gie-install gle-install client coordinator
# client
pip3 install --user --editable $(CLIENT_DIR)
rm -rf $(CLIENT_DIR)/*.egg-info
# coordinator
pip3 install --user --editable $(COORDINATOR_DIR)
rm -rf $(COORDINATOR_DIR)/*.egg-info
echo "Run the following command to correctly set environment variable"
echo "export GRAPHSCOPE_HOME=$(INSTALL_PREFIX)"
clean:
rm -rf $(GAE_BUILD_DIR) $(GAE_DIR)/proto
cd $(GAE_DIR)/java && mvn clean
cd $(GIE_DIR) && mvn clean
# TODO: use maven clean to clean ir target
rm -rf $(GIE_DIR)/executor/ir/target
rm -rf $(GLE_BUILD_DIR) $(GLE_DIR)/proto/*.h $(GLE_DIR)/proto/*.cc
cd $(CLIENT_DIR) && python3 setup.py clean --all
cd $(COORDINATOR_DIR) && python3 setup.py clean --all
## Modules
.PHONY: client coordinator gae gie gle
client: gle
cd $(CLIENT_DIR) && \
pip3 install -r requirements.txt -r requirements-dev.txt --user && \
python3 setup.py build_ext --inplace --user
coordinator: client
cd $(COORDINATOR_DIR) && \
pip3 install -r requirements.txt -r requirements-dev.txt --user && \
python3 setup.py build_builtin
.PHONY: gae-install gie-install gle-install
gae-install: gae
mkdir -p $(INSTALL_PREFIX)
$(MAKE) -C $(GAE_BUILD_DIR) install
install $(K8S_DIR)/kube_ssh $(INSTALL_PREFIX)/bin/
install -d $(INSTALL_PREFIX)/lib/cmake/graphscope-analytical/cmake
if [ -d "${INSTALL_PREFIX}/lib64/cmake/graphscope-analytical" ]; then \
install $(INSTALL_PREFIX)/lib64/cmake/graphscope-analytical/*.cmake $(INSTALL_PREFIX)/lib/cmake/graphscope-analytical; \
install $(INSTALL_PREFIX)/lib64/cmake/graphscope-analytical/cmake/* $(INSTALL_PREFIX)/lib/cmake/graphscope-analytical/cmake; \
fi
gae: $(GAE_BUILD_DIR)/grape_engine
$(GAE_BUILD_DIR)/grape_engine:
mkdir -p $(GAE_BUILD_DIR) && \
cd $(GAE_BUILD_DIR) && \
cmake -DCMAKE_INSTALL_PREFIX=$(INSTALL_PREFIX) \
-DNETWORKX=$(NETWORKX) \
-DBUILD_TESTS=${BUILD_TEST} \
-DENABLE_JAVA_SDK=${ENABLE_JAVA_SDK} .. && \
$(MAKE) -j$(NUMPROC)
gie-install: gie
mkdir -p $(INSTALL_PREFIX)
tar -xf $(GIE_DIR)/assembly/target/graphscope.tar.gz --strip-components 1 -C $(INSTALL_PREFIX)
gie: $(GIE_DIR)/assembly/target/graphscope.tar.gz
$(GIE_DIR)/assembly/target/graphscope.tar.gz:
# frontend/executor
cd $(GIE_DIR) && \
mvn package -DskipTests -Drust.compile.mode=$(BUILD_TYPE) -P graphscope,graphscope-assembly --quiet
gle-install: gle
mkdir -p $(INSTALL_PREFIX)
$(MAKE) -C $(GLE_BUILD_DIR) install
gle: $(GLE_DIR)/built/lib/libgraphlearn_shared.$(SUFFIX)
$(GLE_DIR)/built/lib/libgraphlearn_shared.$(SUFFIX):
git submodule update --init
cd $(GLE_DIR) && git submodule update --init third_party/pybind11
mkdir -p $(GLE_BUILD_DIR)
cd $(GLE_BUILD_DIR) && \
cmake -DCMAKE_INSTALL_PREFIX=$(INSTALL_PREFIX) \
-DWITH_VINEYARD=ON \
-DTESTING=${BUILD_TEST} .. && \
$(MAKE) -j$(NUMPROC)
## wheels
.PHONY: graphscope-py3-package graphscope-client-py3-package prepare-client graphscope-docs
graphscope-py3-package:
$(MAKE) -C $(K8S_DIR) graphscope-py3-package
graphscope-client-py3-package:
$(MAKE) -C $(K8S_DIR) graphscope-client-py3-package
prepare-client:
cd $(CLIENT_DIR) && \
pip3 install -r requirements.txt --user && \
pip3 install -r requirements-dev.txt --user && \
python3 setup.py build_proto
graphscope-docs: prepare-client
$(MAKE) -C $(DOCS_DIR)/ html
## Images
.PHONY: graphscope-image jupyter-image dataset-image graphscope-store-image push
graphscope-image:
$(MAKE) -C $(K8S_DIR) graphscope-image VERSION=$(VERSION)
jupyter-image:
$(MAKE) -C $(K8S_DIR) jupyter-image VERSION=$(VERSION)
dataset-image:
$(MAKE) -C $(K8S_DIR) dataset-image VERSION=$(VERSION)
graphscope-store-image:
$(MAKE) -C $(K8S_DIR) graphscope-store-image VERSION=$(VERSION)
push:
$(MAKE) -C $(K8S_DIR) push
## Tests
.PHONY: test unittest minitest k8stest
test: unittest minitest k8stest
unittest:
cd $(CLIENT_DIR) && \
python3 -m pytest --cov=graphscope --cov-config=.coveragerc --cov-report=xml --cov-report=term -s -v ./graphscope/tests/unittest
minitest:
pip3 install tensorflow==2.5.2 "pandas<1.5.0"
cd $(CLIENT_DIR) && \
python3 -m pytest --cov=graphscope --cov-config=.coveragerc --cov-report=xml --cov-report=term -s -v ./graphscope/tests/minitest
k8stest:
pip3 install tensorflow==2.5.2 "pandas<1.5.0"
cd $(CLIENT_DIR) && \
python3 -m pytest --cov=graphscope --cov-config=.coveragerc --cov-report=xml --cov-report=term -s -v ./graphscope/tests/kubernetes