forked from nebula-contrib/NebulaGraph-Bench
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enhance setup script (nebula-contrib#26)
* enhance setup script * modify doc * fix github action * fix action * use wget
- Loading branch information
Showing
11 changed files
with
177 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,4 +26,6 @@ mysql/data | |
nebula-bench.db | ||
.vscode | ||
output | ||
third/*/data | ||
third/*/data | ||
scripts/k6 | ||
scripts/nebula-importer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
#!/bin/bash | ||
# setup dependency tools, including nebula-importer, k6. | ||
|
||
set -e | ||
|
||
# Directory of this script | ||
SCRIPT_DIR=$(cd "$(dirname "$0")"; pwd) | ||
# Directory of this project | ||
PROJECT_DIR=$(dirname ${SCRIPT_DIR}) | ||
# target data | ||
TEMP_DIR=${PROJECT_DIR}/temp | ||
source ${SCRIPT_DIR}/env.sh | ||
|
||
|
||
|
||
NEBULA_IMPORTER_VERSION=${NEBULA_IMPORTER_VERSION} | ||
NEBULA_XK6_VERSION=${NEBULA_XK6_VERSION} | ||
GOLANG_VERSION=${GOLANG_VERSION} | ||
|
||
|
||
function setup_nebula_importer(){ | ||
git clone --branch ${NEBULA_IMPORTER_VERSION} https://github.com/vesoft-inc/nebula-importer ${TEMP_DIR}/nebula-importer | ||
cd ${TEMP_DIR}/nebula-importer | ||
make build | ||
mv nebula-importer ${PROJECT_DIR}/scripts/. | ||
} | ||
|
||
|
||
function setup_nebula_k6(){ | ||
git clone --branch ${NEBULA_XK6_VERSION} https://github.com/HarrisChu/xk6-nebula ${TEMP_DIR}/xk6-nebula | ||
cd ${TEMP_DIR}/xk6-nebula | ||
make build | ||
mv k6 ${PROJECT_DIR}/scripts/. | ||
} | ||
|
||
function setup_go(){ | ||
# setup go | ||
if [ `command -v go` ];then | ||
echo 'already install golang environment.' | ||
return | ||
fi | ||
echo "begin install golang environment" | ||
|
||
os=`uname | tr "[A-Z]" "[a-z]"` | ||
case $(uname -m) in | ||
x86_64) arch=amd64;; | ||
aarch64) arch=arm64;; | ||
esac | ||
wget -c https://golang.org/dl/go${GOLANG_VERSION}.${os}-${arch}.tar.gz | ||
|
||
if [ $? != 0 ] ; then | ||
wget -c https://golang.google.cn/dl/go${GOLANG_VERSION}.${os}-${arch}.tar.gz | ||
if [ $? !=0 ] ; then | ||
echo "cannot download golang installation package, please install manually." | ||
exit 1 | ||
fi | ||
fi | ||
tar zxvf go${GOLANG_VERSION}.${os}-${arch}.tar.gz -C ${PROJECT_DIR} > /dev/null | ||
export GOPATH=${PROJECT_DIR}/gopath | ||
export PATH=$PATH:${PROJECT_DIR}/go/bin:${GOPATH}/bin | ||
} | ||
|
||
function main(){ | ||
rm -rf ${TEMP_DIR} | ||
setup_go | ||
setup_nebula_importer | ||
setup_nebula_k6 | ||
rm -rf ${TEMP_DIR} | ||
echo "Finish" | ||
|
||
} | ||
|
||
main |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
# Directory of this script | ||
SCRIPT_DIR=$(cd "$(dirname "$0")"; pwd) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters