Skip to content

Commit

Permalink
Merge pull request #153 from ClickHouse/hardware-automated
Browse files Browse the repository at this point in the history
Automated hardware benchmark
  • Loading branch information
alexey-milovidov authored Dec 9, 2023
2 parents 2b7ae3d + 2af3711 commit e1923a7
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 3 deletions.
22 changes: 22 additions & 0 deletions hardware/cloud-init.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash

# See the docs in clickhouse/cloud-init.sh

BASE_URL='https://raw.githubusercontent.com/ClickHouse/ClickBench/main/hardware/'

apt-get update
apt-get install -y curl

wget $BASE_URL/hardware.sh
chmod +x *.sh

./hardware.sh >> log

echo $BASE_URL >> log
curl 'http://169.254.169.254/latest/meta-data/instance-type' >> log

RESULTS_URL="https://play.clickhouse.com/?user=sink&query=INSERT+INTO+data+FORMAT+RawBLOB"

curl ${RESULTS_URL} --data-binary @log

shutdown now
6 changes: 3 additions & 3 deletions hardware/hardware.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ trap finish EXIT

echo "Waiting for clickhouse-server to start"

for i in {1..30}; do
for i in {1..300}; do
sleep 1
./clickhouse client --query "SELECT 'Ok.'" 2>/dev/null && break || echo -n '.'
if [[ $i == 30 ]]; then exit 1; fi
if [[ $i == 300 ]]; then exit 1; fi
done

if [[ $(./clickhouse client --query "EXISTS hits") == '1' && $(./clickhouse client --query "SELECT count() FROM hits") == '100000000' ]]; then
Expand Down Expand Up @@ -90,7 +90,7 @@ echo

touch {cpu_model,cpu,df,memory,memory_total,blk,mdstat,instance}.txt

if [ "${OS}" = "Darwin" ]
if [ "${OS}" = "Darwin" ]
then
echo '----Version, build id-----------'
./clickhouse local --query "SELECT format('Version: {}', version())"
Expand Down

0 comments on commit e1923a7

Please sign in to comment.