Commit 58e7d04b authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 42e5fe71
#!/bin/bash -e #!/bin/bash -e
# neotest: run tests and benchmarks against FileStorage, ZEO and various NEO/py{sql,sqlite}, NEO/go clusters # neotest: run tests and benchmarks against FileStorage, ZEO and various NEO/py{sql,sqlite}, NEO/go clusters
# Copyright (C) 2017 Nexedi SA and Contributors.
# Kirill Smelkov <kirr@nexedi.com>
#
# This program is free software: you can Use, Study, Modify and Redistribute
# it under the terms of the GNU General Public License version 3, or (at your
# option) any later version, as published by the Free Software Foundation.
#
# You can also Link and Combine this program with other software covered by
# the terms of any of the Free Software licenses or any of the Open Source
# Initiative approved licenses and Convey the resulting work. Corresponding
# source of such a combination shall include the source code for all other
# software used.
#
# This program is distributed WITHOUT ANY WARRANTY; without even the implied
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
#
# See COPYING file for full licensing terms.
# See https://www.nexedi.com/licensing for rationale and options.
# ---- deploy NEO for tests/benchmarks at a node ---- # ---- deploy NEO for tests/benchmarks at a node ----
die() { die() {
...@@ -19,7 +38,7 @@ cmd_deploy() { ...@@ -19,7 +38,7 @@ cmd_deploy() {
ssh $host ./neotest deploy-local "$path" ssh $host ./neotest deploy-local "$path"
} }
# cmd_deploy_local <path> - deploy NEO & needed software for tests @path # cmd_deploy-local <path> - deploy NEO & needed software for tests @path
cmd_deploy_local() { cmd_deploy_local() {
path=$1 path=$1
test -z "$path" && die "Usage: neotest deploy-local <path>" test -z "$path" && die "Usage: neotest deploy-local <path>"
...@@ -30,6 +49,7 @@ cmd_deploy_local() { ...@@ -30,6 +49,7 @@ cmd_deploy_local() {
# python part # python part
virtualenv venv virtualenv venv
# env.sh for deployment
cat >env.sh << 'EOF' cat >env.sh << 'EOF'
X=${1:-${BASH_SOURCE[0]}} # path to original env.sh is explicitly passed X=${1:-${BASH_SOURCE[0]}} # path to original env.sh is explicitly passed
X=$(cd `dirname $X` && pwd) # when there is other env.sh wrapping us X=$(cd `dirname $X` && pwd) # when there is other env.sh wrapping us
...@@ -93,15 +113,10 @@ EOF ...@@ -93,15 +113,10 @@ EOF
# jump to deploy early if we have to # jump to deploy early if we have to
case "$1" in case "$1" in
deploy) deploy|deploy-local)
shift cmd="$1"
cmd_deploy "$@"
exit
;;
deploy-local)
shift shift
cmd_deploy_local "$@" cmd_$cmd "$@"
exit exit
;; ;;
esac esac
...@@ -124,29 +139,34 @@ $@ ...@@ -124,29 +139,34 @@ $@
# ---------------------------------------- # ----------------------------------------
# XXX neo/py, wendelin.core, ... - must be pip install'ed # NOTE neo/py, wendelin.core, ... - must be pip install'ed - `neotest deploy` cares about that
# XXX neo/py: run via relative path to neomaster? (../../neo/neomaster) so we do not need to `pip install -e` ?
# local external address IPv4 or IPv6 # init_net - initialize networking
myaddr=$(getent hosts `hostname` |grep -v 127.0 |awk '{print $1}') init_net() {
# local our external address IPv4 or IPv6
myaddr=$(getent hosts `hostname` |grep -v 127.0 |awk '{print $1}')
test -n "$myaddr" || die "init_net: cannot determiny my network address"
# port allocations ([] works for IPv4 too) # port allocations ([] works for IPv4 too)
Abind=[$myaddr]:5551 # NEO admin Abind=[$myaddr]:5551 # NEO admin
Mbind=[$myaddr]:5552 # NEO master Mbind=[$myaddr]:5552 # NEO master
Zbind=[$myaddr]:5553 # ZEO Zbind=[$myaddr]:5553 # ZEO
# NEO storage. bind not strictly needed but we make sure no 2 storages are # NEO storage. bind not strictly needed but we make sure no 2 storages are
# started at the same time # started at the same time
Sbind=[$myaddr]:5554 Sbind=[$myaddr]:5554
}
# disk allocation # init_fs - do initial disk allocations
log=`pwd`/log; mkdir -p $log init_fs() {
var=`pwd`/var; mkdir -p $var log=`pwd`/log; mkdir -p $log
fs1=$var/fs1; mkdir -p $fs1 # FileStorage (and so ZEO and NEO/go) data var=`pwd`/var; mkdir -p $var
neolite=$var/neo.sqlite # NEO/py: sqlite fs1=$var/fs1; mkdir -p $fs1 # FileStorage (and so ZEO and NEO/go) data
neosql=$var/neo.sql; mkdir -p $neosql # NEO/py: mariadb neolite=$var/neo.sqlite # NEO/py: sqlite
mycnf=$neosql/mariadb.cnf # NEO/py: mariadb config neosql=$var/neo.sql; mkdir -p $neosql # NEO/py: mariadb
mysock=$(realpath $neosql)/my.sock # NEO/py: mariadb socket mycnf=$neosql/mariadb.cnf # NEO/py: mariadb config
mysock=$(realpath $neosql)/my.sock # NEO/py: mariadb socket
}
# cluster name # cluster name
cluster=pygotest cluster=pygotest
...@@ -176,7 +196,7 @@ jobs -l ...@@ -176,7 +196,7 @@ jobs -l
kill $j' EXIT kill $j' EXIT
} }
# ---- start NEO nodes ---- # ---- start NEO/ZEO nodes ----
# M{py,go} ... - spawn master # M{py,go} ... - spawn master
Mpy() { Mpy() {
...@@ -782,6 +802,7 @@ cmd_run-client() { ...@@ -782,6 +802,7 @@ cmd_run-client() {
# command: print information about local node # command: print information about local node
cmd_info-local() { cmd_info-local() {
init_net
header header
} }
...@@ -851,6 +872,10 @@ esac ...@@ -851,6 +872,10 @@ esac
go install -v lab.nexedi.com/kirr/neo/go/... go install -v lab.nexedi.com/kirr/neo/go/...
go build -o zhash_go zhash.go go build -o zhash_go zhash.go
# setup network & fs environment
init_net
init_fs
# run the command # run the command
cmd="$1" cmd="$1"
shift shift
......
// zhash - compute hash of whole latest objects stream in a ZODB database // Copyright (C) 2017 Nexedi SA and Contributors.
// Kirill Smelkov <kirr@nexedi.com>
//
// This program is free software: you can Use, Study, Modify and Redistribute
// it under the terms of the GNU General Public License version 3, or (at your
// option) any later version, as published by the Free Software Foundation.
//
// You can also Link and Combine this program with other software covered by
// the terms of any of the Free Software licenses or any of the Open Source
// Initiative approved licenses and Convey the resulting work. Corresponding
// source of such a combination shall include the source code for all other
// software used.
//
// This program is distributed WITHOUT ANY WARRANTY; without even the implied
// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
//
// See COPYING file for full licensing terms.
// See https://www.nexedi.com/licensing for rationale and options.
// +build ignore // +build ignore
// zhash - compute hash of whole latest objects stream in a ZODB database
package main package main
import ( import (
......
#!/usr/bin/env python #!/usr/bin/env python
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# Copyright (C) 2017 Nexedi SA and Contributors.
# Kirill Smelkov <kirr@nexedi.com>
#
# This program is free software: you can Use, Study, Modify and Redistribute
# it under the terms of the GNU General Public License version 3, or (at your
# option) any later version, as published by the Free Software Foundation.
#
# You can also Link and Combine this program with other software covered by
# the terms of any of the Free Software licenses or any of the Open Source
# Initiative approved licenses and Convey the resulting work. Corresponding
# source of such a combination shall include the source code for all other
# software used.
#
# This program is distributed WITHOUT ANY WARRANTY; without even the implied
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
#
# See COPYING file for full licensing terms.
# See https://www.nexedi.com/licensing for rationale and options.
"""zhash - compute hash of whole latest objects stream in a ZODB database""" """zhash - compute hash of whole latest objects stream in a ZODB database"""
from __future__ import print_function from __future__ import print_function
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment