Improve performance-test docker image

This commit is contained in:
alesapin 2019-02-06 11:46:41 +03:00
parent 346adf896f
commit 1f95bf18e4
2 changed files with 48 additions and 0 deletions

View File

@ -0,0 +1,15 @@
FROM yandex/clickhouse-stateful-test
RUN apt-get update -y \
&& env DEBIAN_FRONTEND=noninteractive \
apt-get install --yes --no-install-recommends \
python-requests
COPY s3downloader /s3downloader
COPY run.sh /run.sh
ENV OPEN_DATASETS="hits"
ENV PRIVATE_DATASETS="hits_100m_single"
ENV DOWNLOAD_DATASETS=1
CMD /run.sh

33
docker/test/performance/run.sh Executable file
View File

@ -0,0 +1,33 @@
#!/bin/bash
set -x
install_packages() {
dpkg -i package_folder/clickhouse-common-static_*.deb
dpkg -i package_folder/clickhouse-server_*.deb
dpkg -i package_folder/clickhouse-client_*.deb
dpkg -i package_folder/clickhouse-test_*.deb
service clickhouse-server start && sleep 5
}
download_data() {
clickhouse-client --query "CREATE DATABASE IF NOT EXISTS datasets"
clickhouse-client --query "CREATE DATABASE IF NOT EXISTS test"
/s3downloader --dataset-names $OPEN_DATASETS
/s3downloader --dataset-names $PRIVATE_DATASETS --url 'https://s3.mds.yandex.net/clickhouse-private-datasets'
chmod 777 -R /var/lib/clickhouse
service clickhouse-server restart && sleep 5
clickhouse-client --query "RENAME TABLE datasets.hits_v1 TO test.hits"
}
run() {
clickhouse-performance-test $TESTS_TO_RUN | tee test_output/test_result.json
}
install_packages
if [ $DOWNLOAD_DATASETS -eq 1 ]; then
download_data
fi
run