diff --git a/hardware/cloud-init.sh b/hardware/cloud-init.sh new file mode 100644 index 000000000..d45e146e4 --- /dev/null +++ b/hardware/cloud-init.sh @@ -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 diff --git a/hardware/hardware.sh b/hardware/hardware.sh index e372767f5..ee6d6ce10 100755 --- a/hardware/hardware.sh +++ b/hardware/hardware.sh @@ -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 @@ -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())"