imbajin commented on code in PR #2594:
URL:
https://github.com/apache/incubator-hugegraph/pull/2594#discussion_r1701631236
##########
.gitignore:
##########
@@ -58,6 +58,9 @@ build/
# maven ignore
apache-hugegraph-incubating-*/
+apache-hugegraph-pd-incubating-*/
+apache-hugegraph-store-incubating-*/
+apache-hugegraph-server-incubating-*/
Review Comment:
user `apache-hugegraph-*incubating-*/` or `apache-hugegraph-*/?
##########
hugegraph-store/hg-store-dist/src/assembly/static/bin/start-hugegraph-store.sh:
##########
@@ -36,14 +36,61 @@ LOGS="$TOP/logs"
OUTPUT=${LOGS}/hugegraph-store-server.log
GITHUB="https://github.com"
PID_FILE="$BIN/pid"
-arch=$(arch)
-echo "Current arch: ", "${arch}"
-#if [[ $arch =~ "aarch64" ]];then
-# export LD_PRELOAD="$TOP/bin/libjemalloc_aarch64.so"
-#else
-export LD_PRELOAD="$TOP/bin/libjemalloc.so"
-#fi
+arch=$(uname -m)
+echo "Current arch: $arch"
+
+download_and_verify() {
+ local url=$1
+ local filepath=$2
+ local expected_md5=$3
+
+ if [[ -f $filepath ]]; then
+ echo "File $filepath exists. Verifying MD5 checksum..."
+ actual_md5=$(md5sum $filepath | awk '{ print $1 }')
+ if [[ $actual_md5 != $expected_md5 ]]; then
+ echo "MD5 checksum verification failed for $filepath. Expected:
$expected_md5, but got: $actual_md5"
+ echo "Deleting $filepath..."
+ rm -f $filepath
+ else
+ echo "MD5 checksum verification succeeded for $filepath."
+ return 0
+ fi
+ fi
+
+ echo "Downloading $filepath..."
+ curl -L -o $filepath $url
+
+ actual_md5=$(md5sum $filepath | awk '{ print $1 }')
+ if [[ $actual_md5 != $expected_md5 ]]; then
+ echo "MD5 checksum verification failed for $filepath after download.
Expected: $expected_md5, but got: $actual_md5"
+ return 1
+ fi
+
+ return 0
+}
+
+if [[ $arch == "aarch64" || $arch == "arm64" ]]; then
+ lib_file="$TOP/bin/libjemalloc_aarch64.so"
+
download_url="https://github.com/apache/incubator-hugegraph/raw/master/hugegraph-store/hg-store-dist/src/assembly/static/bin/libjemalloc_aarch64.so"
+ expected_md5="2a631d2f81837f9d5864586761c5e380"
+ if download_and_verify $download_url $lib_file $expected_md5; then
+ export LD_PRELOAD=$lib_file
+ else
+ echo "Failed to verify or download $lib_file, skip it"
+ fi
+elif [[ $arch == "x86_64" ]]; then
+ lib_file="$TOP/bin/libjemalloc.so"
+
download_url="https://github.com/apache/incubator-hugegraph/raw/master/hugegraph-store/hg-store-dist/src/assembly/static/bin/libjemalloc.so"
Review Comment:
Due to the master branch URL is not **fixed** (also include the `incubator`
word) & maybe invalid sometime
if we want to download in web, maybe prefer to put it in the doc repo? (and
use a fixed branch - sync from master when need)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]