Skip to content

Commit

Permalink
clickhouse helpers
Browse files Browse the repository at this point in the history
  • Loading branch information
jangorecki committed Mar 18, 2019
1 parent cc51df2 commit 3367e13
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
4 changes: 4 additions & 0 deletions clickhouse-active.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash
set -e

bash -c 'clickhouse-client --query="SELECT 0;"; exit $?' > /dev/null 2>&1
6 changes: 5 additions & 1 deletion run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ export BATCH=$(date +%s)
# confirm stop flag disabled
if [[ -f ./stop ]]; then echo "# Benchmark run $BATCH aborted. 'stop' file exists, should be removed before calling 'run.sh'" && exit; fi;

# confirm clickhouse is not running
if [[ ./clickhouse-active.sh ]]; then echo "# Benchmark run $BATCH aborted. clickhouse-server is running, shut it down before calling 'run.sh'" && exit; fi;


# set lock
if [[ -f ./run.lock ]]; then echo "# Benchmark run $BATCH aborted. 'run.lock' file exists, this should be checked before calling 'run.sh'. Ouput redirection mismatch might have happened if writing output to same file as currently running $(cat ./run.lock) benchmark run" && exit; else echo $BATCH > run.lock; fi;

Expand All @@ -30,7 +34,7 @@ if [[ "$DO_UPGRADE" == true && "$RUN_SOLUTIONS" =~ "pydatatable" ]]; then ./pyda
if [[ "$DO_UPGRADE" == true && "$RUN_SOLUTIONS" =~ "spark" ]]; then ./spark/init-spark.sh; fi;
#if [[ "$DO_UPGRADE" == true && "$RUN_SOLUTIONS" =~ "clickhouse" ]]; then ./clickhouse/init-clickhouse.sh; fi; # for now manual as requires sudo

# produce VERSION, REVISION files for each solution, this will crash if clickhouse server not started
# produce VERSION, REVISION files for each solution
./versions.sh

# run
Expand Down
6 changes: 3 additions & 3 deletions versions.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/bin/bash
set -e

# this will crash if clickhouse server not started
clickhouse-client --query="SELECT version()" > clickhouse/VERSION && echo "" > clickhouse/REVISION
# we assume client was installed/upgraded together with server
clickhouse-client --version-clean > clickhouse/VERSION && echo "" > clickhouse/REVISION

Rscript -e 'v=read.dcf(system.file(package="data.table", "DESCRIPTION"), fields=c("Version","Revision")); invisible(mapply(function(f, v) writeLines(v, file.path("datatable", f)), toupper(colnames(v)), c(v)))'
Rscript -e 'v=read.dcf(system.file(package="dplyr", "DESCRIPTION"), fields=c("Version","RemoteSha")); colnames(v)[colnames(v)=="RemoteSha"]="Revision"; invisible(mapply(function(f, v) writeLines(v, file.path("dplyr", f)), toupper(colnames(v)), c(v)))'
Expand All @@ -14,7 +14,7 @@ python -c 'import dask as dk; open("dask/VERSION","w").write(dk.__version__); op
source ./modin/py-modin/bin/activate
python -c 'import modin as modin; open("modin/VERSION","w").write(modin.__version__); open("modin/REVISION","w").write("");' > /dev/null
source ./pandas/py-pandas/bin/activate
python -c 'import pandas as pd; open("pandas/VERSION","w").write(pd.__version__); open("pandas/REVISION","w").write(pd.__git_version__);' > /dev/null 2>1&
python -c 'import pandas as pd; open("pandas/VERSION","w").write(pd.__version__); open("pandas/REVISION","w").write(pd.__git_version__);' > /dev/null 2>&1
source ./pydatatable/py-pydatatable/bin/activate
python -c 'import datatable as dt; open("pydatatable/VERSION","w").write(dt.__version__); open("pydatatable/REVISION","w").write(dt.__git_revision__);' > /dev/null
source ./spark/py-spark/bin/activate
Expand Down

0 comments on commit 3367e13

Please sign in to comment.