diff --git a/cloud-init.sh.in b/cloud-init.sh.in new file mode 100644 index 0000000000..dd56c3807d --- /dev/null +++ b/cloud-init.sh.in @@ -0,0 +1,61 @@ +#!/bin/bash -x + +# This is the script for cloud-init, to run on a VM in unattended fashion. Example: +< cloud-init.sh +aws ec2 run-instances --count 1 --image-id ami-0d1ddd83282187d18 --instance-type c6a.4xlarge \ + --block-device-mappings 'DeviceName=/dev/sda1,Ebs={DeleteOnTermination=true,VolumeSize=500,VolumeType=gp2}' \ + --key-name milovidov --security-group-ids sg-013790293e9640422 --instance-initiated-shutdown-behavior terminate \ + --tag-specifications 'ResourceType=instance,Tags=[{Key=Name,Value=clickbench}]' \ + --user-data file://cloud-init.sh +/// + +apt-get update +apt-get install -y wget curl git + +git clone --depth 1 https://github.com/ClickHouse/ClickBench.git +cd ClickBench/@system@ +echo -n 'Disk usage before: ' >> log +df -B1 / | tail -n1 | awk '{ print $3 }' >> log +./benchmark.sh 2>&1 | tee -a log +echo -n 'Disk usage after: ' >> log +df -B1 / | tail -n1 | awk '{ print $3 }' >> log +echo 'System: @system@' >> log +echo -n 'Machine: ' >> log +curl 'http://169.254.169.254/latest/meta-data/instance-type' >> log + +# Save the results. +# Prepare the database as follows: +<