From 863f4cdcf92f8c7fd17dba2af28c854af5d628f9 Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Thu, 27 Apr 2023 16:29:59 -0400 Subject: [PATCH] Run bench/bsbm_ with set -eu to exit right away if something abnormal happens MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit e.g. if one command fails or undefined variable is used. In turn it would allow to address such codeshell warnings like In bench/bsbm_graphdb.sh line 7: cd bsbm-tools ^-----------^ SC2164 (warning): Use 'cd ... || exit' or 'cd ... || return' in case cd fails. Did you mean: cd bsbm-tools || exit but note that there are uses left like ❯ git grep 'cd bsbm-tools || exit' bench/bsbm_blazegraph.sh:cd bsbm-tools || exit bench/bsbm_jena.sh:cd bsbm-tools || exit bench/bsbm_rdf4j.sh:cd bsbm-tools || exit but may be `|| exit` should be removed and they should exit with error? or the same should be added to the other 3? ❯ git grep 'cd bsbm-tools$' bench/bsbm_graphdb.sh:cd bsbm-tools bench/bsbm_oxigraph.sh:cd bsbm-tools bench/bsbm_virtuoso.sh:cd bsbm-tools --- bench/bsbm_blazegraph.sh | 10 ++++++---- bench/bsbm_graphdb.sh | 10 ++++++---- bench/bsbm_jena.sh | 14 ++++++++------ bench/bsbm_oxigraph.sh | 10 ++++++---- bench/bsbm_rdf4j.sh | 12 +++++++----- bench/bsbm_virtuoso.sh | 10 ++++++---- 6 files changed, 39 insertions(+), 27 deletions(-) diff --git a/bench/bsbm_blazegraph.sh b/bench/bsbm_blazegraph.sh index 559334ff..41f2dd0c 100755 --- a/bench/bsbm_blazegraph.sh +++ b/bench/bsbm_blazegraph.sh @@ -2,6 +2,8 @@ DATASET_SIZE=100000 PARALLELISM=16 + +set -eu wget -nc https://github.com/blazegraph/database/releases/download/BLAZEGRAPH_RELEASE_2_1_5/blazegraph.jar cd bsbm-tools || exit ./generate -fc -pc ${DATASET_SIZE} -s nt -fn "explore-${DATASET_SIZE}" -ud -ufn "explore-update-${DATASET_SIZE}" @@ -12,7 +14,7 @@ curl -f -X POST -H 'Content-Type:text/turtle' -T "explore-${DATASET_SIZE}.nt" ht ./testdriver -mt ${PARALLELISM} -ucf usecases/exploreAndUpdate/sparql.txt -o "../bsbm.exploreAndUpdate.blazegraph.2.1.5.${DATASET_SIZE}.${PARALLELISM}.xml" http://localhost:9999/blazegraph/sparql -u http://localhost:9999/blazegraph/sparql -udataset "explore-update-${DATASET_SIZE}.nt" #./testdriver -mt ${PARALLELISM} -ucf usecases/businessIntelligence/sparql.txt -o "../bsbm.businessIntelligence.blazegraph.2.1.5.${DATASET_SIZE}.${PARALLELISM}.xml" http://localhost:9999/blazegraph/sparql kill $! -rm blazegraph.jnl -rm "explore-${DATASET_SIZE}.nt" -rm "explore-update-${DATASET_SIZE}.nt" -rm -r td_data +rm -f blazegraph.jnl +rm -f "explore-${DATASET_SIZE}.nt" +rm -f "explore-update-${DATASET_SIZE}.nt" +rm -rf td_data diff --git a/bench/bsbm_graphdb.sh b/bench/bsbm_graphdb.sh index 21c83d7c..2c52dae2 100755 --- a/bench/bsbm_graphdb.sh +++ b/bench/bsbm_graphdb.sh @@ -4,6 +4,8 @@ DATASET_SIZE=100000 PARALLELISM=16 VERSION="9.3.3" JAVA_HOME=/usr/lib/jvm/java-11-openjdk + +set -eu cd bsbm-tools ./generate -fc -pc ${DATASET_SIZE} -s nt -fn "explore-${DATASET_SIZE}" -ud -ufn "explore-update-${DATASET_SIZE}" ../graphdb-free-9.3.3/bin/graphdb -s -Dgraphdb.logger.root.level=WARN & @@ -17,7 +19,7 @@ curl -f -X PUT -H 'Content-Type:application/n-triples' -T "explore-${DATASET_SIZ #./testdriver -mt ${PARALLELISM} -ucf usecases/businessIntelligence/sparql.txt -o "../bsbm.businessIntelligence.graphdb.${VERSION}.${DATASET_SIZE}.${PARALLELISM}.xml" http://localhost:7200/repositories/bsbm kill $! sleep 5 -rm -r ../graphdb-free-9.3.3/data -rm "explore-${DATASET_SIZE}.nt" -rm "explore-update-${DATASET_SIZE}.nt" -rm -r td_data +rm -rf ../graphdb-free-9.3.3/data +rm -f "explore-${DATASET_SIZE}.nt" +rm -f "explore-update-${DATASET_SIZE}.nt" +rm -rf td_data diff --git a/bench/bsbm_jena.sh b/bench/bsbm_jena.sh index 107fd47a..caa56d92 100755 --- a/bench/bsbm_jena.sh +++ b/bench/bsbm_jena.sh @@ -3,6 +3,8 @@ DATASET_SIZE=100000 # number of products in the dataset. There is around 350 triples generated by product. PARALLELISM=16 VERSION="4.3.2" + +set -eu wget -nc https://downloads.apache.org/jena/binaries/apache-jena-${VERSION}.zip cd bsbm-tools || exit ./generate -fc -pc ${DATASET_SIZE} -s nt -fn "explore-${DATASET_SIZE}" -ud -ufn "explore-update-${DATASET_SIZE}" @@ -18,9 +20,9 @@ sleep 10 ./testdriver -mt ${PARALLELISM} -ucf usecases/exploreAndUpdate/sparql.txt -o "../bsbm.exploreAndUpdate.jena.${VERSION}.${DATASET_SIZE}.${PARALLELISM}.xml" http://localhost:3030/bsbm/query -u http://localhost:3030/bsbm/update -udataset "explore-update-${DATASET_SIZE}.nt" #./testdriver -mt ${PARALLELISM} -ucf usecases/businessIntelligence/sparql.txt -o "../bsbm.businessIntelligence.jena.${VERSION}.${DATASET_SIZE}.${PARALLELISM}.xml" http://localhost:3030/bsbm/query kill $! -rm "explore-${DATASET_SIZE}.nt" -rm "explore-update-${DATASET_SIZE}.nt" -rm -r td_data -rm -r run -rm -r apache-jena-${VERSION} -rm -r apache-jena-fuseki-${VERSION} +rm -f "explore-${DATASET_SIZE}.nt" +rm -f "explore-update-${DATASET_SIZE}.nt" +rm -rf td_data +rm -rf run +rm -rf apache-jena-${VERSION} +rm -rf apache-jena-fuseki-${VERSION} diff --git a/bench/bsbm_oxigraph.sh b/bench/bsbm_oxigraph.sh index 844b662a..7ee691cb 100755 --- a/bench/bsbm_oxigraph.sh +++ b/bench/bsbm_oxigraph.sh @@ -2,6 +2,8 @@ DATASET_SIZE=100000 # number of products in the dataset. There is around 350 triples generated by product. PARALLELISM=16 + +set -eu cd bsbm-tools ./generate -fc -pc ${DATASET_SIZE} -s nt -fn "explore-${DATASET_SIZE}" -ud -ufn "explore-update-${DATASET_SIZE}" cargo build --release --manifest-path="../../server/Cargo.toml" @@ -13,7 +15,7 @@ sleep 1 ./testdriver -mt ${PARALLELISM} -ucf usecases/exploreAndUpdate/sparql.txt -o "../bsbm.exploreAndUpdate.oxigraph.${VERSION}.${DATASET_SIZE}.${PARALLELISM}.xml" http://127.0.0.1:7878/query -u http://127.0.0.1:7878/update -udataset "explore-update-${DATASET_SIZE}.nt" #./testdriver -mt ${PARALLELISM} -ucf usecases/businessIntelligence/sparql.txt -o "../bsbm.businessIntelligence.${VERSION}.${DATASET_SIZE}.${PARALLELISM}.xml" "http://127.0.0.1:7878/query" kill $! -rm -r oxigraph_data -rm "explore-${DATASET_SIZE}.nt" -rm "explore-update-${DATASET_SIZE}.nt" -rm -r td_data +rm -rf oxigraph_data +rm -f "explore-${DATASET_SIZE}.nt" +rm -f "explore-update-${DATASET_SIZE}.nt" +rm -rf td_data diff --git a/bench/bsbm_rdf4j.sh b/bench/bsbm_rdf4j.sh index a88e785e..6592b65f 100755 --- a/bench/bsbm_rdf4j.sh +++ b/bench/bsbm_rdf4j.sh @@ -4,6 +4,8 @@ DATASET_SIZE=100000 PARALLELISM=16 VERSION="4.2.2" TOMCAT_VERSION="9.0.71" + +set -eu wget -nc -O "rdf4j-${VERSION}.zip" "https://www.eclipse.org/downloads/download.php?file=/rdf4j/eclipse-rdf4j-${VERSION}-sdk.zip&mirror_id=1" wget -nc -O "tomcat-${TOMCAT_VERSION}.zip" "https://dlcdn.apache.org/tomcat/tomcat-9/v${TOMCAT_VERSION}/bin/apache-tomcat-${TOMCAT_VERSION}.zip" cd bsbm-tools || exit @@ -40,8 +42,8 @@ curl -f -X PUT -H 'Content-Type:application/n-triples' -T "explore-${DATASET_SIZ ./testdriver -mt ${PARALLELISM} -ucf usecases/exploreAndUpdate/sparql.txt -o "../bsbm.exploreAndUpdate.rdf4j-lmdb.${VERSION}.${DATASET_SIZE}.${PARALLELISM}.xml" http://localhost:8080/rdf4j-server/repositories/bsbm -u http://localhost:8080/rdf4j-server/repositories/bsbm/statements -udataset "explore-update-${DATASET_SIZE}.nt" #./testdriver -mt ${PARALLELISM} -ucf usecases/businessIntelligence/sparql.txt -o "../bsbm.businessIntelligence.rdf4j-lmdb.${VERSION}.${DATASET_SIZE}.${PARALLELISM}.xml" http://localhost:8080/rdf4j-server/repositories/bsbm "${CATALINA_HOME}"/bin/shutdown.sh -rm "explore-${DATASET_SIZE}.nt" -rm "explore-update-${DATASET_SIZE}.nt" -rm -r td_data -rm -r "eclipse-rdf4j-${VERSION}" -rm -r "apache-tomcat-${TOMCAT_VERSION}" +rm -f "explore-${DATASET_SIZE}.nt" +rm -f "explore-update-${DATASET_SIZE}.nt" +rm -rf td_data +rm -rf "eclipse-rdf4j-${VERSION}" +rm -rf "apache-tomcat-${TOMCAT_VERSION}" diff --git a/bench/bsbm_virtuoso.sh b/bench/bsbm_virtuoso.sh index 60ef533e..2ff9b405 100755 --- a/bench/bsbm_virtuoso.sh +++ b/bench/bsbm_virtuoso.sh @@ -3,6 +3,8 @@ DATASET_SIZE=100000 # number of products in the dataset. There is around 350 triples generated by product. PARALLELISM=16 VERSION="7.2.5" + +set -eu cd bsbm-tools ./generate -fc -pc ${DATASET_SIZE} -s nt -fn "explore-${DATASET_SIZE}" -ud -ufn "explore-update-${DATASET_SIZE}" cp ../virtuoso-opensource/database/virtuoso.ini.sample virtuoso.ini @@ -18,7 +20,7 @@ EOF # ./testdriver -mt ${PARALLELISM} -ucf usecases/exploreAndUpdate/sparql.txt -o "../bsbm.exploreAndUpdate.virtuoso.${DATASET_SIZE}.${PARALLELISM}.${PARALLELISM}.${VERSION}.xml" 'http://localhost:8890/sparql?graph-uri=urn:graph:test' -u 'http://dba:dba@localhost:8890/sparql-auth?graph-uri=urn:graph:test' -udataset "explore-update-${DATASET_SIZE}.nt" # ./testdriver -mt ${PARALLELISM} -ucf usecases/businessIntelligence/sparql.txt -o "../bsbm.businessIntelligence.virtuoso.${VERSION}.${DATASET_SIZE}.${PARALLELISM}.xml" 'http://localhost:8890/sparql?graph-uri=urn:graph:test' kill $! -rm -r ../database -rm "explore-${DATASET_SIZE}.nt" -rm "explore-update-${DATASET_SIZE}.nt" -rm -r td_data +rm -rf ../database +rm -f "explore-${DATASET_SIZE}.nt" +rm -f "explore-update-${DATASET_SIZE}.nt" +rm -rf td_data