memgraph/tests/public_benchmark/ldbc/setup_system
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

38 lines
1.2 KiB
Bash
Executable File

#!/bin/bash
# System setup (root access is required)
# Working directories
set -e
script_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
mkdir -p ${script_dir}/tmp
# Install OS packages
cd ${script_dir}/tmp
if which apt-get > /dev/null 2>&1; then
wget -O - http://debian.neo4j.org/neotechnology.gpg.key >> key.pgp || exit 1
sudo apt-key add key.pgp || exit 1
sudo echo 'deb http://debian.neo4j.org/repo stable/' | tee -a /etc/apt/sources.list.d/neo4j.list > /dev/null || exit 1
sudo apt-get update || exit 1
sudo apt-get install -y maven default-jdk neo4j || exit 1
else
echo "Assuming that 'maven', 'jdk' and 'neo4j' are installed"
fi
# Install Hadoop
cd ${script_dir}/tmp
hadoop_version="hadoop-2.7.3"
hadoop_tar="${hadoop_version}.tar.gz"
hadoop_url="http://apache.mirrors.tds.net/hadoop/common/${hadoop_version}/${hadoop_tar}"
wget ${hadoop_url}
tar -xzf ${hadoop_tar}
# TODO: root access is required here -> run hadoop under a current user
echo "Moving hadoop to /usr/local/hadoop"
sudo mv ${hadoop_version} /usr/local/hadoop
# Performance Setup
# echo performance | sudo tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor >/dev/null
# Cleanup
rm -rf ${script_dir}/tmp