Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
neoppod
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Levin Zimmermann
neoppod
Commits
e7a3f20b
Commit
e7a3f20b
authored
Sep 05, 2017
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
fb997890
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
85 additions
and
62 deletions
+85
-62
go/neo/t/t.sh
go/neo/t/t.sh
+85
-62
No files found.
go/neo/t/t.sh
View file @
e7a3f20b
#!/bin/bash -e
#!/bin/bash -e
# run
1 mixed py/go NEO cluster
# run
tests and benchmarks against FileStorage, ZEO and various NEO/py{sql,sqlite}, NEO/go clusters
# port allocations
# port allocations
Abind
=
127.0.0.1:5551
Abind
=
127.0.0.1:5551
...
@@ -7,19 +7,32 @@ Mbind=127.0.0.1:5552
...
@@ -7,19 +7,32 @@ Mbind=127.0.0.1:5552
Sbind
=
127.0.0.1:5553
Sbind
=
127.0.0.1:5553
Zbind
=
127.0.0.1:5554
Zbind
=
127.0.0.1:5554
# disk allocation
log
=
`
pwd
`
/log
;
mkdir
-p
$log
var
=
`
pwd
`
/var
;
mkdir
-p
$var
fs1
=
$var
/fs1
;
mkdir
-p
$fs1
# FileStorage (and so ZEO and NEO/go) data
neolite
=
$var
/neo.sqlite
# NEO/py: sqlite
neosql
=
$var
/neo.sql
;
mkdir
-p
$neosql
# NEO/py: mariadb
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
# logs
# control started NEO cluster
log
=
`
pwd
`
/log
mkdir
-p
$log
xneoctl
()
{
xneoctl
()
{
neoctl
-a
$Abind
$@
neoctl
-a
$Abind
"
$@
"
}
# control started MariaDB
xmysql
()
{
mysql
--defaults-file
=
$mycnf
"
$@
"
}
}
# M{py,go}
# spawn master
# ---- start NEO nodes ----
# M{py,go} ... - spawn master
Mpy
()
{
Mpy
()
{
# XXX --autostart=1 ?
# XXX --autostart=1 ?
exec
-a
Mpy
\
exec
-a
Mpy
\
...
@@ -31,8 +44,7 @@ Mgo() {
...
@@ -31,8 +44,7 @@ Mgo() {
neo
--log_dir
=
$log
master
-cluster
=
$cluster
-bind
=
$Mbind
neo
--log_dir
=
$log
master
-cluster
=
$cluster
-bind
=
$Mbind
}
}
# Spy ...
# Spy ... - spawn NEO/py storage
# spawn storage
Spy
()
{
Spy
()
{
# --adapter=...
# --adapter=...
# --database=...
# --database=...
...
@@ -41,62 +53,55 @@ Spy() {
...
@@ -41,62 +53,55 @@ Spy() {
neostorage
--cluster
=
$cluster
--bind
=
$Sbind
--masters
=
$Mbind
--logfile
=
$log
/Spy.log
$@
&
neostorage
--cluster
=
$cluster
--bind
=
$Sbind
--masters
=
$Mbind
--logfile
=
$log
/Spy.log
$@
&
}
}
# Sgo <data.fs>
# Sgo <data.fs> - spawn NEO/go storage
# spawn storage
Sgo
()
{
Sgo
()
{
exec
-a
Sgo
\
exec
-a
Sgo
\
neo
-log_dir
=
$log
-alsologtostderr
storage
-cluster
=
$cluster
-bind
=
$Sbind
-masters
=
$Mbind
$@
&
neo
-log_dir
=
$log
-alsologtostderr
storage
-cluster
=
$cluster
-bind
=
$Sbind
-masters
=
$Mbind
$@
&
}
}
# Apy
# Apy ... - spawn NEO/py admin
# spawn admin
Apy
()
{
Apy
()
{
exec
-a
Apy
\
exec
-a
Apy
\
neoadmin
--cluster
=
$cluster
--bind
=
$Abind
--masters
=
$Mbind
$@
&
neoadmin
--cluster
=
$cluster
--bind
=
$Abind
--masters
=
$Mbind
$@
&
}
}
# Zpy <data.fs>
# Zpy <data.fs> ... - spawn ZEO
# spawn zeo
Zpy
()
{
Zpy
()
{
exec
-a
Zpy
\
exec
-a
Zpy
\
runzeo
--address
$Zbind
--filename
$@
2>>
$log
/Zpy.log &
runzeo
--address
$Zbind
--filename
$@
2>>
$log
/Zpy.log &
}
}
# ---- generate test data ----
# ---- start NEO clusters ----
var
=
`
pwd
`
/var
mkdir
-p
$var
# generate data with many small (4K) objects
export
WENDELIN_CORE_ZBLK_FMT
=
ZBlk1
work
=
128
# array size generated (MB)
# generate data in data.fs
# spawn NEO/go cluster (Sgo+Mpy+Apy) working on data.fs
fs1
=
$var
/fs1
NEOgo
()
{
mkdir
-p
$fs1
Mpy
--autostart
=
1
genfs
()
{
Sgo
$fs1
/data.fs
demo-zbigarray
--worksize
=
$work
gen
$fs1
/data.fs
Apy
sync
}
}
# spawn NEO/py cluster working on sqlite db
# spawn NEO/py cluster working on sqlite db
neolite
=
$var
/neo.sqlite
NEOpylite
()
{
neopylite
()
{
Mpy
--autostart
=
1
Mpy
--autostart
=
1
Spy
--adapter
=
SQLite
--database
=
$neolite
Spy
--adapter
=
SQLite
--database
=
$neolite
Apy
Apy
}
}
# spawn NEO/py cluster working on InnoDB
# spawn neo/py cluster working on mariadb
neosql
=
$var
/neo.sql
NEOpysql
()
{
mkdir
-p
$neosql
MDB
sleep
1
# XXX fragile
xmysql
-e
"CREATE DATABASE IF NOT EXISTS neo"
Mpy
--autostart
=
1
Spy
--adapter
=
MySQL
--engine
=
InnoDB
--database
=
root@neo
$mysock
Apy
}
# setup/spawn mariadb
# setup/spawn mariadb
mycnf
=
$neosql
/mariadb.cnf
mysock
=
$(
realpath
$neosql
)
/my.sock
MDB
()
{
MDB
()
{
cat
>
$mycnf
<<
EOF
cat
>
$mycnf
<<
EOF
[mysqld]
[mysqld]
...
@@ -153,41 +158,59 @@ EOF
...
@@ -153,41 +158,59 @@ EOF
mysqld
--defaults-file
=
$mycnf
--log-error
=
$log
/mdb.log &
mysqld
--defaults-file
=
$mycnf
--log-error
=
$log
/mdb.log &
}
}
xmysql
()
{
# ---- generate test data ----
mysql
--defaults-file
=
$mycnf
"
$@
"
}
# spawn neo/py cluster working on mariadb
# generate data with many small (4K) objects
neopysql
()
{
export
WENDELIN_CORE_ZBLK_FMT
=
ZBlk1
MDB
sleep
1
# XXX fragile
xmysql
-e
"CREATE DATABASE IF NOT EXISTS neo"
Mpy
--autostart
=
1
# XXX 32 temp - raise
Spy
--adapter
=
MySQL
--engine
=
InnoDB
--database
=
root@neo
$mysock
work
=
32
# array size generated (MB)
Apy
# generate data in data.fs
GENfs
()
{
test
-e
$var
/generated.fs
&&
return
echo
-e
'\n*** generating fs1 data...'
demo-zbigarray
--worksize
=
$work
gen
$fs1
/data.fs
sync
touch
$var
/generated.fs
}
# generate data in sqlite
GENsqlite
()
{
test
-e
$var
/generated.sqlite
&&
return
echo
-e
'\n*** generating sqlite data...'
NEOpylite
demo-zbigarray
--worksize
=
$work
gen neo://
$cluster
@
$Mbind
xneoctl
set
cluster stopping
wait
# XXX fragile - won't work if there are childs spawned outside
sync
touch
$var
/generated.sqlite
}
}
# generate data in mariadb
# generate data in mariadb
gensql
()
{
GENsql
()
{
neopysql
test
-e
$var
/generated.sql
&&
return
echo
-e
'\n*** generating sql data...'
NEOpysql
demo-zbigarray
--worksize
=
$work
gen neo://
$cluster
@
$Mbind
demo-zbigarray
--worksize
=
$work
gen neo://
$cluster
@
$Mbind
xneoctl
set
cluster stopping
xneoctl
set
cluster stopping
sleep
1
# XXX fragile
sleep
1
# XXX fragile
xmysql
-e
"SHUTDOWN"
xmysql
-e
"SHUTDOWN"
wait
# XXX fragile
wait
# XXX fragile
sync
sync
touch
$var
/generated.sql
}
}
# generate data in data.sqlite
# ---- main driver ----
gensqlite
()
{
neopylite
GENfs
demo-zbigarray
--worksize
=
$work
gen neo://
$cluster
@
$Mbind
GENsqlite
xneoctl
set
cluster stopping
GENsql
wait
# XXX fragile - won't work if there are childs spawned outside
sync
echo
ZZZ
}
wait
exit
#genfs
#genfs
...
@@ -205,15 +228,15 @@ gensqlite() {
...
@@ -205,15 +228,15 @@ gensqlite() {
#gensql
#gensql
#
neopylite
neopylite
neopysql
#
neopysql
#time demo-zbigarray read neo://$cluster@$Mbind
#time demo-zbigarray read neo://$cluster@$Mbind
for
i
in
`
seq
2
`
;
do
for
i
in
`
seq
2
`
;
do
./zsha1.py neo://
$cluster
@
$Mbind
./zsha1.py neo://
$cluster
@
$Mbind
go run zsha1.go neo://
$cluster
@
$Mbind
go run zsha1.go neo://
$cluster
@
$Mbind
done
done
xneoctl
set
cluster stopping
xneoctl
set
cluster stopping
xmysql
-e
"SHUTDOWN"
#
xmysql -e "SHUTDOWN"
wait
wait
exit
exit
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment