Fix TOAST Initialization vector #94
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Perf test | |
on: [pull_request] | |
permissions: | |
contents: write | |
pull-requests: write | |
repository-projects: write | |
jobs: | |
build: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Remove old postgres | |
run: | | |
sudo apt purge postgresql-client-common postgresql-common \ | |
postgresql postgresql* | |
sudo rm -rf /var/lib/postgresql /var/log/postgresql /etc/postgresql \ | |
/usr/lib/postgresql /usr/include/postgresql /usr/share/postgresql \ | |
/etc/postgresql | |
sudo rm -f /usr/bin/pg_config | |
- name: Install dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y libreadline6-dev systemtap-sdt-dev \ | |
zlib1g-dev libssl-dev libpam0g-dev bison flex \ | |
libipc-run-perl -y docbook-xsl docbook-xsl libxml2 libxml2-utils \ | |
libxml2-dev libxslt-dev xsltproc libkrb5-dev libldap2-dev \ | |
libsystemd-dev gettext tcl-dev libperl-dev pkg-config clang-11 \ | |
llvm-11 llvm-11-dev libselinux1-dev python3-dev \ | |
uuid-dev liblz4-dev meson ninja-build libjson-c-dev \ | |
sysbench libcurl4-openssl-dev | |
sudo /usr/bin/perl -MCPAN -e 'install IPC::RUN' | |
sudo /usr/bin/perl -MCPAN -e 'install Text::Trim' | |
- name: Clone postgres repository | |
uses: actions/checkout@v2 | |
with: | |
repository: 'postgres/postgres' | |
ref: 'a81e5516fa4bc53e332cb35eefe231147c0e1749' | |
path: 'src' | |
- name: Clone postgres-tde-ext repository | |
uses: actions/checkout@v2 | |
with: | |
path: 'src/contrib/postgres-tde-ext' | |
- name: Include postgres-tde-ext in meson build | |
run: | | |
echo "subdir('postgres-tde-ext')" >> src/contrib/meson.build | |
- name: Build postgres | |
run: | | |
meson setup build --prefix `pwd`/../inst --buildtype=release | |
cd build && ninja && ninja install | |
working-directory: src | |
- name: Test postgres-tde-ext | |
run: | | |
cp ../contrib/postgres-tde-ext/keyring.json /tmp/keyring.json | |
meson test --suite setup -v | |
meson test --suite postgres-tde-ext -v --num-processes 1 | |
working-directory: src/build | |
- name: Report on test fail | |
uses: actions/upload-artifact@v2 | |
if: ${{ failure() }} | |
with: | |
name: Regressions diff and postgresql log | |
path: | | |
src/build/testrun/postgres-tde-ext/regress/ | |
retention-days: 3 | |
- name: Setup test environment | |
run: | | |
bin/initdb -D data | |
echo "shared_preload_libraries = 'pg_tde'" >> data/postgresql.conf | |
echo "pg_tde.keyringConfigFile = '/tmp/keyring.json'" >> data/postgresql.conf | |
bin/pg_ctl -D data start | |
bin/createdb sbtest | |
bin/createdb sbtest2 | |
bin/createuser sbtest -s | |
bin/psql sbtest2 <<< "CREATE EXTENSION pg_tde;" | |
cp -r ../src/contrib/postgres-tde-ext/sysbench . | |
working-directory: inst | |
- name: Run baseline performance tests | |
run: | | |
sysbench --db-driver=pgsql --threads=1 sysbench/oltp_insert.lua --tables=1 --table-size=10000 --pgsql-db=sbtest prepare | |
sysbench --db-driver=pgsql --threads=1 sysbench/oltp_read_only.lua --tables=1 --table-size=10000 --pgsql-db=sbtest run | |
sysbench --db-driver=pgsql --threads=1 sysbench/oltp_read_only.lua --tables=1 --table-size=10000 --pgsql-db=sbtest run | tee perf_norm | |
working-directory: inst | |
- name: Run TDE performance tests | |
run: | | |
sysbench --db-driver=pgsql --threads=1 sysbench/oltp_common_tde.lua --tables=1 --table-size=10000 --pgsql-db=sbtest2 prepare | |
sysbench --db-driver=pgsql --threads=1 sysbench/oltp_read_only.lua --tables=1 --table-size=10000 --pgsql-db=sbtest2 run | |
sysbench --db-driver=pgsql --threads=1 sysbench/oltp_read_only.lua --tables=1 --table-size=10000 --pgsql-db=sbtest2 run | tee perf_tde | |
working-directory: inst | |
- name: Print results | |
run: | | |
NORM_Q=$(cat perf_norm | grep 'total number of events' | cut -d ':' -f 2 | sed 's/ //g') | |
TDE_Q=$(cat perf_tde | grep 'total number of events' | cut -d ':' -f 2 | sed 's/ //g') | |
echo "Norm queries: $NORM_Q" | |
echo "TDE queries: $TDE_Q" | |
echo "Performance test results:" >> pr_perf_results | |
echo "Normal queries: $(cat perf_norm | grep 'total number of events' | cut -d ':' -f 2 | sed 's/ //g')" >> pr_perf_results | |
echo "TDE queries: $(cat perf_tde | grep 'total number of events' | cut -d ':' -f 2 | sed 's/ //g')" >> pr_perf_results | |
echo "Percentage: $(($TDE_Q*100/$NORM_Q))%" >> pr_perf_results | |
PERF_RESULT=$(cat pr_perf_results) | |
echo "PERF_RESULT<<EOF" >> $GITHUB_ENV | |
echo "$PERF_RESULT" >> $GITHUB_ENV | |
echo "EOF" >> $GITHUB_ENV | |
working-directory: inst | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: pr_perf_results | |
path: inst/pr_perf_results |