From a31a83d339c06c521355c9f386a8ac7e675c24c7 Mon Sep 17 00:00:00 2001 From: SaitTalhaNisanci Date: Thu, 16 Apr 2020 13:48:13 +0300 Subject: [PATCH] add optional hammerdb benchmark job --- .circleci/config.yml | 24 +++++++++++++++- src/test/hammerdb/run_hammerdb.sh | 48 +++++++++++++++++++++++++++++++ 2 files changed, 71 insertions(+), 1 deletion(-) create mode 100644 src/test/hammerdb/run_hammerdb.sh diff --git a/.circleci/config.yml b/.circleci/config.yml index 0203ad67f..f4eb1a1ae 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -234,12 +234,34 @@ jobs: install-and-test-ext --target check-citus-upgrade-mixed --citus-pre-tar /install-pg11-citusv8.3.0.tar no_output_timeout: 2m - + ch_benchmark: + docker: + - image: buildpack-deps:trusty + working_directory: /home/circleci/project + steps: + - azure-cli/install + - azure-cli/login-with-service-principal + - checkout + - run: + command: | + cd ./src/test/hammerdb + sh run_hammerdb.sh ch_benchmark + name: install dependencies and run ch_benchmark tests + no_output_timeout: 40m workflows: version: 2 + + performance_tests: + jobs: + - ch_benchmark: + filters: + branches: + only: + - /ch_benchmark\/.*/ # match with ch_benchmark/ prefix + build_and_test: jobs: - build diff --git a/src/test/hammerdb/run_hammerdb.sh b/src/test/hammerdb/run_hammerdb.sh new file mode 100644 index 000000000..82e3b5b1d --- /dev/null +++ b/src/test/hammerdb/run_hammerdb.sh @@ -0,0 +1,48 @@ +#!/bin/bash + +# fail if trying to reference a variable that is not set. +set -u +# exit immediately if a command fails +set -e + +rg=$1 + +export RESOURCE_GROUP_NAME="${rg}" +export AZURE_REGION=westus2 +# the branch name is stored in CIRCLE_BRANCH env variable in CI jobs. +export BRANCH="${CIRCLE_BRANCH}" +git clone https://github.com/citusdata/test-automation.git +cd test-automation + +test_automation_dir=$(pwd) +# add the ssh keys +eval `ssh-agent -s` +ssh-add + +ssh-keygen -y -f ~/.ssh/id_rsa > ~/.ssh/id_rsa.pub + +now=$(date +"%m_%d_%Y_%s") +new_branch_name=delete_me/"${rg}"/"${now}" +git checkout -b "${new_branch_name}" + +cd ./fabfile/hammerdb_confs +branch_config="${BRANCH}".ini +# create a config for this branch +cp master.ini "${branch_config}" +# put the branch name to the config file. +sed -i "s/master/${BRANCH}/g" "${branch_config}" + +# TODO:: change this, for testing purposes. +sed -i "s/pg_duration 200/pg_duration 10/g" run.tcl + +git add -A +git commit -m "test hammerdb: ${rg} vs master" +git push origin "${new_branch_name}" + +cd "${test_automation_dir}" +cd ./hammerdb + +# create cluster and run the hammerd benchmark +./create-run.sh + +