install scripts updated; MemgraphRunner -> gqlalchemy.MemgraphInstanceRunner
This commit is contained in:
18
init
18
init
@@ -111,22 +111,10 @@ if [[ "$setup_libs" == "true" ]]; then
|
|||||||
cd ..
|
cd ..
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# setup gql_behave dependencies
|
|
||||||
setup_virtualenv tests/gql_behave
|
|
||||||
|
|
||||||
# setup stress dependencies
|
|
||||||
setup_virtualenv tests/stress
|
|
||||||
|
|
||||||
# setup integration/ldap dependencies
|
|
||||||
setup_virtualenv tests/integration/ldap
|
|
||||||
|
|
||||||
# Setup tests dependencies.
|
# Setup tests dependencies.
|
||||||
# cd tests
|
cd tests
|
||||||
# ./setup.sh
|
./setup.sh
|
||||||
# cd ..
|
cd ..
|
||||||
# TODO(gitbuda): Remove setup_virtualenv, replace it with tests/ve3. Take care
|
|
||||||
# of the build order because tests/setup.py builds pymgclient which depends on
|
|
||||||
# mgclient which is build after this script by calling make.
|
|
||||||
|
|
||||||
echo "Done installing dependencies for Memgraph"
|
echo "Done installing dependencies for Memgraph"
|
||||||
|
|
||||||
|
|||||||
@@ -122,6 +122,7 @@ declare -A primary_urls=(
|
|||||||
["protobuf"]="http://$local_cache_host/git/protobuf.git"
|
["protobuf"]="http://$local_cache_host/git/protobuf.git"
|
||||||
["pulsar"]="http://$local_cache_host/git/pulsar.git"
|
["pulsar"]="http://$local_cache_host/git/pulsar.git"
|
||||||
["librdtsc"]="http://$local_cache_host/git/librdtsc.git"
|
["librdtsc"]="http://$local_cache_host/git/librdtsc.git"
|
||||||
|
["gqlalchemy"]="http://$local_cache_host/git/gqlalchemy.git"
|
||||||
)
|
)
|
||||||
|
|
||||||
# The goal of secondary urls is to have links to the "source of truth" of
|
# The goal of secondary urls is to have links to the "source of truth" of
|
||||||
@@ -147,6 +148,7 @@ declare -A secondary_urls=(
|
|||||||
["protobuf"]="https://github.com/protocolbuffers/protobuf.git"
|
["protobuf"]="https://github.com/protocolbuffers/protobuf.git"
|
||||||
["pulsar"]="https://github.com/apache/pulsar.git"
|
["pulsar"]="https://github.com/apache/pulsar.git"
|
||||||
["librdtsc"]="https://github.com/gabrieleara/librdtsc.git"
|
["librdtsc"]="https://github.com/gabrieleara/librdtsc.git"
|
||||||
|
["gqlalchemy"]="http://github.com/memgraph/gqlalchemy.git"
|
||||||
)
|
)
|
||||||
|
|
||||||
# antlr
|
# antlr
|
||||||
@@ -199,7 +201,7 @@ git apply ../rocksdb.patch
|
|||||||
popd
|
popd
|
||||||
|
|
||||||
# mgclient
|
# mgclient
|
||||||
mgclient_tag="96e95c6845463cbe88948392be58d26da0d5ffd3" # (2022-02-08)
|
mgclient_tag="v1.3.0" # (2022-02-08)
|
||||||
repo_clone_try_double "${primary_urls[mgclient]}" "${secondary_urls[mgclient]}" "mgclient" "$mgclient_tag"
|
repo_clone_try_double "${primary_urls[mgclient]}" "${secondary_urls[mgclient]}" "mgclient" "$mgclient_tag"
|
||||||
sed -i 's/\${CMAKE_INSTALL_LIBDIR}/lib/' mgclient/src/CMakeLists.txt
|
sed -i 's/\${CMAKE_INSTALL_LIBDIR}/lib/' mgclient/src/CMakeLists.txt
|
||||||
|
|
||||||
@@ -238,3 +240,10 @@ repo_clone_try_double "${primary_urls[librdtsc]}" "${secondary_urls[librdtsc]}"
|
|||||||
pushd librdtsc
|
pushd librdtsc
|
||||||
git apply ../librdtsc.patch
|
git apply ../librdtsc.patch
|
||||||
popd
|
popd
|
||||||
|
|
||||||
|
#gqlalchemy
|
||||||
|
gqlalchemy_tag="v1.2.0"
|
||||||
|
repo_clone_try_double "${primary_urls[gqlalchemy]}" "${secondary_urls[gqlalchemy]}" "gqlalchemy" "$gqlalchemy_tag" true
|
||||||
|
pushd gqlalchemy
|
||||||
|
git apply ../gqlalchemy.patch
|
||||||
|
popd
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ import subprocess
|
|||||||
import tempfile
|
import tempfile
|
||||||
import yaml
|
import yaml
|
||||||
|
|
||||||
from gqlalchemy import wait_for_port
|
from gqlalchemy import wait_for_port, MemgraphInstanceBinary
|
||||||
|
|
||||||
|
|
||||||
SCRIPT_DIR = os.path.dirname(os.path.realpath(__file__))
|
SCRIPT_DIR = os.path.dirname(os.path.realpath(__file__))
|
||||||
@@ -76,41 +76,6 @@ def generate_result_html(data):
|
|||||||
return ret
|
return ret
|
||||||
|
|
||||||
|
|
||||||
class MemgraphRunner():
|
|
||||||
def __init__(self, build_directory):
|
|
||||||
self.build_directory = build_directory
|
|
||||||
self.proc_mg = None
|
|
||||||
self.args = []
|
|
||||||
|
|
||||||
def start(self, args=[]):
|
|
||||||
if args == self.args and self.is_running():
|
|
||||||
return
|
|
||||||
|
|
||||||
self.stop()
|
|
||||||
self.args = copy.deepcopy(args)
|
|
||||||
|
|
||||||
self.data_directory = tempfile.TemporaryDirectory()
|
|
||||||
memgraph_binary = os.path.join(self.build_directory, "memgraph")
|
|
||||||
args_mg = [memgraph_binary, "--storage-properties-on-edges",
|
|
||||||
"--data-directory", self.data_directory.name]
|
|
||||||
self.proc_mg = subprocess.Popen(args_mg + self.args)
|
|
||||||
wait_for_port(port=7687, delay=1)
|
|
||||||
assert self.is_running(), "The Memgraph process died!"
|
|
||||||
|
|
||||||
def is_running(self):
|
|
||||||
if self.proc_mg is None:
|
|
||||||
return False
|
|
||||||
if self.proc_mg.poll() is not None:
|
|
||||||
return False
|
|
||||||
return True
|
|
||||||
|
|
||||||
def stop(self):
|
|
||||||
if not self.is_running():
|
|
||||||
return
|
|
||||||
self.proc_mg.terminate()
|
|
||||||
code = self.proc_mg.wait()
|
|
||||||
assert code == 0, "The Memgraph process exited with non-zero!"
|
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
# Parse args
|
# Parse args
|
||||||
@@ -130,7 +95,7 @@ def main():
|
|||||||
output_dir = tempfile.TemporaryDirectory()
|
output_dir = tempfile.TemporaryDirectory()
|
||||||
|
|
||||||
# Memgraph runner
|
# Memgraph runner
|
||||||
memgraph = MemgraphRunner(args.build_directory)
|
memgraph = MemgraphInstanceBinary(args.build_directory)
|
||||||
|
|
||||||
@atexit.register
|
@atexit.register
|
||||||
def cleanup():
|
def cleanup():
|
||||||
|
|||||||
@@ -6,12 +6,14 @@ set -Eeuo pipefail
|
|||||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||||
PIP_DEPS=(
|
PIP_DEPS=(
|
||||||
"behave==1.2.6"
|
"behave==1.2.6"
|
||||||
|
"gqlalchemy==1.2.0"
|
||||||
"ldap3==2.6"
|
"ldap3==2.6"
|
||||||
"kafka-python==2.0.2"
|
"kafka-python==2.0.2"
|
||||||
"requests==2.25.1"
|
"requests==2.25.1"
|
||||||
"neo4j-driver==4.1.1"
|
"neo4j-driver==4.1.1"
|
||||||
"parse==1.18.0"
|
"parse==1.18.0"
|
||||||
"parse-type==0.5.2"
|
"parse-type==0.5.2"
|
||||||
|
"pymgclient=1.2.0"
|
||||||
"pytest==6.2.3"
|
"pytest==6.2.3"
|
||||||
"pyyaml==5.4.1"
|
"pyyaml==5.4.1"
|
||||||
"six==1.15.0"
|
"six==1.15.0"
|
||||||
@@ -46,12 +48,4 @@ for pkg in "${PIP_DEPS[@]}"; do
|
|||||||
pip --timeout 1000 install "$pkg"
|
pip --timeout 1000 install "$pkg"
|
||||||
done
|
done
|
||||||
|
|
||||||
# Install mgclient from source becasue of full flexibility.
|
|
||||||
pushd "$DIR/../libs/pymgclient" > /dev/null
|
|
||||||
export MGCLIENT_INCLUDE_DIR="$DIR/../libs/mgclient/include"
|
|
||||||
export MGCLIENT_LIB_DIR="$DIR/../libs/mgclient/lib"
|
|
||||||
CFLAGS="-std=c99" python3 setup.py build
|
|
||||||
CFLAGS="-std=c99" python3 setup.py install
|
|
||||||
popd > /dev/null
|
|
||||||
|
|
||||||
deactivate
|
deactivate
|
||||||
|
|||||||
Reference in New Issue
Block a user