forked from alibaba/GraphScope
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
196 lines (165 loc) · 6.89 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
MKFILE_PATH := $(abspath $(lastword $(MAKEFILE_LIST)))
WORKING_DIR := $(dir $(MKFILE_PATH))
VERSION ?= 0.1.0
INSTALL_PREFIX ?= /opt/graphscope
BUILD_TYPE ?= release
# GAE build options
NETWORKX ?= ON
# testing build option
BUILD_TEST ?= OFF
# build java sdk option
ENABLE_JAVA_SDK ?= OFF
.PHONY: all
all: graphscope
.PHONY: graphscope
graphscope: install
.PHONY: gsruntime-image
gsruntime-image:
$(MAKE) -C $(WORKING_DIR)/k8s/ gsruntime-image VERSION=$(VERSION)
.PHONY: gsvineyard-image
gsvineyard-image:
$(MAKE) -C $(WORKING_DIR)/k8s/ gsvineyard-image VERSION=$(VERSION)
.PHONY: graphscope-image
graphscope-image:
$(MAKE) -C $(WORKING_DIR)/k8s/ graphscope-image VERSION=$(VERSION)
.PHONY: jupyter-image
jupyter-image:
$(MAKE) -C $(WORKING_DIR)/k8s/ jupyter-image VERSION=$(VERSION)
.PHONY: dataset-image
dataset-image:
$(MAKE) -C $(WORKING_DIR)/k8s/ dataset-image VERSION=$(VERSION)
# bulld graphscope image from source code without wheel package
.PHONY: graphscope-dev-image
graphscope-dev-image:
$(MAKE) -C $(WORKING_DIR)/k8s/ graphscope-dev-image VERSION=$(VERSION)
.PHONY: graphscope-store-image
graphscope-store-image:
$(MAKE) -C $(WORKING_DIR)/k8s/ graphscope-store-image VERSION=$(VERSION)
.PHONY: push
push:
$(MAKE) -C $(WORKING_DIR)/k8s/ push
.PHONY: install
install: gle client gae gie coordinator
.PHONY: client
client: gle
cd $(WORKING_DIR)/python && \
pip3 install -r requirements.txt -r requirements-dev.txt --user && \
python3 setup.py build_ext --inplace --user
pip3 install --user --editable $(WORKING_DIR)/python
.PHONY: coordinator
coordinator:
cd $(WORKING_DIR)/coordinator && \
pip3 install -r requirements.txt -r requirements-dev.txt --user && \
python3 setup.py build_builtin
if [ ! -d "/var/log/graphscope" ]; then \
sudo mkdir /var/log/graphscope; \
fi
sudo chown -R `id -u`:`id -g` /var/log/graphscope
.PHONY: gae
gae:
mkdir -p $(WORKING_DIR)/analytical_engine/build
cd $(WORKING_DIR)/analytical_engine/build && \
cmake -DCMAKE_INSTALL_PREFIX=$(INSTALL_PREFIX) -DNETWORKX=$(NETWORKX) -DBUILD_TESTS=${BUILD_TEST} -DENABLE_JAVA_SDK=${ENABLE_JAVA_SDK} .. && \
make -j`nproc` && \
sudo make install && \
sudo cp -r $(WORKING_DIR)/k8s/kube_ssh $(INSTALL_PREFIX)/bin/
ifneq ($(INSTALL_PREFIX), /usr/local)
sudo rm -fr /usr/local/include/graphscope && \
sudo ln -sf $(INSTALL_PREFIX)/bin/* /usr/local/bin/ && \
sudo ln -sfn $(INSTALL_PREFIX)/include/graphscope /usr/local/include/graphscope && \
sudo ln -sf ${INSTALL_PREFIX}/lib/*so* /usr/local/lib && \
sudo ln -sf ${INSTALL_PREFIX}/lib/*dylib* /usr/local/lib && \
if [ -d "${INSTALL_PREFIX}/lib64/cmake/graphscope-analytical" ]; then \
sudo rm -fr /usr/local/lib64/cmake/graphscope-analytical; \
sudo ln -sfn ${INSTALL_PREFIX}/lib64/cmake/graphscope-analytical /usr/local/lib64/cmake/graphscope-analytical; \
sudo mkdir -p ${INSTALL_PREFIX}/lib/cmake; \
sudo cp -r ${INSTALL_PREFIX}/lib64/cmake/* ${INSTALL_PREFIX}/lib/cmake/; \
else \
sudo ln -sfn ${INSTALL_PREFIX}/lib/cmake/graphscope-analytical /usr/local/lib/cmake/graphscope-analytical; \
fi
endif
ifeq (${ENABLE_JAVA_SDK}, ON)
cd $(WORKING_DIR)/analytical_engine/java && \
mvn clean install -DskipTests --quiet && \
sudo cp ${WORKING_DIR}/analytical_engine/java/grape-runtime/target/native/libgrape-jni.so ${INSTALL_PREFIX}/lib/ && \
sudo cp ${WORKING_DIR}/analytical_engine/java/grape-runtime/target/grape-runtime-0.1-shaded.jar ${INSTALL_PREFIX}/lib/ && \
sudo mkdir -p ${INSTALL_PREFIX}/conf/ && \
sudo cp ${WORKING_DIR}/analytical_engine/java/grape_jvm_opts ${INSTALL_PREFIX}/conf/
endif
.PHONY: gie
gie:
# coordinator/frontend/graphmanager
cd $(WORKING_DIR)/interactive_engine && \
mvn clean package -DskipTests -Pjava-release --quiet
# executor
cd $(WORKING_DIR)/interactive_engine/executor && \
rustup component add rustfmt && \
if [ x"release" = x"${BUILD_TYPE}" ]; then \
cargo build --workspace --release; \
else \
cargo build --workspace; \
fi
# install
mkdir -p $(WORKING_DIR)/.install_prefix && \
tar -xf $(WORKING_DIR)/interactive_engine/assembly/target/maxgraph-assembly-0.0.1-SNAPSHOT.tar.gz --strip-components 1 -C $(WORKING_DIR)/.install_prefix && \
cp $(WORKING_DIR)/interactive_engine/executor/target/$(BUILD_TYPE)/executor $(WORKING_DIR)/.install_prefix/bin/executor && \
cp $(WORKING_DIR)/interactive_engine/executor/target/$(BUILD_TYPE)/gaia_executor $(WORKING_DIR)/.install_prefix/bin/gaia_executor && \
sudo cp -r $(WORKING_DIR)/.install_prefix/* $(INSTALL_PREFIX) && \
rm -fr $(WORKING_DIR)/.install_prefix
.PHONY: gle
gle:
cd ${WORKING_DIR} && \
git submodule update --init && \
cd $(WORKING_DIR)/learning_engine/graph-learn && \
git submodule update --init third_party/pybind11 && \
mkdir -p cmake-build && cd cmake-build && \
cmake -DCMAKE_INSTALL_PREFIX=$(INSTALL_PREFIX) -DWITH_VINEYARD=ON -DTESTING=${BUILD_TEST} .. && \
make -j`nproc` && \
sudo make install
ifneq ($(INSTALL_PREFIX), /usr/local)
sudo ln -sf ${INSTALL_PREFIX}/lib/*so* /usr/local/lib && \
sudo ln -sf ${INSTALL_PREFIX}/lib/*dylib* /usr/local/lib
endif
# wheels
.PHONY: graphscope-py3-package
graphscope-py3-package:
$(MAKE) -C $(WORKING_DIR)/k8s/ graphscope-py3-package
.PHONY: graphscope-client-py3-package
graphscope-client-py3-package:
$(MAKE) -C $(WORKING_DIR)/k8s/ graphscope-client-py3-package
.PHONY: prepare-client
prepare-client:
cd $(WORKING_DIR)/python && \
pip3 install -r requirements.txt --user && \
pip3 install -r requirements-dev.txt --user && \
python3 setup.py build_proto
.PHONY: graphscope-docs
graphscope-docs: prepare-client
$(MAKE) -C $(WORKING_DIR)/docs/ html
.PHONY: test
test: unittest minitest k8stest
.PHONY: unittest
unittest:
cd $(WORKING_DIR)/python && \
python3 -m pytest --cov=graphscope --cov-config=.coveragerc --cov-report=xml --cov-report=term -s -v ./graphscope/tests/unittest
.PHONY: minitest
minitest:
cd $(WORKING_DIR)/python && \
pip3 install tensorflow==2.5.2 && \
python3 -m pytest --cov=graphscope --cov-config=.coveragerc --cov-report=xml --cov-report=term -s -v ./graphscope/tests/minitest
.PHONY: k8stest
k8stest:
cd $(WORKING_DIR)/python && \
pip3 install tensorflow==2.5.2 && \
python3 -m pytest --cov=graphscope --cov-config=.coveragerc --cov-report=xml --cov-report=term -s -v ./graphscope/tests/kubernetes
.PHONY: clean
clean:
rm -fr $(WORKING_DIR)/analytical_engine/build/ || true && \
rm -fr $(WORKING_DIR)/analytical_engine/proto/ || true && \
rm -fr $(WORKING_DIR)/learning_engine/graph-learn/cmake-build/ || true && \
rm -fr $(WORKING_DIR)/learning_engine/graph-learn/proto/*.h || true && \
rm -fr $(WORKING_DIR)/learning_engine/graph-learn/proto/*.cc || true && \
rm -fr $(WORKING_DIR)/interactive_engine/executor/target || true && \
rm -fr $(WORKING_DIR)/interactive_engine/assembly/target || true && \
cd $(WORKING_DIR)/python && python3 setup.py clean --all && \
cd $(WORKING_DIR)/coordinator && python3 setup.py clean --all