2019-08-10 16:43:37 +00:00
|
|
|
#!/dev/null
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
::// *
|
|
|
|
|
|
|
|
::// execute / ...
|
|
|
|
::// benchmark / ...
|
2019-08-10 17:49:04 +00:00
|
|
|
::// examples / ...
|
2019-08-10 16:43:37 +00:00
|
|
|
::// documentation / ...
|
|
|
|
::// workspace / ...
|
|
|
|
|
|
|
|
::// go / build / ...
|
|
|
|
::// go / dependencies / ...
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-08-13 06:49:54 +00:00
|
|
|
++<< execute / server / debug
|
2019-08-10 16:43:37 +00:00
|
|
|
"${ZRUN[@]}" ':: go / build / server / debug'
|
2019-08-12 11:39:41 +00:00
|
|
|
exec -- env -i -- ./.outputs/binaries/debug/kawipiko-server "${@}"
|
2019-08-10 16:43:37 +00:00
|
|
|
!!
|
|
|
|
|
|
|
|
<< execute / server / release
|
|
|
|
"${ZRUN[@]}" ':: go / build / server / release'
|
2019-08-12 11:39:41 +00:00
|
|
|
exec -- env -i -- ./.outputs/binaries/release/kawipiko-server "${@}"
|
2019-08-10 16:43:37 +00:00
|
|
|
!!
|
|
|
|
|
|
|
|
|
|
|
|
<< go / build / server / debug
|
|
|
|
test "${#}" -eq 0
|
|
|
|
_outputs="$( exec -- readlink -e -- ./.outputs )"
|
|
|
|
mkdir -p -- "${_outputs}/binaries/debug"
|
2019-08-12 11:39:41 +00:00
|
|
|
rm -f -- "${_outputs}/binaries/debug/kawipiko-server"
|
2019-08-10 16:43:37 +00:00
|
|
|
exec -- "${ZRUN[@]}" ':: go / tool' \
|
|
|
|
build \
|
2019-08-22 11:53:12 +00:00
|
|
|
-mod readonly \
|
2019-08-10 16:43:37 +00:00
|
|
|
-o "${_outputs}/binaries/debug/kawipiko-server" \
|
|
|
|
-- ./cmd/server.go \
|
|
|
|
#
|
|
|
|
!!
|
|
|
|
|
|
|
|
<< go / build / server / release
|
|
|
|
test "${#}" -eq 0
|
|
|
|
_outputs="$( exec -- readlink -e -- ./.outputs )"
|
|
|
|
mkdir -p -- "${_outputs}/binaries/release"
|
2019-08-12 11:39:41 +00:00
|
|
|
rm -f -- "${_outputs}/binaries/release/kawipiko-server"
|
2019-08-10 16:43:37 +00:00
|
|
|
exec -- "${ZRUN[@]}" ':: go / tool' \
|
|
|
|
build \
|
2019-08-22 11:53:12 +00:00
|
|
|
-mod readonly \
|
2019-08-11 21:27:10 +00:00
|
|
|
-tags netgo \
|
2021-11-17 19:00:52 +00:00
|
|
|
-a \
|
2019-08-11 21:02:17 +00:00
|
|
|
-gcflags 'all=-l=4' \
|
2021-11-17 19:00:52 +00:00
|
|
|
-ldflags 'all=-s' \
|
|
|
|
-buildmode exe \
|
|
|
|
-trimpath \
|
2019-08-10 16:43:37 +00:00
|
|
|
-o "${_outputs}/binaries/release/kawipiko-server" \
|
|
|
|
-- ./cmd/server.go \
|
|
|
|
#
|
|
|
|
!!
|
|
|
|
|
2019-08-11 21:02:17 +00:00
|
|
|
<< go / build / server / analyze
|
2019-08-10 16:43:37 +00:00
|
|
|
test "${#}" -eq 0
|
|
|
|
_outputs="$( exec -- readlink -e -- ./.outputs )"
|
2019-08-12 11:39:41 +00:00
|
|
|
mkdir -p -- "${_outputs}/binaries/debug"
|
2019-08-10 16:43:37 +00:00
|
|
|
rm -f -- "${_outputs}/binaries/debug/kawipiko-server"
|
|
|
|
exec -- "${ZRUN[@]}" ':: go / tool' \
|
|
|
|
build \
|
2019-08-22 11:53:12 +00:00
|
|
|
-mod readonly \
|
2019-08-10 16:43:37 +00:00
|
|
|
-gcflags '-m' \
|
|
|
|
-o "${_outputs}/binaries/debug/kawipiko-server" \
|
|
|
|
-- ./cmd/server.go \
|
|
|
|
#
|
|
|
|
!!
|
|
|
|
|
2019-08-11 21:02:17 +00:00
|
|
|
<< go / build / server / analyze / escapes
|
|
|
|
"${ZRUN[@]}" ':: go / build / server / analyze' "${@}" \
|
2019-08-10 16:43:37 +00:00
|
|
|
2>&1 \
|
|
|
|
| grep -F -e ' escapes ' \
|
|
|
|
| LC_ALL=C sort -n -k 2,2 -t ':'
|
|
|
|
!!
|
|
|
|
|
|
|
|
|
2019-08-10 17:49:04 +00:00
|
|
|
<< go / build / server / publish
|
2019-08-10 16:43:37 +00:00
|
|
|
test "${#}" -eq 0
|
|
|
|
"${ZRUN[@]}" ':: go / build / server / release'
|
|
|
|
if test ! -e ./.outputs/publish ; then
|
|
|
|
mkdir -- ./.outputs/publish
|
|
|
|
fi
|
2019-08-10 17:49:04 +00:00
|
|
|
if test ! -e ./.outputs/publish/binaries ; then
|
|
|
|
mkdir -- ./.outputs/publish/binaries
|
2019-08-10 16:43:37 +00:00
|
|
|
fi
|
|
|
|
cp -T -- \
|
|
|
|
./.outputs/binaries/release/kawipiko-server \
|
|
|
|
./.outputs/publish/binaries/kawipiko-server \
|
|
|
|
#
|
|
|
|
!!
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-08-13 06:49:54 +00:00
|
|
|
++<< execute / archiver / debug
|
2019-08-10 16:43:37 +00:00
|
|
|
"${ZRUN[@]}" ':: go / build / archiver / debug'
|
2019-08-12 11:39:41 +00:00
|
|
|
exec -- env -i -- ./.outputs/binaries/debug/kawipiko-archiver "${@}"
|
2019-08-10 16:43:37 +00:00
|
|
|
!!
|
|
|
|
|
|
|
|
<< execute / archiver / release
|
|
|
|
"${ZRUN[@]}" ':: go / build / archiver / release'
|
2019-08-12 11:39:41 +00:00
|
|
|
exec -- env -i -- ./.outputs/binaries/release/kawipiko-archiver "${@}"
|
2019-08-10 16:43:37 +00:00
|
|
|
!!
|
|
|
|
|
|
|
|
|
|
|
|
<< go / build / archiver / debug
|
|
|
|
test "${#}" -eq 0
|
|
|
|
_outputs="$( exec -- readlink -e -- ./.outputs )"
|
|
|
|
mkdir -p -- "${_outputs}/binaries/debug"
|
2019-08-12 11:39:41 +00:00
|
|
|
rm -f -- "${_outputs}/binaries/debug/kawipiko-archiver"
|
2019-08-10 16:43:37 +00:00
|
|
|
exec -- "${ZRUN[@]}" ':: go / tool' \
|
|
|
|
build \
|
2019-08-22 11:53:12 +00:00
|
|
|
-mod readonly \
|
2019-08-10 16:43:37 +00:00
|
|
|
-o "${_outputs}/binaries/debug/kawipiko-archiver" \
|
|
|
|
-- ./cmd/archiver.go \
|
|
|
|
#
|
|
|
|
!!
|
|
|
|
|
|
|
|
<< go / build / archiver / release
|
|
|
|
test "${#}" -eq 0
|
|
|
|
_outputs="$( exec -- readlink -e -- ./.outputs )"
|
|
|
|
mkdir -p -- "${_outputs}/binaries/release"
|
2019-08-12 11:39:41 +00:00
|
|
|
rm -f -- "${_outputs}/binaries/release/kawipiko-archiver"
|
2019-08-10 16:43:37 +00:00
|
|
|
exec -- "${ZRUN[@]}" ':: go / tool' \
|
|
|
|
build \
|
2019-08-22 11:53:12 +00:00
|
|
|
-mod readonly \
|
2021-11-17 19:00:52 +00:00
|
|
|
-tags netgo \
|
|
|
|
-a \
|
2019-08-11 21:02:17 +00:00
|
|
|
-gcflags 'all=-l=4' \
|
2021-11-17 19:00:52 +00:00
|
|
|
-ldflags 'all=-s' \
|
|
|
|
-buildmode exe \
|
|
|
|
-trimpath \
|
2019-08-10 16:43:37 +00:00
|
|
|
-o "${_outputs}/binaries/release/kawipiko-archiver" \
|
|
|
|
-- ./cmd/archiver.go \
|
|
|
|
#
|
|
|
|
!!
|
|
|
|
|
|
|
|
|
2019-08-10 17:49:04 +00:00
|
|
|
<< go / build / archiver / publish
|
2019-08-10 16:43:37 +00:00
|
|
|
test "${#}" -eq 0
|
|
|
|
"${ZRUN[@]}" ':: go / build / archiver / release'
|
|
|
|
if test ! -e ./.outputs/publish ; then
|
|
|
|
mkdir -- ./.outputs/publish
|
|
|
|
fi
|
2019-08-10 17:49:04 +00:00
|
|
|
if test ! -e ./.outputs/publish/binaries ; then
|
|
|
|
mkdir -- ./.outputs/publish/binaries
|
2019-08-10 16:43:37 +00:00
|
|
|
fi
|
|
|
|
cp -T -- \
|
|
|
|
./.outputs/binaries/release/kawipiko-archiver \
|
|
|
|
./.outputs/publish/binaries/kawipiko-archiver \
|
|
|
|
#
|
|
|
|
!!
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-08-22 11:53:12 +00:00
|
|
|
<< go / build / all
|
|
|
|
test "${#}" -eq 0
|
|
|
|
"${ZRUN[@]}" ':: go / build / debug'
|
|
|
|
"${ZRUN[@]}" ':: go / build / release'
|
|
|
|
"${ZRUN[@]}" ':: go / build / publish'
|
|
|
|
!!
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-08-13 18:35:36 +00:00
|
|
|
<< execute / wrapper / release
|
|
|
|
"${ZRUN[@]}" ':: go / build / wrapper / release'
|
|
|
|
exec -- env -i -- ./.outputs/binaries/release/kawipiko "${@}"
|
|
|
|
!!
|
|
|
|
|
|
|
|
|
|
|
|
<< go / build / wrapper / release
|
|
|
|
test "${#}" -eq 0
|
|
|
|
_outputs="$( exec -- readlink -e -- ./.outputs )"
|
|
|
|
mkdir -p -- "${_outputs}/binaries/release"
|
2019-08-13 18:52:15 +00:00
|
|
|
rm -f -- "${_outputs}/binaries/release/kawipiko"
|
2019-08-13 18:35:36 +00:00
|
|
|
exec -- "${ZRUN[@]}" ':: go / tool' \
|
|
|
|
build \
|
2019-08-22 11:53:12 +00:00
|
|
|
-mod readonly \
|
2021-11-17 19:00:52 +00:00
|
|
|
-tags netgo \
|
|
|
|
-a \
|
2019-08-13 18:35:36 +00:00
|
|
|
-gcflags 'all=-l=4' \
|
2021-11-17 19:00:52 +00:00
|
|
|
-ldflags 'all=-s' \
|
|
|
|
-buildmode exe \
|
|
|
|
-trimpath \
|
2019-08-13 18:35:36 +00:00
|
|
|
-o "${_outputs}/binaries/release/kawipiko" \
|
|
|
|
-- ./cmd/wrapper.go \
|
|
|
|
#
|
|
|
|
!!
|
|
|
|
|
|
|
|
|
|
|
|
<< go / build / wrapper / publish
|
|
|
|
test "${#}" -eq 0
|
|
|
|
"${ZRUN[@]}" ':: go / build / wrapper / release'
|
|
|
|
if test ! -e ./.outputs/publish ; then
|
|
|
|
mkdir -- ./.outputs/publish
|
|
|
|
fi
|
|
|
|
if test ! -e ./.outputs/publish/binaries ; then
|
|
|
|
mkdir -- ./.outputs/publish/binaries
|
|
|
|
fi
|
|
|
|
cp -T -- \
|
|
|
|
./.outputs/binaries/release/kawipiko \
|
|
|
|
./.outputs/publish/binaries/kawipiko \
|
|
|
|
#
|
|
|
|
!!
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-08-10 16:43:37 +00:00
|
|
|
<< go / build / debug
|
|
|
|
"${ZRUN[@]}" ':: go / build / archiver / debug' "${@}"
|
|
|
|
"${ZRUN[@]}" ':: go / build / server / debug' "${@}"
|
|
|
|
!!
|
|
|
|
|
|
|
|
<< go / build / release
|
|
|
|
"${ZRUN[@]}" ':: go / build / archiver / release' "${@}"
|
|
|
|
"${ZRUN[@]}" ':: go / build / server / release' "${@}"
|
2019-08-13 18:35:36 +00:00
|
|
|
"${ZRUN[@]}" ':: go / build / wrapper / release' "${@}"
|
2019-08-10 16:43:37 +00:00
|
|
|
!!
|
|
|
|
|
2019-08-13 06:49:54 +00:00
|
|
|
++<< go / build / publish
|
2019-08-10 17:49:04 +00:00
|
|
|
"${ZRUN[@]}" ':: go / build / archiver / publish' "${@}"
|
|
|
|
"${ZRUN[@]}" ':: go / build / server / publish' "${@}"
|
2019-08-13 18:35:36 +00:00
|
|
|
"${ZRUN[@]}" ':: go / build / wrapper / publish' "${@}"
|
2019-08-10 17:49:04 +00:00
|
|
|
!!
|
|
|
|
|
2019-08-10 16:43:37 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
2019-08-10 17:49:04 +00:00
|
|
|
<< workspace / publish
|
2019-08-10 16:43:37 +00:00
|
|
|
test "${#}" -eq 0
|
|
|
|
printf -- '[ii] publishing to `https://data.volution.ro/ciprian/ad5264afc6e27e46b5d71837552cb3fd`...\n' >&2
|
|
|
|
exec -- rsync -a -v -- ./.outputs/publish/ ./.publish/
|
|
|
|
!!
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<< go / dependencies / update
|
|
|
|
test "${#}" -eq 0
|
|
|
|
exec -- "${ZRUN[@]}" ':: go / tool' \
|
|
|
|
get \
|
2021-11-17 19:36:19 +00:00
|
|
|
-v \
|
2019-08-10 16:43:37 +00:00
|
|
|
-d \
|
2019-08-22 11:53:12 +00:00
|
|
|
-u \
|
2021-11-17 19:36:19 +00:00
|
|
|
-- \
|
|
|
|
all \
|
2019-08-10 16:43:37 +00:00
|
|
|
#
|
|
|
|
!!
|
|
|
|
|
|
|
|
|
|
|
|
<< go / dependencies / list
|
|
|
|
test "${#}" -eq 0
|
|
|
|
exec -- "${ZRUN[@]}" ':: go / tool' \
|
|
|
|
list \
|
|
|
|
-m \
|
2019-08-22 11:53:12 +00:00
|
|
|
-mod readonly \
|
2019-08-10 16:43:37 +00:00
|
|
|
-- \
|
|
|
|
all \
|
|
|
|
#
|
|
|
|
!!
|
|
|
|
|
|
|
|
|
|
|
|
<< go / dependencies / tidy
|
|
|
|
test "${#}" -eq 0
|
|
|
|
exec -- "${ZRUN[@]}" ':: go / tool' \
|
|
|
|
mod tidy \
|
|
|
|
#
|
|
|
|
!!
|
|
|
|
|
|
|
|
|
2019-08-22 11:53:12 +00:00
|
|
|
<< go / dependencies / verify
|
|
|
|
test "${#}" -eq 0
|
|
|
|
exec -- "${ZRUN[@]}" ':: go / tool' \
|
|
|
|
mod verify \
|
|
|
|
#
|
|
|
|
!!
|
|
|
|
|
|
|
|
|
|
|
|
<< go / dependencies / upgrade
|
|
|
|
test "${#}" -eq 0
|
|
|
|
"${ZRUN[@]}" ':: go / dependencies / update'
|
|
|
|
"${ZRUN[@]}" ':: go / dependencies / tidy'
|
|
|
|
"${ZRUN[@]}" ':: go / dependencies / verify'
|
|
|
|
"${ZRUN[@]}" ':: go / dependencies / list'
|
|
|
|
!!
|
|
|
|
|
|
|
|
|
2019-08-10 16:43:37 +00:00
|
|
|
|
|
|
|
|
|
|
|
<< go / tool
|
|
|
|
test "${#}" -ge 1
|
|
|
|
_outputs="$( exec -- readlink -e -- ./.outputs )"
|
|
|
|
_sources="$( exec -- readlink -e -- ./sources )"
|
|
|
|
|
|
|
|
export -- GOPATH="${_outputs}/go"
|
|
|
|
export -- GOBIN="${_outputs}/go/bin"
|
|
|
|
export -- GOTMPDIR="${_outputs}/go/tmp"
|
|
|
|
export -- GOCACHE="${_outputs}/go/cache"
|
2019-08-22 11:53:12 +00:00
|
|
|
export -- GO111MODULE=on
|
2019-08-10 16:43:37 +00:00
|
|
|
|
|
|
|
cd -- "${_sources}"
|
|
|
|
|
|
|
|
exec -- go "${@}"
|
|
|
|
!!
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<< workspace / initialize / outputs
|
|
|
|
test "${#}" -eq 0
|
|
|
|
if test ! -d ./.outputs ; then
|
|
|
|
_outputs_store="${TMPDIR:-/tmp}/go--${UID}--${RANDOM}-${RANDOM}-${RANDOM}-${RANDOM}"
|
|
|
|
mkdir -- "${_outputs_store}"
|
|
|
|
_outputs_store="$( exec -- readlink -e -- "${_outputs_store}" )"
|
|
|
|
ln -s -f -T -- "${_outputs_store}" ./.outputs
|
|
|
|
fi
|
|
|
|
!!
|
|
|
|
|
|
|
|
|
|
|
|
<< workspace / initialize / go
|
|
|
|
test "${#}" -eq 0
|
|
|
|
_outputs="$( exec -- readlink -e -- ./.outputs )"
|
|
|
|
_sources="$( exec -- readlink -e -- ./sources )"
|
|
|
|
|
|
|
|
GOPATH="${_outputs}/go"
|
|
|
|
GOBIN="${_outputs}/go/bin"
|
|
|
|
GOTMPDIR="${_outputs}/go/tmp"
|
|
|
|
GOCACHE="${_outputs}/go/cache"
|
|
|
|
_gosrc="${_outputs}/go/src"
|
|
|
|
_gopkg="${_outputs}/go/pkg"
|
|
|
|
|
|
|
|
for _folder in "${GOPATH}" "${GOBIN}" "${GOTMPDIR}" "${GOTMPDIR}" "${GOCACHE}" "${_gosrc}" "${_gopkg}" ; do
|
|
|
|
if test ! -e "${_folder}" ; then
|
|
|
|
mkdir -- "${_folder}"
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
!!
|
|
|
|
|
|
|
|
|
|
|
|
<< workspace / initialize / python
|
|
|
|
test "${#}" -eq 0
|
|
|
|
if test -d ./.python ; then
|
|
|
|
exit -- 0
|
|
|
|
fi
|
|
|
|
|
|
|
|
test -d ./.outputs
|
|
|
|
mkdir -- ./.outputs/python
|
|
|
|
|
|
|
|
virtualenv-2.7 \
|
|
|
|
--python python2.7 \
|
|
|
|
--clear \
|
|
|
|
--no-site-packages \
|
|
|
|
--no-setuptools \
|
|
|
|
--no-wheel \
|
|
|
|
--no-download \
|
|
|
|
--unzip-setuptools \
|
|
|
|
-- \
|
|
|
|
./.outputs/python \
|
|
|
|
#
|
|
|
|
|
|
|
|
./.outputs/python/bin/pip install --upgrade --compile -- pip
|
|
|
|
./.outputs/python/bin/pip install --upgrade --compile -- wheel
|
|
|
|
./.outputs/python/bin/pip install --upgrade --compile -- setuptools
|
|
|
|
|
|
|
|
./.outputs/python/bin/pip install --compile -- docutils
|
|
|
|
./.outputs/python/bin/pip install --compile -- restview
|
|
|
|
|
|
|
|
ln -s -f -T -- ./.outputs/python ./.python
|
|
|
|
!!
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<< workspace / sources / codes / duplicates
|
|
|
|
test "${#}" -eq 0
|
|
|
|
exec -- xargs \
|
|
|
|
-r -d '\n' -I {} \
|
|
|
|
-a <(
|
|
|
|
grep \
|
|
|
|
-o \
|
|
|
|
-P \
|
|
|
|
-e '(?<=\[)[0-9a-f]{8}(?=\])|(?<=0x)[0-9a-f]{8}(?=[^0-9a-zA-Z]|$)' \
|
|
|
|
-h \
|
|
|
|
-r ./sources \
|
|
|
|
--include '*.go' \
|
|
|
|
| sort \
|
|
|
|
| uniq -d
|
|
|
|
) \
|
|
|
|
-- \
|
|
|
|
grep \
|
|
|
|
-P \
|
|
|
|
-e '(?<=\[){}(?=\])|(?<=0x){}(?=[^0-9a-zA-Z]|$)' \
|
|
|
|
-r ./sources \
|
|
|
|
-n \
|
|
|
|
--include '*.go' \
|
|
|
|
--color \
|
|
|
|
#
|
|
|
|
!!
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<< documentation / readme / open
|
|
|
|
test "${#}" -eq 0
|
|
|
|
exec -- x-www open http://127.33.237.174:8080/
|
|
|
|
!!
|
|
|
|
|
|
|
|
<< documentation / readme / server
|
|
|
|
test "${#}" -eq 0
|
2019-08-12 11:39:41 +00:00
|
|
|
exec -- env -i -- ./.python/bin/restview --no-browser --listen 127.33.237.174:8080 --allowed-hosts '*' -- ./readme.rst
|
2019-08-10 16:43:37 +00:00
|
|
|
!!
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-08-11 21:27:27 +00:00
|
|
|
:: benchmark / server / 1x1 :: exec -- "${ZRUN[@]}" ':: benchmark / server / inmem' "${@}" --processes 1 --threads 1
|
|
|
|
:: benchmark / server / 2x1 :: exec -- "${ZRUN[@]}" ':: benchmark / server / inmem' "${@}" --processes 2 --threads 1
|
2019-08-13 06:49:54 +00:00
|
|
|
++:: benchmark / server / 1x2 :: exec -- "${ZRUN[@]}" ':: benchmark / server / inmem' "${@}" --processes 1 --threads 2
|
2019-08-11 21:27:27 +00:00
|
|
|
:: benchmark / server / 2x2 :: exec -- "${ZRUN[@]}" ':: benchmark / server / inmem' "${@}" --processes 2 --threads 2
|
2019-08-10 16:43:37 +00:00
|
|
|
|
|
|
|
|
|
|
|
<< benchmark / server
|
|
|
|
if test "${#}" -ge 1 ; then
|
|
|
|
if test "${1:0:1}" != '-' ; then
|
|
|
|
_archive="${1}"
|
|
|
|
shift -- 1
|
|
|
|
else
|
|
|
|
_archive=''
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
_archive=''
|
|
|
|
fi
|
|
|
|
if test -z "${_archive}" ; then
|
2019-08-10 17:49:04 +00:00
|
|
|
_archive=./examples/hello-world.cdb
|
2019-08-10 16:43:37 +00:00
|
|
|
fi
|
|
|
|
"${ZRUN[@]}" ':: go / build / server / release'
|
|
|
|
exec -- \
|
|
|
|
sudo -u root -n -E -P -- \
|
2019-08-11 21:27:27 +00:00
|
|
|
taskset -c 0,1 \
|
2019-08-10 16:43:37 +00:00
|
|
|
nice -n -19 -- \
|
|
|
|
ionice -c 2 -n 0 -- \
|
|
|
|
chrt -r 10 \
|
2019-08-13 07:54:58 +00:00
|
|
|
prlimit -n262144 -- \
|
2019-08-10 16:43:37 +00:00
|
|
|
sudo -u "${USER}" -n -E -P -- \
|
2019-08-12 11:39:41 +00:00
|
|
|
env -i -- \
|
2019-08-10 16:43:37 +00:00
|
|
|
./.outputs/binaries/release/kawipiko-server \
|
|
|
|
--bind 127.9.185.194:8080 \
|
|
|
|
--archive "${_archive}" \
|
2019-08-12 13:50:28 +00:00
|
|
|
--security-headers-disable \
|
2019-08-12 13:29:29 +00:00
|
|
|
--timeout-disable \
|
2019-08-10 16:43:37 +00:00
|
|
|
"${@}" \
|
|
|
|
#
|
|
|
|
!!
|
|
|
|
|
|
|
|
<< benchmark / server / mmap
|
|
|
|
exec -- "${ZRUN[@]}" ':: benchmark / server' \
|
|
|
|
"${@}" \
|
|
|
|
--archive-mmap \
|
|
|
|
--archive-preload \
|
|
|
|
#
|
|
|
|
!!
|
|
|
|
|
|
|
|
<< benchmark / server / inmem
|
|
|
|
exec -- "${ZRUN[@]}" ':: benchmark / server' \
|
|
|
|
"${@}" \
|
|
|
|
--archive-inmem \
|
2019-08-11 21:27:27 +00:00
|
|
|
--index-all \
|
2019-08-10 16:43:37 +00:00
|
|
|
#
|
|
|
|
!!
|
|
|
|
|
|
|
|
|
|
|
|
<< benchmark / server / profile / cpu
|
|
|
|
exec -- "${ZRUN[@]}" ':: benchmark / server / mmap' \
|
|
|
|
"${@}" \
|
|
|
|
--profile-cpu ./.outputs/server-cpu.txt \
|
|
|
|
#
|
|
|
|
!!
|
|
|
|
|
|
|
|
<< benchmark / server / profile / mem
|
|
|
|
exec -- "${ZRUN[@]}" ':: benchmark / server / mmap' \
|
|
|
|
"${@}" \
|
|
|
|
--profile-mem ./.outputs/server-mem.txt \
|
|
|
|
#
|
|
|
|
!!
|
|
|
|
|
|
|
|
<< benchmark / server / profile / cpu / analyze
|
|
|
|
export -- PPROF_BINARY_PATH=./.outputs/binaries/release/kawipiko-server
|
|
|
|
exec -- go tool pprof "${@}" -- ./.outputs/server-cpu.txt
|
|
|
|
!!
|
|
|
|
|
|
|
|
<< benchmark / server / profile / mem / analyze
|
|
|
|
export -- PPROF_BINARY_PATH=./.outputs/binaries/release/kawipiko-server
|
|
|
|
exec -- go tool pprof "${@}" ./.outputs/server-mem.txt
|
|
|
|
!!
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-08-13 07:54:58 +00:00
|
|
|
:: benchmark / client / 16384 :: exec -- "${ZRUN[@]}" ':: benchmark / client' "${@}" --threads 2 --connections 16384 --timeout 6s
|
|
|
|
:: benchmark / client / 4096 :: exec -- "${ZRUN[@]}" ':: benchmark / client' "${@}" --threads 2 --connections 4096
|
2019-08-11 21:27:27 +00:00
|
|
|
:: benchmark / client / 2048 :: exec -- "${ZRUN[@]}" ':: benchmark / client' "${@}" --threads 2 --connections 2048
|
|
|
|
:: benchmark / client / 1024 :: exec -- "${ZRUN[@]}" ':: benchmark / client' "${@}" --threads 2 --connections 1024
|
|
|
|
:: benchmark / client / 512 :: exec -- "${ZRUN[@]}" ':: benchmark / client' "${@}" --threads 2 --connections 512
|
|
|
|
:: benchmark / client / 256 :: exec -- "${ZRUN[@]}" ':: benchmark / client' "${@}" --threads 2 --connections 256
|
2019-08-13 06:49:54 +00:00
|
|
|
++:: benchmark / client / 128 :: exec -- "${ZRUN[@]}" ':: benchmark / client' "${@}" --threads 2 --connections 128
|
2019-08-10 16:43:37 +00:00
|
|
|
:: benchmark / client / 64 :: exec -- "${ZRUN[@]}" ':: benchmark / client' "${@}" --threads 2 --connections 64
|
|
|
|
:: benchmark / client / 32 :: exec -- "${ZRUN[@]}" ':: benchmark / client' "${@}" --threads 2 --connections 32
|
|
|
|
:: benchmark / client / 16 :: exec -- "${ZRUN[@]}" ':: benchmark / client' "${@}" --threads 2 --connections 16
|
2019-08-11 21:27:27 +00:00
|
|
|
:: benchmark / client / 8 :: exec -- "${ZRUN[@]}" ':: benchmark / client' "${@}" --threads 1 --connections 8
|
|
|
|
:: benchmark / client / 4 :: exec -- "${ZRUN[@]}" ':: benchmark / client' "${@}" --threads 1 --connections 4
|
|
|
|
:: benchmark / client / 2 :: exec -- "${ZRUN[@]}" ':: benchmark / client' "${@}" --threads 1 --connections 2
|
2019-08-10 16:43:37 +00:00
|
|
|
:: benchmark / client / 1 :: exec -- "${ZRUN[@]}" ':: benchmark / client' "${@}" --threads 1 --connections 1
|
|
|
|
|
|
|
|
|
|
|
|
<< benchmark / client
|
|
|
|
if test "${#}" -ge 1 ; then
|
|
|
|
if test "${1:0:1}" != '-' ; then
|
|
|
|
_path="${1}"
|
|
|
|
_path="${_path#/}"
|
|
|
|
shift -- 1
|
|
|
|
else
|
|
|
|
_path=''
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
_path=''
|
|
|
|
fi
|
|
|
|
exec -- \
|
|
|
|
sudo -u root -n -E -P -- \
|
2019-08-11 21:27:27 +00:00
|
|
|
taskset -c 2,3 \
|
2019-08-10 16:43:37 +00:00
|
|
|
nice -n -19 -- \
|
|
|
|
ionice -c 2 -n 0 -- \
|
|
|
|
chrt -r 10 \
|
2019-08-13 07:54:58 +00:00
|
|
|
prlimit -n262144 -- \
|
2019-08-10 16:43:37 +00:00
|
|
|
sudo -u "${USER}" -n -E -P -- \
|
2019-08-12 11:39:41 +00:00
|
|
|
env -i -- \
|
2019-08-14 13:25:40 +00:00
|
|
|
./.bin/wrk \
|
2019-08-11 21:27:27 +00:00
|
|
|
--threads 2 \
|
2019-08-10 16:43:37 +00:00
|
|
|
--connections 1 \
|
2019-08-11 21:27:27 +00:00
|
|
|
--timeout 1s \
|
|
|
|
--duration 30s \
|
2019-08-10 16:43:37 +00:00
|
|
|
--latency \
|
|
|
|
"${@}" \
|
|
|
|
-- "http://127.9.185.194:8080/${_path}" \
|
|
|
|
#
|
|
|
|
!!
|
|
|
|
|
|
|
|
|
|
|
|
<< benchmark / client / paths
|
|
|
|
test "${#}" -ge 1
|
|
|
|
_paths="${1}"
|
|
|
|
shift -- 1
|
|
|
|
exec -- \
|
|
|
|
sudo -u root -n -E -P -- \
|
2019-08-11 21:27:27 +00:00
|
|
|
taskset -c 2,3 \
|
2019-08-10 16:43:37 +00:00
|
|
|
nice -n -19 -- \
|
|
|
|
ionice -c 2 -n 0 -- \
|
|
|
|
chrt -r 10 \
|
2019-08-13 07:54:58 +00:00
|
|
|
prlimit -n262144 -- \
|
2019-08-10 16:43:37 +00:00
|
|
|
sudo -u "${USER}" -n -E -P -- \
|
2019-08-12 11:39:41 +00:00
|
|
|
env -i -- \
|
2019-08-14 13:25:40 +00:00
|
|
|
./.bin/wrk \
|
2019-08-11 21:27:27 +00:00
|
|
|
--threads 2 \
|
2019-08-10 16:43:37 +00:00
|
|
|
--connections 1 \
|
2019-08-11 21:27:27 +00:00
|
|
|
--timeout 1s \
|
|
|
|
--duration 30s \
|
2019-08-10 16:43:37 +00:00
|
|
|
--latency \
|
|
|
|
--script ../kawipiko-examples/sources/wrk-paths-from-file.lua \
|
|
|
|
"${@}" \
|
|
|
|
-- "http://127.9.185.194:8080/" \
|
|
|
|
"${_paths}" \
|
|
|
|
#
|
|
|
|
!!
|
|
|
|
|
|
|
|
|
|
|
|
<< benchmark / curl
|
|
|
|
if test "${#}" -ge 1 ; then
|
|
|
|
if test "${1:0:1}" != '-' ; then
|
|
|
|
_path="${1}"
|
|
|
|
_path="${_path#/}"
|
|
|
|
shift -- 1
|
|
|
|
else
|
|
|
|
_path=''
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
_path=''
|
|
|
|
fi
|
2019-08-12 11:39:41 +00:00
|
|
|
exec -- \
|
|
|
|
env -i -- \
|
|
|
|
"$( type -P -- curl )" \
|
2019-08-10 16:43:37 +00:00
|
|
|
--silent \
|
|
|
|
--compressed \
|
2019-08-12 10:37:46 +00:00
|
|
|
--output /dev/stdout \
|
|
|
|
--dump-header /dev/stdout \
|
2019-08-10 16:43:37 +00:00
|
|
|
"${@}" \
|
2019-08-12 11:39:41 +00:00
|
|
|
-- \
|
|
|
|
"http://127.9.185.194:8080/${_path}" \
|
2019-08-10 16:43:37 +00:00
|
|
|
#
|
|
|
|
!!
|
|
|
|
|
2019-08-10 17:49:04 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<< examples / hello-world / archive
|
2019-08-12 19:13:47 +00:00
|
|
|
"${ZRUN[@]}" ':: execute / archiver / debug' \
|
2019-08-10 17:49:04 +00:00
|
|
|
--sources ./examples/hello-world \
|
|
|
|
--archive ./examples/hello-world.cdb \
|
|
|
|
--debug \
|
2019-08-16 17:50:42 +00:00
|
|
|
"${@}" \
|
2019-08-10 17:49:04 +00:00
|
|
|
#
|
2019-08-12 19:13:47 +00:00
|
|
|
cdb -d -- ./examples/hello-world.cdb \
|
|
|
|
| tr -d '\r' \
|
|
|
|
| sed -r -e 's#^(\+[0-9]+,[0-9]+):(.+?)->#\n\1\n\2\n#' \
|
|
|
|
>| ./examples/hello-world.cdb-dump \
|
|
|
|
#
|
2019-08-10 17:49:04 +00:00
|
|
|
!!
|
|
|
|
|
|
|
|
<< examples / hello-world / serve
|
|
|
|
exec -- "${ZRUN[@]}" ':: execute / server / debug' \
|
|
|
|
--bind 127.153.215.30:8080 \
|
|
|
|
--archive ./examples/hello-world.cdb \
|
|
|
|
--archive-inmem \
|
|
|
|
--index-all \
|
|
|
|
--processes 1 \
|
|
|
|
--threads 1 \
|
|
|
|
--debug \
|
2019-08-16 17:50:42 +00:00
|
|
|
"${@}" \
|
2019-08-10 17:49:04 +00:00
|
|
|
#
|
|
|
|
!!
|
|
|
|
|
2019-08-12 11:01:15 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<< benchmark / dummy
|
|
|
|
test "${#}" -eq 0
|
|
|
|
_outputs="$( exec -- readlink -e -- ./.outputs )"
|
|
|
|
mkdir -p -- "${_outputs}/binaries/release"
|
2019-08-12 11:39:41 +00:00
|
|
|
rm -f -- "${_outputs}/binaries/release/kawipiko-server-dummy"
|
2019-08-12 11:01:15 +00:00
|
|
|
"${ZRUN[@]}" ':: go / tool' \
|
|
|
|
build \
|
2019-08-22 11:53:12 +00:00
|
|
|
-mod readonly \
|
2019-08-12 11:01:15 +00:00
|
|
|
-tags netgo \
|
|
|
|
-ldflags 'all=-s -extld=gcc -extldflags=-static' \
|
|
|
|
-gcflags 'all=-l=4' \
|
|
|
|
-o "${_outputs}/binaries/release/kawipiko-server-dummy" \
|
|
|
|
-- ./cmd/server-dummy.go \
|
|
|
|
#
|
2019-08-12 11:39:41 +00:00
|
|
|
exec -- \
|
|
|
|
sudo -u root -n -E -P -- \
|
|
|
|
taskset -c 0,1 \
|
|
|
|
nice -n -19 -- \
|
|
|
|
ionice -c 2 -n 0 -- \
|
|
|
|
chrt -r 10 \
|
2019-08-13 07:54:58 +00:00
|
|
|
prlimit -n262144 -- \
|
2019-08-12 11:39:41 +00:00
|
|
|
sudo -u "${USER}" -n -E -P -- \
|
|
|
|
env -i -- \
|
|
|
|
./.outputs/binaries/release/kawipiko-server-dummy \
|
|
|
|
"${@}" \
|
|
|
|
#
|
2019-08-12 11:01:15 +00:00
|
|
|
!!
|
|
|
|
|