gsctl 0.29.0a20250114__py2.py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
Files changed (117) hide show
  1. graphscope/flex/rest/__init__.py +106 -0
  2. graphscope/flex/rest/api/__init__.py +12 -0
  3. graphscope/flex/rest/api/alert_api.py +2790 -0
  4. graphscope/flex/rest/api/data_source_api.py +1177 -0
  5. graphscope/flex/rest/api/deployment_api.py +1323 -0
  6. graphscope/flex/rest/api/graph_api.py +2813 -0
  7. graphscope/flex/rest/api/job_api.py +1408 -0
  8. graphscope/flex/rest/api/service_api.py +1316 -0
  9. graphscope/flex/rest/api/stored_procedure_api.py +1454 -0
  10. graphscope/flex/rest/api/utils_api.py +310 -0
  11. graphscope/flex/rest/api_client.py +789 -0
  12. graphscope/flex/rest/api_response.py +21 -0
  13. graphscope/flex/rest/configuration.py +451 -0
  14. graphscope/flex/rest/exceptions.py +200 -0
  15. graphscope/flex/rest/models/__init__.py +82 -0
  16. graphscope/flex/rest/models/base_edge_type.py +102 -0
  17. graphscope/flex/rest/models/base_edge_type_vertex_type_pair_relations_inner.py +108 -0
  18. graphscope/flex/rest/models/base_edge_type_vertex_type_pair_relations_inner_x_csr_params.py +98 -0
  19. graphscope/flex/rest/models/base_property_meta.py +105 -0
  20. graphscope/flex/rest/models/base_vertex_type.py +96 -0
  21. graphscope/flex/rest/models/base_vertex_type_x_csr_params.py +88 -0
  22. graphscope/flex/rest/models/column_mapping.py +94 -0
  23. graphscope/flex/rest/models/column_mapping_column.py +90 -0
  24. graphscope/flex/rest/models/create_alert_receiver_request.py +103 -0
  25. graphscope/flex/rest/models/create_alert_rule_request.py +112 -0
  26. graphscope/flex/rest/models/create_dataloading_job_response.py +88 -0
  27. graphscope/flex/rest/models/create_edge_type.py +114 -0
  28. graphscope/flex/rest/models/create_graph_request.py +106 -0
  29. graphscope/flex/rest/models/create_graph_response.py +88 -0
  30. graphscope/flex/rest/models/create_graph_schema_request.py +106 -0
  31. graphscope/flex/rest/models/create_property_meta.py +105 -0
  32. graphscope/flex/rest/models/create_stored_proc_request.py +101 -0
  33. graphscope/flex/rest/models/create_stored_proc_response.py +88 -0
  34. graphscope/flex/rest/models/create_vertex_type.py +108 -0
  35. graphscope/flex/rest/models/dataloading_job_config.py +136 -0
  36. graphscope/flex/rest/models/dataloading_job_config_edges_inner.py +92 -0
  37. graphscope/flex/rest/models/dataloading_job_config_loading_config.py +104 -0
  38. graphscope/flex/rest/models/dataloading_job_config_loading_config_format.py +90 -0
  39. graphscope/flex/rest/models/dataloading_job_config_vertices_inner.py +88 -0
  40. graphscope/flex/rest/models/dataloading_mr_job_config.py +88 -0
  41. graphscope/flex/rest/models/date_type.py +88 -0
  42. graphscope/flex/rest/models/edge_mapping.py +122 -0
  43. graphscope/flex/rest/models/edge_mapping_type_triplet.py +92 -0
  44. graphscope/flex/rest/models/error.py +90 -0
  45. graphscope/flex/rest/models/get_alert_message_response.py +123 -0
  46. graphscope/flex/rest/models/get_alert_receiver_response.py +107 -0
  47. graphscope/flex/rest/models/get_alert_rule_response.py +114 -0
  48. graphscope/flex/rest/models/get_edge_type.py +116 -0
  49. graphscope/flex/rest/models/get_graph_response.py +139 -0
  50. graphscope/flex/rest/models/get_graph_schema_response.py +106 -0
  51. graphscope/flex/rest/models/get_pod_log_response.py +88 -0
  52. graphscope/flex/rest/models/get_property_meta.py +107 -0
  53. graphscope/flex/rest/models/get_resource_usage_response.py +105 -0
  54. graphscope/flex/rest/models/get_storage_usage_response.py +88 -0
  55. graphscope/flex/rest/models/get_stored_proc_response.py +130 -0
  56. graphscope/flex/rest/models/get_vertex_type.py +110 -0
  57. graphscope/flex/rest/models/gs_data_type.py +152 -0
  58. graphscope/flex/rest/models/job_status.py +107 -0
  59. graphscope/flex/rest/models/long_text.py +93 -0
  60. graphscope/flex/rest/models/node_status.py +94 -0
  61. graphscope/flex/rest/models/parameter.py +96 -0
  62. graphscope/flex/rest/models/pod_status.py +108 -0
  63. graphscope/flex/rest/models/primitive_type.py +95 -0
  64. graphscope/flex/rest/models/resource_usage.py +92 -0
  65. graphscope/flex/rest/models/running_deployment_info.py +128 -0
  66. graphscope/flex/rest/models/running_deployment_status.py +124 -0
  67. graphscope/flex/rest/models/schema_mapping.py +106 -0
  68. graphscope/flex/rest/models/service_status.py +112 -0
  69. graphscope/flex/rest/models/service_status_sdk_endpoints.py +94 -0
  70. graphscope/flex/rest/models/start_service_request.py +88 -0
  71. graphscope/flex/rest/models/stored_procedure_meta.py +126 -0
  72. graphscope/flex/rest/models/string_type.py +92 -0
  73. graphscope/flex/rest/models/string_type_string.py +124 -0
  74. graphscope/flex/rest/models/temporal_type.py +92 -0
  75. graphscope/flex/rest/models/temporal_type_temporal.py +138 -0
  76. graphscope/flex/rest/models/time_stamp_type.py +88 -0
  77. graphscope/flex/rest/models/update_alert_message_status_request.py +97 -0
  78. graphscope/flex/rest/models/update_stored_proc_request.py +88 -0
  79. graphscope/flex/rest/models/upload_file_response.py +90 -0
  80. graphscope/flex/rest/models/vertex_mapping.py +100 -0
  81. graphscope/flex/rest/py.typed +0 -0
  82. graphscope/flex/rest/rest.py +258 -0
  83. graphscope/gsctl/V6D_VERSION +1 -0
  84. graphscope/gsctl/VERSION +1 -0
  85. graphscope/gsctl/__init__.py +22 -0
  86. graphscope/gsctl/commands/__init__.py +148 -0
  87. graphscope/gsctl/commands/common.py +200 -0
  88. graphscope/gsctl/commands/dev.py +448 -0
  89. graphscope/gsctl/commands/insight/__init__.py +17 -0
  90. graphscope/gsctl/commands/insight/glob.py +234 -0
  91. graphscope/gsctl/commands/insight/graph.py +205 -0
  92. graphscope/gsctl/commands/interactive/__init__.py +17 -0
  93. graphscope/gsctl/commands/interactive/glob.py +280 -0
  94. graphscope/gsctl/commands/interactive/graph.py +259 -0
  95. graphscope/gsctl/config.py +221 -0
  96. graphscope/gsctl/gsctl.py +51 -0
  97. graphscope/gsctl/impl/__init__.py +64 -0
  98. graphscope/gsctl/impl/alert.py +135 -0
  99. graphscope/gsctl/impl/common.py +53 -0
  100. graphscope/gsctl/impl/datasource.py +80 -0
  101. graphscope/gsctl/impl/deployment.py +62 -0
  102. graphscope/gsctl/impl/graph.py +150 -0
  103. graphscope/gsctl/impl/job.py +63 -0
  104. graphscope/gsctl/impl/service.py +62 -0
  105. graphscope/gsctl/impl/stored_procedure.py +92 -0
  106. graphscope/gsctl/impl/utils.py +38 -0
  107. graphscope/gsctl/scripts/install_deps.sh +969 -0
  108. graphscope/gsctl/tests/__init__.py +17 -0
  109. graphscope/gsctl/tests/test_graphscope_insight.py +401 -0
  110. graphscope/gsctl/tests/test_interactive.py +516 -0
  111. graphscope/gsctl/utils.py +337 -0
  112. graphscope/gsctl/version.py +31 -0
  113. gsctl-0.29.0a20250114.dist-info/METADATA +20 -0
  114. gsctl-0.29.0a20250114.dist-info/RECORD +117 -0
  115. gsctl-0.29.0a20250114.dist-info/WHEEL +6 -0
  116. gsctl-0.29.0a20250114.dist-info/entry_points.txt +3 -0
  117. gsctl-0.29.0a20250114.dist-info/top_level.txt +1 -0
@@ -0,0 +1,969 @@
1
+ #!/bin/bash
2
+ set -e
3
+
4
+ # blue
5
+ info() {
6
+ printf "\e[34m%b\e[0m\n" "$*"
7
+ }
8
+
9
+ # red
10
+ err() {
11
+ printf "\e[31m%b\e[0m\n" "$*"
12
+ }
13
+
14
+ # yellow
15
+ warning() {
16
+ printf "\e[1;33m%b\e[0m\n" "$*"
17
+ }
18
+
19
+ # red
20
+ debug() {
21
+ printf "\e[31m%b\e[0m\n" "[DEBUG] $*"
22
+ }
23
+
24
+ get_os_version() {
25
+ if [ -f /etc/centos-release ]; then
26
+ # Older Red Hat, CentOS, Alibaba Cloud Linux etc.
27
+ PLATFORM=CentOS
28
+ OS_VERSION=$(sed 's/.* \([0-9]\).*/\1/' < /etc/centos-release)
29
+ if grep -q "Alibaba Cloud Linux" /etc/centos-release; then
30
+ PLATFORM="Aliyun_based_on_CentOS"
31
+ OS_VERSION=$(rpm -E %{rhel})
32
+ fi
33
+ elif [ -f /etc/os-release ]; then
34
+ # freedesktop.org and systemd
35
+ . /etc/os-release
36
+ PLATFORM="${NAME}"
37
+ OS_VERSION="${VERSION_ID}"
38
+ elif type lsb_release >/dev/null 2>&1; then
39
+ # linuxbase.org
40
+ PLATFORM=$(lsb_release -si)
41
+ OS_VERSION=$(lsb_release -sr)
42
+ elif [ -f /etc/lsb-release ]; then
43
+ # For some versions of Debian/Ubuntu without lsb_release command
44
+ . /etc/lsb-release
45
+ PLATFORM="${DISTRIB_ID}"
46
+ OS_VERSION="${DISTRIB_RELEASE}"
47
+ elif [ -f /etc/debian_version ]; then
48
+ # Older Debian/Ubuntu/etc.
49
+ PLATFORM=Debian
50
+ OS_VERSION=$(cat /etc/debian_version)
51
+ else
52
+ # Fall back to uname, e.g. "Linux <version>", also works for BSD, Darwin, etc.
53
+ PLATFORM=$(uname -s)
54
+ OS_VERSION=$(uname -r)
55
+ fi
56
+ if [[ "${PLATFORM}" != *"Ubuntu"* && "${PLATFORM}" != *"CentOS"* && "${PLATFORM}" != *"Darwin"* && "${PLATFORM}" != *"Aliyun"* ]];then
57
+ err "Only support on Ubuntu/CentOS/macOS/AliyunOS platform."
58
+ exit 1
59
+ fi
60
+ if [[ "${PLATFORM}" == *"Ubuntu"* && "${OS_VERSION:0:2}" -lt "20" ]]; then
61
+ err "Ubuntu ${OS_VERSION} found, requires 20 or greater."
62
+ exit 1
63
+ fi
64
+ if [[ "${PLATFORM}" == *"CentOS"* && "${OS_VERSION}" -lt "7" ]]; then
65
+ err "CentOS ${OS_VERSION} found, requires 8 or greater."
66
+ exit 1
67
+ fi
68
+ if [[ "${PLATFORM}" == *"Darwin"* ]]; then
69
+ export HOMEBREW_NO_INSTALL_CLEANUP=1
70
+ export HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1
71
+ fi
72
+ echo "$PLATFORM-$OS_VERSION"
73
+ }
74
+
75
+ # default values
76
+ readonly OS=$(get_os_version)
77
+ readonly OS_PLATFORM=${OS%-*}
78
+ readonly OS_VERSION=${OS#*-}
79
+ readonly ARCH=$(uname -m)
80
+ readonly OUTPUT_ENV_FILE="${HOME}/.graphscope_env"
81
+ if [[ "${OS_PLATFORM}" == *"Darwin"* ]]; then
82
+ readonly HOMEBREW_PREFIX=$(brew --prefix)
83
+ fi
84
+ readonly ARROW_VERSION="15.0.2"
85
+ readonly MPI_PREFIX="/opt/openmpi" # fixed, related to coordinator/setup.py
86
+ readonly V6D_PREFIX="/opt/vineyard" # fixed, related to coordinator/setup.py
87
+ readonly tempdir="/tmp/gs-local-deps"
88
+ v6d_version="main"
89
+ no_v6d=false
90
+ for_analytical=false
91
+ for_analytical_java=false
92
+ for_interactive=false
93
+ for_learning=false
94
+ cn_flag=false
95
+ debug_flag=false
96
+ install_prefix="/opt/graphscope"
97
+
98
+ # parse args
99
+ while (( "$#" )); do
100
+ case "$1" in
101
+ dev)
102
+ for_analytical=true
103
+ for_analytical_java=true
104
+ for_interactive=true
105
+ for_learning=true
106
+ shift
107
+ ;;
108
+ dev-analytical)
109
+ for_analytical=true
110
+ shift
111
+ ;;
112
+ dev-analytical-java)
113
+ for_analytical=true
114
+ for_analytical_java=true
115
+ shift
116
+ ;;
117
+ dev-interactive)
118
+ for_interactive=true
119
+ shift
120
+ ;;
121
+ dev-learning)
122
+ for_learning=true
123
+ shift
124
+ ;;
125
+ --install-prefix)
126
+ install_prefix="$2"
127
+ shift 2
128
+ ;;
129
+ --v6d-version)
130
+ v6d_version="$2"
131
+ shift 2
132
+ ;;
133
+ --no-v6d)
134
+ no_v6d=true
135
+ shift
136
+ ;;
137
+ --cn)
138
+ cn_flag=true
139
+ shift
140
+ ;;
141
+ --debug)
142
+ debug_flag=true
143
+ shift
144
+ ;;
145
+ *)
146
+ shift
147
+ ;;
148
+ esac
149
+ done
150
+
151
+ if [[ ${for_analytical} == false && ${for_interactive} == false && ${for_learning} == false ]]; then
152
+ usage="Usage: ${0} dev/dev-analytical/dev-analytical-java/dev-interactive/dev-learning"
153
+ usage="${usage} [--cn] [--v6d-version <version>] [--install-prefix <path>] [--no-v6d] [--debug]"
154
+ err "${usage}"
155
+ exit 0
156
+ fi
157
+
158
+ if [[ ${debug_flag} == true ]]; then
159
+ debug "OS: ${OS}, OS_PLATFORM: ${OS_PLATFORM}, OS_VERSION: ${OS_VERSION}"
160
+ debug "install dependencies for analytical=${for_analytical}, analytical-java=${for_analytical_java}, v6d_version=${v6d_version}, no_v6d=${no_v6d}"
161
+ debug "install dependencies for interactive=${for_interactive}, learning=${for_learning}"
162
+ debug "install prefix: ${install_prefix}"
163
+ fi
164
+
165
+ # sudo
166
+ SUDO=sudo
167
+ if [[ $(id -u) -eq 0 ]]; then
168
+ SUDO=""
169
+ fi
170
+
171
+ # speed up
172
+ if [ "${cn_flag}" == true ]; then
173
+ export HOMEBREW_BREW_GIT_REMOTE="https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git"
174
+ export HOMEBREW_CORE_GIT_REMOTE="https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git"
175
+ export HOMEBREW_BOTTLE_DOMAIN="https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles"
176
+ fi
177
+
178
+ # install functions
179
+ init_workspace_and_env() {
180
+ info "creating directory: ${install_prefix} ${tempdir} ${V6D_PREFIX}"
181
+ ${SUDO} mkdir -p ${install_prefix} ${tempdir} ${V6D_PREFIX}
182
+ ${SUDO} chown -R $(id -u):$(id -g) ${install_prefix} ${tempdir} ${V6D_PREFIX}
183
+ export PATH=${install_prefix}/bin:${PATH}
184
+ export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${install_prefix}/lib:${install_prefix}/lib64
185
+ }
186
+
187
+ # utils functions
188
+ function set_to_cn_url() {
189
+ local url=$1
190
+ if [[ ${cn_flag} == true ]]; then
191
+ url="https://graphscope.oss-cn-beijing.aliyuncs.com/dependencies"
192
+ fi
193
+ echo ${url}
194
+ }
195
+
196
+ function fetch_source() {
197
+ local url=$1
198
+ local file=$2
199
+ curl -fsSL -o "${file}" "${url}/${file}"
200
+ }
201
+
202
+ function download_and_untar() {
203
+ local url=$1
204
+ local file=$2
205
+ local directory=$3
206
+ if [ ! -d "${directory}" ]; then
207
+ [ ! -f "${file}" ] && fetch_source "${url}" "${file}"
208
+ tar zxf "${file}"
209
+ fi
210
+ }
211
+
212
+ function git_clone() {
213
+ local url=$1
214
+ local file=$2
215
+ local directory=$3
216
+ local branch=$4
217
+ if [ ! -d "${directory}" ]; then
218
+ if [ ! -f "${file}" ]; then
219
+ git clone --depth=1 --branch "${branch}" "${url}" "${directory}"
220
+ pushd "${directory}" || exit
221
+ git submodule update --init || true
222
+ popd || exit
223
+ else
224
+ tar zxf "${file}"
225
+ fi
226
+ fi
227
+ }
228
+
229
+ # cmake for centos
230
+ install_cmake() {
231
+ if [[ -f "${install_prefix}/bin/cmake" ]]; then
232
+ return 0
233
+ fi
234
+ pushd "${tempdir}" || exit
235
+ file="cmake-3.24.3-linux-${ARCH}.sh"
236
+ url="https://github.com/Kitware/CMake/releases/download/v3.24.3"
237
+ url=$(set_to_cn_url ${url})
238
+ [ ! -f "${file}" ] && fetch_source "${url}" "${file}"
239
+ bash "${file}" --prefix="${install_prefix}" --skip-license
240
+ popd || exit
241
+ rm -rf "${tempdir:?}/${file:?}"
242
+ }
243
+
244
+ # gflags for centos
245
+ install_gflags() {
246
+ if [[ -f "${install_prefix}/include/gflags/gflags.h" ]]; then
247
+ return 0
248
+ fi
249
+ pushd "${tempdir}" || exit
250
+ directory="gflags-2.2.2"
251
+ file="v2.2.2.tar.gz"
252
+ url="https://github.com/gflags/gflags/archive"
253
+ url=$(set_to_cn_url ${url})
254
+ download_and_untar "${url}" "${file}" "${directory}"
255
+ pushd ${directory} || exit
256
+ cmake . -DCMAKE_INSTALL_PREFIX="${install_prefix}" \
257
+ -DCMAKE_PREFIX_PATH="${install_prefix}" \
258
+ -DBUILD_SHARED_LIBS=ON
259
+ make -j$(nproc)
260
+ make install
261
+ popd || exit
262
+ popd || exit
263
+ rm -rf "${tempdir:?}/${directory:?}" "${tempdir:?}/${file:?}"
264
+ }
265
+
266
+ # glog for centos
267
+ install_glog() {
268
+ if [[ -f "${install_prefix}/include/glog/logging.h" ]]; then
269
+ return 0
270
+ fi
271
+ pushd "${tempdir}" || exit
272
+ directory="glog-0.6.0"
273
+ file="v0.6.0.tar.gz"
274
+ url="https://github.com/google/glog/archive"
275
+ url=$(set_to_cn_url ${url})
276
+ download_and_untar "${url}" "${file}" "${directory}"
277
+ pushd ${directory} || exit
278
+ cmake . -DCMAKE_INSTALL_PREFIX="${install_prefix}" \
279
+ -DCMAKE_PREFIX_PATH="${install_prefix}" \
280
+ -DBUILD_SHARED_LIBS=ON
281
+ make -j$(nproc)
282
+ make install
283
+ popd || exit
284
+ popd || exit
285
+ rm -rf "${tempdir:?}/${directory:?}" "${tempdir:?}/${file:?}"
286
+ }
287
+
288
+ # boost with leaf for centos and ubuntu
289
+ install_boost() {
290
+ if [[ -f "${install_prefix}/include/boost/version.hpp" ]]; then
291
+ return 0
292
+ fi
293
+ pushd "${tempdir}" || exit
294
+ directory="boost_1_75_0"
295
+ file="${directory}.tar.gz"
296
+ url="https://archives.boost.io/release/1.75.0/source"
297
+ url=$(set_to_cn_url ${url})
298
+ download_and_untar "${url}" "${file}" "${directory}"
299
+ pushd ${directory} || exit
300
+ # seastar needs filesystem program_options thread unit_test_framework
301
+ # interactive needs context regex date_time
302
+ ./bootstrap.sh --prefix="${install_prefix}" \
303
+ --with-libraries=system,filesystem,context,program_options,regex,thread,random,chrono,atomic,date_time,test
304
+ ./b2 install link=shared runtime-link=shared variant=release threading=multi
305
+ popd || exit
306
+ popd || exit
307
+ rm -rf "${tempdir:?}/${directory:?}" "${tempdir:?}/${file:?}"
308
+ }
309
+
310
+ # openssl for centos
311
+ install_openssl() {
312
+ if [[ -f "${install_prefix}/include/openssl/ssl.h" ]]; then
313
+ return 0
314
+ fi
315
+ pushd "${tempdir}" || exit
316
+ directory="openssl-OpenSSL_1_1_1k"
317
+ file="OpenSSL_1_1_1k.tar.gz"
318
+ url="https://github.com/openssl/openssl/archive"
319
+ url=$(set_to_cn_url ${url})
320
+ download_and_untar "${url}" "${file}" "${directory}"
321
+ pushd ${directory} || exit
322
+ ./config --prefix="${install_prefix}" -fPIC -shared
323
+ make -j$(nproc)
324
+ make install
325
+ popd || exit
326
+ popd || exit
327
+ rm -rf "${tempdir:?}/${directory:?}" "${tempdir:?}/${file:?}"
328
+ }
329
+
330
+ # static openssl for centos 8
331
+ install_openssl_static() {
332
+ if [[ -f "${install_prefix}/include/openssl/ssl.h" ]]; then
333
+ return 0
334
+ fi
335
+ pushd "${tempdir}" || exit
336
+ directory="openssl-OpenSSL_1_1_1k"
337
+ file="OpenSSL_1_1_1k.tar.gz"
338
+ url="https://github.com/openssl/openssl/archive"
339
+ url=$(set_to_cn_url ${url})
340
+ download_and_untar "${url}" "${file}" "${directory}"
341
+ pushd ${directory} || exit
342
+ ./config --prefix="${install_prefix}" no-shared -fPIC
343
+ make -j$(nproc)
344
+ make install
345
+ popd || exit
346
+ popd || exit
347
+ rm -rf "${tempdir:?}/${directory:?}" "${tempdir:?}/${file:?}"
348
+ }
349
+
350
+ # arrow for ubuntu and centos
351
+ install_arrow() {
352
+ if [[ "${OS_PLATFORM}" == *"Ubuntu"* ]]; then
353
+ if ! dpkg -s libarrow-dev &>/dev/null; then
354
+ ${SUDO} apt-get install -y lsb-release
355
+ # shellcheck disable=SC2046,SC2019,SC2018
356
+ wget -c https://apache.jfrog.io/artifactory/arrow/"$(lsb_release --id --short | tr 'A-Z' 'a-z')"/apache-arrow-apt-source-latest-$(lsb_release --codename --short).deb -P /tmp/
357
+ ${SUDO} apt-get install -y -V /tmp/apache-arrow-apt-source-latest-"$(lsb_release --codename --short)".deb
358
+ ${SUDO} apt-get update -y
359
+ ${SUDO} apt-get install -y libarrow-dev=${ARROW_VERSION}-1 libarrow-dataset-dev=${ARROW_VERSION}-1 libarrow-acero-dev=${ARROW_VERSION}-1 libparquet-dev=${ARROW_VERSION}-1
360
+ rm /tmp/apache-arrow-apt-source-latest-*.deb
361
+ fi
362
+ elif [[ "${OS_PLATFORM}" == *"CentOS"* || "${OS_PLATFORM}" == *"Aliyun"* ]]; then
363
+ install_arrow_centos
364
+ fi
365
+ }
366
+
367
+ # arrow for centos
368
+ install_arrow_centos() {
369
+ if [[ -f "${install_prefix}/include/arrow/api.h" ]]; then
370
+ return 0
371
+ fi
372
+ pushd "${tempdir}" || exit
373
+ directory="arrow-apache-arrow-${ARROW_VERSION}"
374
+ file="apache-arrow-${ARROW_VERSION}.tar.gz"
375
+ url="https://github.com/apache/arrow/archive"
376
+ url=$(set_to_cn_url ${url})
377
+ download_and_untar "${url}" "${file}" "${directory}"
378
+ pushd ${directory} || exit
379
+ cmake ./cpp \
380
+ -DCMAKE_PREFIX_PATH="${install_prefix}" \
381
+ -DCMAKE_INSTALL_PREFIX="${install_prefix}" \
382
+ -DARROW_COMPUTE=ON \
383
+ -DARROW_WITH_UTF8PROC=OFF \
384
+ -DARROW_CSV=ON \
385
+ -DARROW_CUDA=OFF \
386
+ -DARROW_DATASET=OFF \
387
+ -DARROW_FILESYSTEM=ON \
388
+ -DARROW_FLIGHT=OFF \
389
+ -DARROW_GANDIVA=OFF \
390
+ -DARROW_HDFS=OFF \
391
+ -DARROW_JSON=OFF \
392
+ -DARROW_ORC=OFF \
393
+ -DARROW_PARQUET=OFF \
394
+ -DARROW_PLASMA=OFF \
395
+ -DARROW_PYTHON=OFF \
396
+ -DARROW_S3=OFF \
397
+ -DARROW_WITH_BZ2=OFF \
398
+ -DARROW_WITH_ZLIB=OFF \
399
+ -DARROW_WITH_LZ4=OFF \
400
+ -DARROW_WITH_SNAPPY=OFF \
401
+ -DARROW_WITH_ZSTD=OFF \
402
+ -DARROW_WITH_BROTLI=OFF \
403
+ -DARROW_IPC=ON \
404
+ -DARROW_BUILD_BENCHMARKS=OFF \
405
+ -DARROW_BUILD_EXAMPLES=OFF \
406
+ -DARROW_BUILD_INTEGRATION=OFF \
407
+ -DARROW_BUILD_UTILITIES=OFF \
408
+ -DARROW_BUILD_TESTS=OFF \
409
+ -DARROW_ENABLE_TIMING_TESTS=OFF \
410
+ -DARROW_FUZZING=OFF \
411
+ -DARROW_USE_ASAN=OFF \
412
+ -DARROW_USE_TSAN=OFF \
413
+ -DARROW_USE_UBSAN=OFF \
414
+ -DARROW_JEMALLOC=OFF \
415
+ -DARROW_BUILD_SHARED=ON \
416
+ -DARROW_BUILD_STATIC=OFF
417
+ make -j$(nproc)
418
+ make install
419
+ popd || exit
420
+ popd || exit
421
+ rm -rf "${tempdir:?}/${directory:?}" "${tempdir:?}/${file:?}"
422
+ }
423
+
424
+ # openmpi for centos
425
+ install_openmpi() {
426
+ if [[ -f "${install_prefix}/include/mpi.h" ]]; then
427
+ return 0
428
+ fi
429
+ info "creating directory: ${MPI_PREFIX}"
430
+ ${SUDO} mkdir -p ${MPI_PREFIX}
431
+ ${SUDO} chown -R $(id -u):$(id -g) ${MPI_PREFIX}
432
+ pushd "${tempdir}" || exit
433
+ directory="openmpi-4.0.5"
434
+ file="openmpi-4.0.5.tar.gz"
435
+ url="https://download.open-mpi.org/release/open-mpi/v4.0"
436
+ url=$(set_to_cn_url ${url})
437
+ download_and_untar "${url}" "${file}" "${directory}"
438
+ pushd ${directory} || exit
439
+ ./configure --enable-mpi-cxx --disable-dlopen --prefix=${MPI_PREFIX}
440
+ make -j$(nproc)
441
+ make install
442
+ popd || exit
443
+ popd || exit
444
+ cp -rs ${MPI_PREFIX}/* "${install_prefix}"
445
+ rm -rf "${tempdir:?}/${directory:?}" "${tempdir:?}/${file:?}"
446
+ }
447
+
448
+ # protobuf for centos
449
+ install_protobuf() {
450
+ if [[ -f "${install_prefix}/include/google/protobuf/port.h" ]]; then
451
+ return 0
452
+ fi
453
+ pushd "${tempdir}" || exit
454
+ directory="protobuf-21.9"
455
+ file="protobuf-all-21.9.tar.gz"
456
+ url="https://github.com/protocolbuffers/protobuf/releases/download/v21.9"
457
+ url=$(set_to_cn_url ${url})
458
+ download_and_untar "${url}" "${file}" "${directory}"
459
+ pushd ${directory} || exit
460
+ ./configure --prefix="${install_prefix}" --enable-shared --disable-static
461
+ make -j$(nproc)
462
+ make install
463
+ popd || exit
464
+ popd || exit
465
+ rm -rf "${tempdir:?}/${directory:?}" "${tempdir:?}/${file:?}"
466
+ }
467
+
468
+ # zlib for centos
469
+ install_zlib() {
470
+ if [[ -f "${install_prefix}/include/zlib.h" ]]; then
471
+ return 0
472
+ fi
473
+ pushd "${tempdir}" || exit
474
+ directory="zlib-1.2.11"
475
+ file="v1.2.11.tar.gz"
476
+ url="https://github.com/madler/zlib/archive"
477
+ url=$(set_to_cn_url ${url})
478
+ download_and_untar "${url}" "${file}" "${directory}"
479
+ pushd ${directory} || exit
480
+ cmake . -DCMAKE_INSTALL_PREFIX="${install_prefix}" \
481
+ -DCMAKE_PREFIX_PATH="${install_prefix}" \
482
+ -DBUILD_SHARED_LIBS=ON
483
+ make -j$(nproc)
484
+ make install
485
+ popd || exit
486
+ popd || exit
487
+ rm -rf "${tempdir:?}/${directory:?}" "${tempdir:?}/${file:?}"
488
+ }
489
+
490
+ # opentelemetry
491
+ install_opentelemetry() {
492
+ pushd "${tempdir}" || exit
493
+ git clone https://github.com/open-telemetry/opentelemetry-cpp -b v1.15.0
494
+ cd opentelemetry-cpp
495
+ cmake . -DCMAKE_BUILD_TYPE=Release \
496
+ -DCMAKE_INSTALL_PREFIX="${install_prefix}" \
497
+ -DCMAKE_CXX_STANDARD=17 \
498
+ -DCMAKE_POSITION_INDEPENDENT_CODE=ON \
499
+ -DBUILD_SHARED_LIBS=ON \
500
+ -DWITH_OTLP_HTTP=ON \
501
+ -DWITH_OTLP_GRPC=OFF \
502
+ -DWITH_ABSEIL=OFF \
503
+ -DWITH_PROMETHEUS=OFF \
504
+ -DBUILD_TESTING=OFF \
505
+ -DWITH_EXAMPLES=OFF
506
+ make -j -j$(nproc)
507
+ make install
508
+ popd || exit
509
+ rm -rf "${tempdir:?}/opentelemetry-cpp"
510
+ }
511
+
512
+ # grpc for centos
513
+ install_grpc() {
514
+ if [[ -f "${install_prefix}/include/grpcpp/grpcpp.h" ]]; then
515
+ return 0
516
+ fi
517
+ directory="grpc"
518
+ branch="v1.49.1"
519
+ file="${directory}-${branch}.tar.gz"
520
+ url="https://github.com/grpc/grpc.git"
521
+ url=$(set_to_cn_url ${url})
522
+ pushd "${tempdir}" || exit
523
+ if [[ ${url} == *.git ]]; then
524
+ git_clone "${url}" "${file}" "${directory}" "${branch}"
525
+ else
526
+ download_and_untar "${url}" "${file}" "${directory}"
527
+ fi
528
+ pushd ${directory} || exit
529
+ cmake . -DCMAKE_INSTALL_PREFIX="${install_prefix}" \
530
+ -DCMAKE_PREFIX_PATH="${install_prefix}" \
531
+ -DBUILD_SHARED_LIBS=ON \
532
+ -DgRPC_INSTALL=ON \
533
+ -DgRPC_BUILD_TESTS=OFF \
534
+ -DgRPC_BUILD_CSHARP_EXT=OFF \
535
+ -DgRPC_BUILD_GRPC_CSHARP_PLUGIN=OFF \
536
+ -DgRPC_BUILD_GRPC_NODE_PLUGIN=OFF \
537
+ -DgRPC_BUILD_GRPC_OBJECTIVE_C_PLUGIN=OFF \
538
+ -DgRPC_BUILD_GRPC_PHP_PLUGIN=OFF \
539
+ -DgRPC_BUILD_GRPC_PYTHON_PLUGIN=OFF \
540
+ -DgRPC_BUILD_GRPC_RUBY_PLUGIN=OFF \
541
+ -DgRPC_BACKWARDS_COMPATIBILITY_MODE=ON \
542
+ -DgRPC_PROTOBUF_PROVIDER=package \
543
+ -DgRPC_ZLIB_PROVIDER=package \
544
+ -DgRPC_SSL_PROVIDER=package \
545
+ -DOPENSSL_ROOT_DIR="${install_prefix}" \
546
+ -DCMAKE_CXX_FLAGS="-fpermissive" \
547
+ -DPNG_ARM_NEON_OPT=0
548
+ make -j$(nproc)
549
+ make install
550
+ popd || exit
551
+ popd || exit
552
+ rm -rf "${tempdir:?}/${directory:?}" "${tempdir:?}/${file:?}"
553
+ }
554
+
555
+ # patchelf
556
+ install_patchelf() {
557
+ if [[ -f "${install_prefix}/bin/patchelf" ]]; then
558
+ return 0
559
+ fi
560
+ pushd "${tempdir}" || exit
561
+ directory="patchelf" # patchelf doesn't have a folder
562
+ file="patchelf-0.14.5-${ARCH}.tar.gz"
563
+ url="https://github.com/NixOS/patchelf/releases/download/0.14.5"
564
+ url=$(set_to_cn_url ${url})
565
+ mkdir -p "${directory}"
566
+ pushd "${directory}" || exit
567
+ download_and_untar "${url}" "${file}" "${directory}"
568
+ mkdir -p ${install_prefix}/bin
569
+ mv bin/patchelf ${install_prefix}/bin/patchelf
570
+ popd || exit
571
+ popd || exit
572
+ rm -rf "${tempdir:?}/${directory:?}" "${tempdir:?}/${file:?}"
573
+ }
574
+
575
+ # libgrape-lite
576
+ install_libgrape_lite() {
577
+ if [[ "${OS_PLATFORM}" == *"Darwin"* ]]; then
578
+ if [[ -f "${HOMEBREW_PREFIX}/include/grape/grape.h" ]]; then
579
+ return 0
580
+ fi
581
+ else
582
+ if [[ -f "${install_prefix}/include/grape/grape.h" ]]; then
583
+ return 0
584
+ fi
585
+ fi
586
+ local branch=$1
587
+ pushd "${tempdir}" || exit
588
+ git clone -b ${branch} https://github.com/alibaba/libgrape-lite.git
589
+ cd libgrape-lite
590
+ cmake . -DCMAKE_BUILD_TYPE=Release \
591
+ -DCMAKE_INSTALL_PREFIX="${install_prefix}" \
592
+ -DBUILD_LIBGRAPELITE_TESTS=OFF
593
+ make -j$(nproc)
594
+ make install
595
+ popd || exit
596
+ rm -rf "${tempdir:?}/libgrape-lite"
597
+ }
598
+
599
+ # vineyard
600
+ install_vineyard() {
601
+ if [[ -f "${V6D_PREFIX}/include/vineyard/client/client.h" ]]; then
602
+ return 0
603
+ fi
604
+ pushd "${tempdir}" || exit
605
+ python3 -m pip --no-cache-dir install pip -U --user
606
+ python3 -m pip --no-cache-dir install libclang wheel auditwheel --user
607
+ auditwheel_path=$(python3 -c "import auditwheel; print(auditwheel.__path__[0] + '/main_repair.py')")
608
+ if [[ "${OS_PLATFORM}" == *"Darwin"* ]]; then
609
+ BUILD_VINEYARD_GRAPH_WITH_GAR="OFF"
610
+ sed -i '' 's/p.error/logger.warning/g' ${auditwheel_path}
611
+ else
612
+ BUILD_VINEYARD_GRAPH_WITH_GAR="ON"
613
+ sed -i 's/p.error/logger.warning/g' ${auditwheel_path}
614
+ fi
615
+ if [[ "${v6d_version}" != "v"* ]]; then
616
+ directory="v6d"
617
+ file="${directory}-${v6d_version}.tar.gz"
618
+ url="https://github.com/v6d-io/v6d.git"
619
+ git_clone "${url}" "${file}" "${directory}" "${v6d_version}"
620
+ else
621
+ # remove the prefix 'v'
622
+ directory="v6d-${v6d_version:1:100}"
623
+ file="${directory}.tar.gz"
624
+ url="https://github.com/v6d-io/v6d/releases/download/${v6d_version}"
625
+ download_and_untar "${url}" "${file}" "${directory}"
626
+ fi
627
+ pushd ${directory} || exit
628
+
629
+ cmake . -DCMAKE_PREFIX_PATH="${install_prefix}" \
630
+ -DCMAKE_INSTALL_PREFIX="${V6D_PREFIX}" \
631
+ -DBUILD_VINEYARD_TESTS=OFF \
632
+ -DBUILD_SHARED_LIBS=ON \
633
+ -DBUILD_VINEYARD_PYTHON_BINDINGS=ON \
634
+ -DBUILD_VINEYARD_GRAPH_WITH_GAR=${BUILD_VINEYARD_GRAPH_WITH_GAR}
635
+ make -j$(nproc)
636
+ make install
637
+ if [[ "${OS_PLATFORM}" == *"Darwin"* ]]; then
638
+ strip "${V6D_PREFIX}"/bin/vineyard*
639
+ else
640
+ strip "${V6D_PREFIX}"/bin/vineyard* "${V6D_PREFIX}"/lib/libvineyard*
641
+ fi
642
+ pip3 install --no-cache -i https://pypi.org/simple -U "vineyard" "vineyard-io"
643
+ cp -rs "${V6D_PREFIX}"/* "${install_prefix}"/
644
+ set +e
645
+ popd || exit
646
+ popd || exit
647
+ rm -rf "${tempdir:?}/${directory:?}" "${tempdir:?}/${file:?}"
648
+ }
649
+
650
+ # java
651
+ install_java_and_maven() {
652
+ if [[ "${OS_PLATFORM}" == *"Darwin"* ]]; then
653
+ if ! command -v javac &>/dev/null; then
654
+ brew install --ignore-dependencies openjdk@11
655
+ fi
656
+ if ! command -v mvn &>/dev/null; then
657
+ brew install --ignore-dependencies maven
658
+ fi
659
+ elif [[ "${OS_PLATFORM}" == *"Ubuntu"* ]]; then
660
+ if ! command -v javac &>/dev/null; then
661
+ ${SUDO} apt-get install default-jdk -y
662
+ fi
663
+ if ! command -v mvn &>/dev/null; then
664
+ ${SUDO} apt-get install maven -y
665
+ fi
666
+ else
667
+ if ! command -v javac &>/dev/null; then
668
+ ${SUDO} yum install java-11-openjdk-devel -y
669
+ fi
670
+ if ! command -v mvn &>/dev/null; then
671
+ install_maven
672
+ fi
673
+ fi
674
+ }
675
+
676
+ # maven for centos
677
+ install_maven() {
678
+ if [[ -f "${install_prefix}/bin/mvn" ]]; then
679
+ return 0
680
+ fi
681
+ pushd "${tempdir}" || exit
682
+ directory="apache-maven-3.8.6"
683
+ file="apache-maven-3.8.6-bin.tar.gz"
684
+ url="https://archive.apache.org/dist/maven/maven-3/3.8.6/binaries"
685
+ url=$(set_to_cn_url ${url})
686
+ download_and_untar "${url}" "${file}" "${directory}"
687
+ cp -r ${directory} "${install_prefix}"/
688
+ mkdir -p "${install_prefix}"/bin
689
+ ln -s "${install_prefix}/${directory}/bin/mvn" "${install_prefix}/bin/mvn"
690
+ popd || exit
691
+ rm -rf "${tempdir:?}/${directory:?}" "${tempdir:?}/${file:?}"
692
+ }
693
+
694
+ install_hiactor() {
695
+ if [[ -f "${install_prefix}/include/hiactor/core/actor_core.hh" ]]; then
696
+ return 0
697
+ fi
698
+ pushd "${tempdir}" || exit
699
+ git clone https://github.com/alibaba/hiactor.git -b v0.1.1 --single-branch
700
+ cd hiactor && git submodule update --init --recursive
701
+ sudo bash ./seastar/seastar/install-dependencies.sh
702
+ mkdir build && cd build
703
+ cmake -DHiactor_DEMOS=OFF -DHiactor_TESTING=OFF -DHiactor_DPDK=OFF -DCMAKE_INSTALL_PREFIX="${install_prefix}" \
704
+ -DHiactor_CXX_DIALECT=gnu++17 -DSeastar_CXX_FLAGS="-DSEASTAR_DEFAULT_ALLOCATOR -mno-avx512" ..
705
+ make -j$(nproc) && make install
706
+ popd && rm -rf "${tempdir}/hiactor"
707
+ }
708
+
709
+
710
+ install_cppkafka() {
711
+ if [[ -f "${install_prefix}/include/cppkafka/cppkafka.h" ]]; then
712
+ return 0
713
+ fi
714
+ pushd "${tempdir}" || exit
715
+ directory="cppkafka-0.4.0"
716
+ file="0.4.0.tar.gz"
717
+ url="https://graphscope.oss-cn-beijing.aliyuncs.com/dependencies"
718
+ url=$(set_to_cn_url ${url})
719
+ download_and_untar "${url}" "${file}" "${directory}"
720
+ pushd ${directory} || exit
721
+ # cppkafka may not find the lib64 directory
722
+ export LIBRARY_PATH=${LIBRARY_PATH}:${install_prefix}/lib:${install_prefix}/lib64
723
+ cmake . -DCMAKE_INSTALL_PREFIX="${install_prefix}" \
724
+ -DCMAKE_PREFIX_PATH="${install_prefix}" \
725
+ -DCPPKAFKA_DISABLE_TESTS=ON \
726
+ -DCPPKAFKA_DISABLE_EXAMPLES=ON
727
+ make -j4
728
+ make install
729
+ popd || exit
730
+ popd || exit
731
+ rm -rf "${tempdir:?}/${directory:?}" "${tempdir:?}/${file:?}"
732
+ }
733
+
734
+
735
+ BASIC_PACKAGES_LINUX=("file" "curl" "wget" "git" "sudo")
736
+ BASIC_PACKAGES_UBUNTU=("${BASIC_PACKAGES_LINUX[@]}" "build-essential" "cmake" "libunwind-dev" "python3-pip")
737
+ BASIC_PACKAGES_CENTOS_8=("${BASIC_PACKAGES_LINUX[@]}" "epel-release" "libunwind-devel" "libcurl-devel" "perl" "which")
738
+ BASIC_PACKAGES_CENTOS_7=("${BASIC_PACKAGES_CENTOS_8[@]}" "centos-release-scl-rh")
739
+ ADDITIONAL_PACKAGES_CENTOS_8=("gcc-c++" "python38-devel")
740
+ ADDITIONAL_PACKAGES_CENTOS_7=("make" "devtoolset-8-gcc-c++" "rh-python38-python-pip" "rh-python38-python-devel")
741
+
742
+ install_basic_packages() {
743
+ if [[ "${OS_PLATFORM}" == *"Ubuntu"* ]]; then
744
+ ${SUDO} apt-get update -y
745
+ DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC ${SUDO} apt-get install -y ${BASIC_PACKAGES_UBUNTU[*]}
746
+ elif [[ "${OS_PLATFORM}" == *"CentOS"* || "${OS_PLATFORM}" == *"Aliyun"* ]]; then
747
+ ${SUDO} yum update -y
748
+ if [[ "${OS_VERSION}" -eq "7" ]]; then
749
+ # centos7
750
+ ${SUDO} yum install -y ${BASIC_PACKAGES_CENTOS_7[*]}
751
+ # change the source for centos-release-scl-rh
752
+ ${SUDO} sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-*scl*
753
+ ${SUDO} sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*scl*
754
+ ${SUDO} sed -i 's|# baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*scl*
755
+ ${SUDO} yum install -y ${ADDITIONAL_PACKAGES_CENTOS_7[*]}
756
+ else
757
+ if [[ "${OS_PLATFORM}" == *"Aliyun"* ]]; then
758
+ ${SUDO} yum install -y 'dnf-command(config-manager)'
759
+ ${SUDO} dnf install -y epel-release --allowerasing
760
+ else
761
+ ${SUDO} sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-*
762
+ ${SUDO} sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*
763
+ ${SUDO} yum install -y 'dnf-command(config-manager)'
764
+ ${SUDO} dnf install -y epel-release
765
+ ${SUDO} dnf config-manager --set-enabled powertools
766
+ fi
767
+ ${SUDO} dnf config-manager --set-enabled epel
768
+ ${SUDO} yum install -y ${BASIC_PACKAGES_CENTOS_8[*]}
769
+ ${SUDO} yum install -y ${ADDITIONAL_PACKAGES_CENTOS_8[*]}
770
+ fi
771
+ fi
772
+ }
773
+
774
+ ANALYTICAL_MACOS=("apache-arrow" "boost" "gflags" "glog" "open-mpi" "openssl@1.1" "protobuf" "grpc" "rapidjson" "msgpack-cxx" "librdkafka" "patchelf")
775
+ ANALYTICAL_UBUNTU=("libopenmpi-dev" "libgflags-dev" "libgoogle-glog-dev" "libprotobuf-dev" "libgrpc++-dev" "libmsgpack-dev" "librdkafka-dev" "protobuf-compiler-grpc" "rapidjson-dev")
776
+ ANALYTICAL_CENTOS_7=("librdkafka-devel" "msgpack-devel" "rapidjson-devel")
777
+ ANALYTICAL_CENTOS_8=("${ANALYTICAL_CENTOS_7[@]}" "boost-devel" "gflags-devel" "glog-devel")
778
+
779
+ install_analytical_centos_common_dependencies() {
780
+ install_patchelf
781
+ install_arrow_centos
782
+ install_openmpi
783
+ install_protobuf
784
+ install_zlib
785
+ install_grpc
786
+ }
787
+
788
+ install_analytical_dependencies() {
789
+ if [[ "${OS_PLATFORM}" == *"Darwin"* ]]; then
790
+ brew install ${ANALYTICAL_MACOS[*]}
791
+ export LDFLAGS="${LDFLAGS} -L${HOMEBREW_PREFIX}/opt/openssl@1.1/lib"
792
+ export CPPFLAGS="${CPPFLAGS} -I${HOMEBREW_PREFIX}/opt/openssl@1.1/include"
793
+ export PKG_CONFIG_PATH="${HOMEBREW_PREFIX}/opt/openssl@1.1/lib/pkgconfig"
794
+ elif [[ "${OS_PLATFORM}" == *"Ubuntu"* ]]; then
795
+ DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC ${SUDO} apt-get install -y ${ANALYTICAL_UBUNTU[*]}
796
+ # patchelf
797
+ install_patchelf
798
+ # arrow
799
+ install_arrow
800
+ # install boost >= 1.75 for leaf
801
+ install_boost
802
+ else
803
+ if [[ "${OS_VERSION}" -eq "7" ]]; then
804
+ ${SUDO} yum install -y ${ANALYTICAL_CENTOS_7[*]}
805
+ source /opt/rh/devtoolset-8/enable
806
+ source /opt/rh/rh-python38/enable
807
+ export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${install_prefix}/lib:${install_prefix}/lib64
808
+ install_cmake
809
+ install_gflags
810
+ install_glog
811
+ install_boost
812
+ # must to install openssl before grpc
813
+ install_openssl
814
+ else
815
+ ${SUDO} yum install -y ${ANALYTICAL_CENTOS_8[*]}
816
+ export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/lib/:/lib64${install_prefix}/lib:${install_prefix}/lib64
817
+ install_cmake
818
+ install_openssl_static
819
+ fi
820
+ install_analytical_centos_common_dependencies
821
+ fi
822
+ # install java for gae-java
823
+ install_java_and_maven
824
+ # install vineyard
825
+ if [[ "${no_v6d}" != true ]]; then
826
+ install_vineyard
827
+ # if [[ "${OS_PLATFORM}" == *"Darwin"* ]]; then
828
+ # brew install vineyard
829
+ # else
830
+ # install_vineyard
831
+ # fi
832
+ fi
833
+ }
834
+
835
+ install_analytical_java_dependencies() {
836
+ # llvm
837
+ if [[ "${OS_PLATFORM}" == *"Darwin"* ]]; then
838
+ brew install llvm || true # prevent the `brew link` failure
839
+ export CC=${HOMEBREW_PREFIX}/opt/llvm/bin/clang
840
+ export CXX=${HOMEBREW_PREFIX}/opt/llvm/bin/clang++
841
+ export CPPFLAGS="${CPPFLAGS} -I${HOMEBREW_PREFIX}/opt/llvm/include"
842
+ export CARGO_TARGET_X86_64_APPLE_DARWIN_LINKER=${CC}
843
+ elif [[ "${OS_PLATFORM}" == *"Ubuntu"* ]]; then
844
+ ${SUDO} apt-get install -y llvm-11-dev lld-11 clang-11
845
+ else
846
+ if [[ "${OS_VERSION}" -eq "7" ]]; then
847
+ ${SUDO} yum install -y llvm-toolset-7.0-clang-devel
848
+ source /opt/rh/llvm-toolset-7.0/enable
849
+ export LIBCLANG_PATH=/opt/rh/llvm-toolset-7.0/root/usr/lib64/
850
+ else
851
+ ${SUDO} yum install -y llvm-devel clang-devel lld
852
+ fi
853
+ fi
854
+ }
855
+
856
+ INTERACTIVE_MACOS=("apache-arrow" "rapidjson" "boost" "glog" "gflags")
857
+ INTERACTIVE_UBUNTU=("rapidjson-dev" "libgoogle-glog-dev" "libgflags-dev")
858
+ INTERACTIVE_CENTOS=("rapidjson-devel")
859
+
860
+ install_interactive_dependencies() {
861
+ # dependencies package
862
+ if [[ "${OS_PLATFORM}" == *"Darwin"* ]]; then
863
+ brew install ${INTERACTIVE_MACOS[*]}
864
+ elif [[ "${OS_PLATFORM}" == *"Ubuntu"* ]]; then
865
+ DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC ${SUDO} apt-get install -y ${INTERACTIVE_UBUNTU[*]}
866
+ install_arrow
867
+ install_boost
868
+ # hiactor is only supported on ubuntu
869
+ install_hiactor
870
+ ${SUDO} sh -c 'echo "fs.aio-max-nr = 1048576" >> /etc/sysctl.conf'
871
+ ${SUDO} sysctl -p /etc/sysctl.conf
872
+ else
873
+ ${SUDO} yum install -y ${INTERACTIVE_CENTOS[*]}
874
+ install_arrow
875
+ install_boost
876
+ fi
877
+ # libgrape-lite
878
+ install_libgrape_lite "v0.3.2"
879
+ # java
880
+ install_java_and_maven
881
+ # rust
882
+ if ! command -v rustup &>/dev/null; then
883
+ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
884
+ source $HOME/.cargo/env
885
+ rustup install 1.81.0
886
+ rustup default 1.81.0
887
+ rustc --version
888
+ fi
889
+ # opentelemetry
890
+ if [[ "${OS_PLATFORM}" != *"Darwin"* ]]; then
891
+ install_opentelemetry
892
+ fi
893
+ }
894
+
895
+ install_learning_dependencies() {
896
+ install_cppkafka
897
+ }
898
+
899
+ write_env_config() {
900
+ echo "" > ${OUTPUT_ENV_FILE}
901
+ # common
902
+ {
903
+ echo "export GRAPHSCOPE_HOME=${install_prefix}"
904
+ echo "export CMAKE_PREFIX_PATH=/opt/vineyard:/opt/graphscope/"
905
+ echo "export PATH=${install_prefix}/bin:\$HOME/.local/bin:\$HOME/.cargo/bin:\$PATH"
906
+ echo "export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}"
907
+ echo "export LIBRARY_PATH=${install_prefix}/lib:${install_prefix}/lib64"
908
+ } >> "${OUTPUT_ENV_FILE}"
909
+ {
910
+ if [[ "${OS_PLATFORM}" == *"Darwin"* ]]; then
911
+ echo "export OPENSSL_ROOT_DIR=${HOMEBREW_PREFIX}/opt/openssl"
912
+ echo "export OPENSSL_LIBRARIES=${HOMEBREW_PREFIX}/opt/openssl/lib"
913
+ echo "export OPENSSL_SSL_LIBRARY=${HOMEBREW_PREFIX}/opt/openssl/lib/libssl.dylib"
914
+ elif [[ "${OS_PLATFORM}" == *"CentOS"* || "${OS_PLATFORM}" == *"Aliyun"* ]]; then
915
+ if [[ "${OS_VERSION}" -eq "7" ]]; then
916
+ echo "source /opt/rh/devtoolset-8/enable"
917
+ echo "source /opt/rh/rh-python38/enable"
918
+ fi
919
+ echo "export OPENSSL_ROOT_DIR=${install_prefix}"
920
+ fi
921
+ } >> "${OUTPUT_ENV_FILE}"
922
+ # JAVA_HOME
923
+ {
924
+ if [[ "${for_analytical}" == true || "${for_interactive}" == true ]]; then
925
+ if [[ "${OS_PLATFORM}" == *"Darwin"* ]]; then
926
+ if [ -z "${JAVA_HOME}" ]; then
927
+ echo "export JAVA_HOME=\$(/usr/libexec/java_home -v11)"
928
+ fi
929
+ elif [[ "${OS_PLATFORM}" == *"Ubuntu"* ]]; then
930
+ if [ -z "${JAVA_HOME}" ]; then
931
+ echo "export JAVA_HOME=/usr/lib/jvm/default-java"
932
+ fi
933
+ else
934
+ if [ -z "${JAVA_HOME}" ]; then
935
+ echo "export OPENSSL_ROOT_DIR=${install_prefix}"
936
+ fi
937
+ fi
938
+ fi
939
+ } >> "${OUTPUT_ENV_FILE}"
940
+ {
941
+ if [[ "${for_analytical_java}" == true ]]; then
942
+ if [[ "${OS_PLATFORM}" == *"Darwin"* ]]; then
943
+ echo "export CC=${HOMEBREW_PREFIX}/opt/llvm/bin/clang"
944
+ echo "export CXX=${HOMEBREW_PREFIX}/opt/llvm/bin/clang++"
945
+ echo "export CARGO_TARGET_X86_64_APPLE_DARWIN_LINKER=${CC}"
946
+ echo "export LDFLAGS=\"-L${HOMEBREW_PREFIX}/opt/llvm/lib\""
947
+ echo "export CPPFLAGS=\"-I${HOMEBREW_PREFIX}/opt/llvm/include\""
948
+ elif [[ "${OS_PLATFORM}" == *"CentOS"* || "${OS_PLATFORM}" == *"Aliyun"* ]]; then
949
+ echo "source /opt/rh/llvm-toolset-7.0/enable || true"
950
+ echo "export LIBCLANG_PATH=/opt/rh/llvm-toolset-7.0/root/usr/lib64/"
951
+ fi
952
+ fi
953
+ } >> "${OUTPUT_ENV_FILE}"
954
+ }
955
+
956
+ install_deps() {
957
+ init_workspace_and_env
958
+ install_basic_packages
959
+ [[ "${for_analytical}" == true ]] && install_analytical_dependencies
960
+ [[ "${for_analytical_java}" == true ]] && install_analytical_java_dependencies
961
+ [[ "${for_interactive}" == true ]] && install_interactive_dependencies
962
+ [[ "${for_learning}" == true ]] && install_learning_dependencies
963
+ write_env_config
964
+ info "The script has installed all dependencies, don't forget to exec command:\n
965
+ $ source ${OUTPUT_ENV_FILE}
966
+ \nbefore building GraphScope."
967
+ }
968
+
969
+ install_deps