memgraph/tests/public_benchmark/ldbc/setup_dependencies
Teon Banek 77e574fcc5 Cleanup some errors in ldbc setup scripts
Summary:
Don't require setup_system to run as root, nor apt-get
Implement command_fail for ldbc/setup_dependencies
ldbc.setup_dataset: Find Java on ArchLinux

Reviewers: buda, mferencevic

Reviewed By: buda

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D729
2017-09-01 14:13:34 +02:00

51 lines
1.3 KiB
Bash
Executable File

#!/bin/bash
# Setup all dependencies
function command_fail {
echo $1
exit 1
}
script_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
# Setup ldbc_snb_datagen
cd ${script_dir}
git clone https://github.com/ldbc/ldbc_snb_datagen
# Setup ldbc_driver
cd ${script_dir}
git clone https://github.com/ldbc/ldbc_driver.git
cd ${script_dir}/ldbc_driver
mvn clean package -DskipTests || exit 1
mvn install -DskipTests || exit 1
# Setup ldbc-snb-impls
cd ${script_dir}
git clone https://phabricator.memgraph.io/source/ldbc-snb-impls.git
cp ${script_dir}/ldbc-snb-impls-pom.xml ${script_dir}/ldbc-snb-impls/pom.xml
cd ${script_dir}/ldbc-snb-impls
mvn install || exit 1
# Use set -e after we have called git clone, to avoid exiting if we already
# cloned something.
set -e
# Setup python virtual environment & Install dependencies
cd ${script_dir}
if ! which virtualenv > /dev/null 2>&1; then
command_fail "Please install virtualenv!"
fi
if [ ! -d "ve3" ]; then
virtualenv -p python3 ve3 || command_fail "Virtualenv setup failed."
fi
source ve3/bin/activate
pip install -r ${script_dir}/requirements_3.txt
deactivate
if [ ! -d "ve2" ]; then
virtualenv -p python2 ve2 || command_fail "Virtualenv setup failed."
fi
source ve2/bin/activate
pip install -r ${script_dir}/requirements_2.txt
deactivate