Skip to content

Commit

Permalink
CI: Replace opaque test harness for mtr-test
Browse files Browse the repository at this point in the history
Replace the zenfs-test-harness releated lines with the concrete
implementation of the mtr-test test case.

Signed-off-by: Dennis Maisenbacher <[email protected]>
Co-authored-by: Andreas Hindborg <[email protected]>
  • Loading branch information
MaisenbacherD and metaspace committed Aug 26, 2024
1 parent b94e29c commit 5de0863
Show file tree
Hide file tree
Showing 15 changed files with 373 additions and 84 deletions.
81 changes: 29 additions & 52 deletions .github/workflows/containerfiles/Dockerfile.percona-debian-build
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM docker.io/ubuntu:20.04 AS builder
FROM docker.io/ubuntu:20.04

RUN apt-get update \
&& \
Expand All @@ -23,44 +23,6 @@ RUN apt-get update \
libgflags-dev \
bison \
wget \
&& apt-get clean

ENV WORK_PATH=/percona/work
ENV INSTALL_PATH=/percona/dest
RUN mkdir -p $WORK_PATH
RUN mkdir -p $INSTALL_PATH

WORKDIR $WORK_PATH

ARG PERCONA_SERVER_BASE
ARG ZENFS_REPO
ARG ZENFS_BRANCH
RUN mkdir -p /tmp/BUILD_PS

# Following the percona blog post to build the debian packages: https://www.percona.com/blog/2021/03/10/how-to-build-percona-server-for-mysql-from-sources/

RUN wget https://raw.githubusercontent.com/percona/percona-server/8.0/build-ps/percona-server-8.0_builder.sh
RUN sed -i 's=#!/bin/sh=#!/bin/bash=' percona-server-8.0_builder.sh
RUN chmod +x percona-server-8.0_builder.sh
ENV DEB_RELEASE_EXTRA=experimentalZenFS
RUN ./percona-server-8.0_builder.sh --builddir=/tmp/BUILD_PS --install_deps=1 --with_zenfs=1 --deb_release=${DEB_RELEASE_EXTRA}
# PERCONA_SERVER_BASE must have an origin in a Percona-Server-* tag.
RUN ./percona-server-8.0_builder.sh --builddir=/tmp/BUILD_PS --get_sources=1 --branch=${PERCONA_SERVER_BASE} --with_zenfs=1 --zenfs_branch=${ZENFS_BRANCH} --zenfs_repo=${ZENFS_REPO} --deb_release=${DEB_RELEASE_EXTRA}
RUN ./percona-server-8.0_builder.sh --builddir=/tmp/BUILD_PS --build_source_deb=1 --with_zenfs=1 --deb_release=${DEB_RELEASE_EXTRA}
RUN ./percona-server-8.0_builder.sh --builddir=/tmp/BUILD_PS --build_deb=1 --with_zenfs=1 --deb_release=${DEB_RELEASE_EXTRA}

ENV PATH="$INSTALL_PATH/bin:$PATH"
ENV LD_LIBRARY_PATH="$INSTALL_PATH/lib"


FROM docker.io/ubuntu:20.04

ENV DEBIAN_FRONTEND=noninteractive
ENV DEBCONF_NONINTERACTIVE_SEEN=true

RUN apt-get update \
&& \
apt-get install --yes --quiet=2 \
zlib1g-dev \
valgrind \
libssl1.1 \
Expand All @@ -85,32 +47,50 @@ RUN apt-get update \
python2 \
build-essential \
python-dev \
wget \
sudo \
automake \
libtool \
pkg-config \
libaio-dev \
git \
&& apt-get clean

RUN wget https://repo.percona.com/apt/pool/main/j/jemalloc/libjemalloc1_3.6.0-2.focal_amd64.deb
RUN dpkg -i libjemalloc1_3.6.0-2.focal_amd64.deb

ENV WORK_PATH=/percona/work/
ENV WORK_PATH=/percona/work
ENV INSTALL_PATH=/percona/dest
ENV ZENFS_SOURCE_PATH=$INSTALL_PATH/zenfs
ENV BUILD_PATH=/tmp/BUILD_PS
RUN mkdir -p $WORK_PATH
RUN mkdir -p $INSTALL_PATH
RUN mkdir -p $ZENFS_SOURCE_PATH
RUN mkdir -p $BUILD_PATH

WORKDIR $WORK_PATH

COPY --from=builder /tmp/BUILD_PS/*.deb $WORK_PATH
COPY --from=builder /tmp/BUILD_PS/percona-server-*/storage/rocksdb/rocksdb_plugins/zenfs $ZENFS_SOURCE_PATH
ARG PERCONA_SERVER_BASE
ARG ZENFS_REPO
ARG ZENFS_BRANCH

# Following the percona blog post to build the debian packages: https://www.percona.com/blog/2021/03/10/how-to-build-percona-server-for-mysql-from-sources/

RUN wget https://raw.githubusercontent.com/percona/percona-server/8.0/build-ps/percona-server-8.0_builder.sh
RUN sed -i 's=#!/bin/sh=#!/bin/bash=' percona-server-8.0_builder.sh
RUN chmod +x percona-server-8.0_builder.sh
ENV DEB_RELEASE_EXTRA=experimentalZenFS
RUN ./percona-server-8.0_builder.sh --builddir=${BUILD_PATH} --install_deps=1 --with_zenfs=1 --deb_release=${DEB_RELEASE_EXTRA}
# PERCONA_SERVER_BASE must have an origin in a Percona-Server-* tag.
RUN ./percona-server-8.0_builder.sh --builddir=${BUILD_PATH} --get_sources=1 --branch=${PERCONA_SERVER_BASE} --with_zenfs=1 --zenfs_branch=${ZENFS_BRANCH} --zenfs_repo=${ZENFS_REPO} --deb_release=${DEB_RELEASE_EXTRA}
RUN ./percona-server-8.0_builder.sh --builddir=${BUILD_PATH} --build_source_deb=1 --with_zenfs=1 --deb_release=${DEB_RELEASE_EXTRA}
RUN ./percona-server-8.0_builder.sh --builddir=${BUILD_PATH} --build_deb=1 --with_zenfs=1 --deb_release=${DEB_RELEASE_EXTRA}

ENV PATH="$INSTALL_PATH/bin:$PATH"
ENV LD_LIBRARY_PATH="$INSTALL_PATH/lib"

RUN wget https://repo.percona.com/apt/pool/main/j/jemalloc/libjemalloc1_3.6.0-2.focal_amd64.deb
RUN dpkg -i libjemalloc1_3.6.0-2.focal_amd64.deb

WORKDIR $BUILD_PATH
RUN dpkg -i *.deb

RUN find ${BUILD_PATH} -type f -name zenfs | xargs -I {} cp {} ${INSTALL_PATH}
RUN find ${BUILD_PATH} -type f -name mysql-test-run.pl | grep builddir | xargs -I {} ln -s {} ${INSTALL_PATH}/mtr

RUN apt-get update \
&& \
apt-get install --yes --quiet=2 \
Expand All @@ -126,6 +106,3 @@ RUN git clone https://github.com/akopytov/sysbench.git \
&& make -j \
&& make install \
&& cd -

ENV PATH="$INSTALL_PATH/bin:$PATH"
ENV LD_LIBRARY_PATH="$INSTALL_PATH/lib"
99 changes: 99 additions & 0 deletions .github/workflows/containerfiles/Dockerfile.percona-server
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
FROM docker.io/ubuntu:22.04 AS builder

RUN apt-get update \
&& \
DEBIAN_FRONTEND=noninteractive \
DEBCONF_NONINTERACTIVE_SEEN=true \
apt-get install --yes --quiet=2 \
build-essential \
git \
pkg-config \
cmake \
autoconf \
autoconf-archive \
automake \
libtool \
zlib1g-dev \
valgrind \
libssl-dev \
libncurses-dev \
libldap2-dev \
libreadline-dev \
libcurl4-openssl-dev \
libgflags-dev \
bison \
&& apt-get clean

ENV WORK_PATH=/percona/work
ENV INSTALL_PATH=/percona/dest
RUN mkdir -p $WORK_PATH
RUN mkdir -p $INSTALL_PATH

WORKDIR $WORK_PATH

ARG LIBZBD_GIT_CHECKOUT
RUN git clone --quiet --single-branch --branch master -n --quiet http://github.com/westerndigitalcorporation/libzbd.git \
&& cd libzbd \
&& git checkout $LIBZBD_GIT_CHECKOUT
RUN cd libzbd && sh autogen.sh && ./configure --prefix=${INSTALL_PATH} && make install

COPY percona-server percona-server
RUN PKG_CONFIG_PATH=$INSTALL_PATH/lib/pkgconfig \
cmake ./percona-server \
-DUSE_VALGRIND=ON \
-DCMAKE_C_FLAGS="-mno-avx512f" \
-DCMAKE_CXX_FLAGS="-mno-avx512f" \
-DWITH_AUTHENTICATION_KERBEROS=OFF \
-DWITH_AUTHENTICATION_LDAP=OFF \
-DWITH_KERBEROS=none \
-DWITH_ROCKSDB=ON \
-DROCKSDB_PLUGINS=zenfs \
-DWITH_ZENFS_UTILITY=ON \
-DDOWNLOAD_BOOST=1\
-DWITH_BOOST=$WORK_PATH/boost \
-DCMAKE_INSTALL_PREFIX=${INSTALL_PATH} \
&& make -j$(nproc) \
&& make install

FROM docker.io/ubuntu:22.04
RUN apt-get update \
&& \
DEBIAN_FRONTEND=noninteractive \
DEBCONF_NONINTERACTIVE_SEEN=true \
apt-get install --yes --quiet=2 \
build-essential \
zlib1g-dev \
valgrind \
libssl3 \
libssl-dev \
libncurses6 \
libncursesw6 \
libldap2-dev \
libreadline8 \
libcurl4 \
libgflags2.2 \
libmysqlclient-dev \
perl \
python3-dev \
python3-pip \
python-is-python3 \
pkg-config \
&& apt-get clean

ENV WORK_PATH=/percona/work
ENV INSTALL_PATH=/percona/dest
RUN mkdir -p $WORK_PATH
RUN mkdir -p $INSTALL_PATH

WORKDIR $WORK_PATH

COPY --from=builder $INSTALL_PATH $INSTALL_PATH
# Changeing access permissions of directories in $INSTALL_PATH is needed for the mysql-test-run.pl (see line 2415 and 3053)
RUN find $INSTALL_PATH -type d -exec chmod 777 {} +
RUN adduser --quiet --disabled-password mysql
RUN apt-get update && apt-get install -y --quiet sudo

ENV PATH="$INSTALL_PATH/bin:$PATH"
ENV LD_LIBRARY_PATH="$INSTALL_PATH/lib"

RUN export MYSQLCLIENT_CFLAGS=$(pkg-config mysqlclient --cflags); export MYSQLCLIENT_LDFLAGS=$(pkg-config mysqlclient --libs); pip install mysqlclient;
118 changes: 86 additions & 32 deletions .github/workflows/mtr-test.yaml
Original file line number Diff line number Diff line change
@@ -1,62 +1,116 @@
#TODO: make sure to run on 1TB zns drives -> look at disk-select option
on:
workflow_dispatch:
schedule:
- cron: '0 22 * * fri'
name: MTR Tests
jobs:
mtr-tests:
runs-on: self-hosted
runs-on: nvme-zns
timeout-minutes: 1440
steps:
- name: Clean
run: rm -rf ${GITHUB_WORKSPACE}/*
- name: Checkout build scripts
run: git clone ~/harness.git
- name: Checkout percona-server
uses: actions/checkout@v2
with:
repository: percona/percona-server
ref: release-8.0.30-22
path: harness/percona-context/percona-server
submodules: true
- name: Remove default zenfs
run: rm -r harness/percona-context/percona-server/storage/rocksdb/rocksdb_plugins/zenfs
- name: Checkout recent zenfs
uses: actions/checkout@v2

- name: Prepare zoned block devices
run: |
for i in $(seq 0 3)
do
DEV="ZBD$i"
if [ ! -b "/dev/${!DEV}" ]
then
echo "/dev/${!DEV} is not available for zenfs-mtr!"
exit 1
fi
echo deadline > /sys/block/${!DEV}/queue/scheduler
done
- name: Checkout zenfs
uses: actions/checkout@v4
with:
fetch-depth: 0
path: harness/percona-context/percona-server/storage/rocksdb/rocksdb_plugins/zenfs
path: zenfs

- name: Create build directory
run: |
mkdir -p percona-build-dir
- name: Create result directory
run: |
mkdir -p percona-results
- name: Build docker image
run: |
podman build --cgroup-manager cgroupfs \
-t percona-debian \
-f zenfs/.github/workflows/containerfiles/Dockerfile.percona-debian-build \
--build-arg PERCONA_SERVER_BASE=Percona-Server-8.0.34-26 \
--build-arg ZENFS_BRANCH=${GITHUB_SHA} \
--build-arg ZENFS_REPO=https://github.com/${GITHUB_REPOSITORY}.git \
.
- name: Run MTR RocksDB test
id: mtrTest1
run: cd harness && st --silent -o logs/makeMtrRocksdb -- disk-select --disk 1TB -- make NO_VAGRANT=1 RUN_ARGS="mtrRocksdbTest" results/zenfs-mtr.xml
run: |
podman run --rm -i --device /dev/$ZBD0 \
--volume ${GITHUB_WORKSPACE}/zenfs/.github/workflows/mtr:/scripts \
--workdir /scripts \
--env DEVICE0="$ZBD0" \
percona-debian \
bash wrapper.sh bash mtr-rocksdb-test.sh
continue-on-error: true
- name: Collect MTR RocksDB results
run: cd harness && make NO_VAGRANT=1 upload
if: always()

- name: Run MTR RocksDB replication test
id: mtrTest2
run: cd harness && st --silent -o logs/makeMtrRocksdbReplication -- disk-select --disk 1TB --disk 1TB -- make NO_VAGRANT=1 RUN_ARGS="mtrRocksdbReplicationTest" results/zenfs-mtr.xml
run: |
podman run --rm -i --device /dev/$ZBD0 \
--device /dev/$ZBD1 \
--volume ${GITHUB_WORKSPACE}/zenfs/.github/workflows/mtr:/scripts \
--workdir /scripts \
--env DEVICE0="$ZBD0" \
--env DEVICE1="$ZBD1" \
percona-debian \
bash wrapper.sh bash mtr-rocksdb-replication-test.sh
continue-on-error: true
- name: Collect MTR RocksDB replication results
run: cd harness && make NO_VAGRANT=1 upload
if: always()

- name: Run MTR RocksDB parallel test
id: mtrTest3
run: cd harness && st --silent -o logs/makeMtrRocksdbParallel -- disk-select --disk 1TB --disk 1TB --disk 1TB --disk 1TB -- make NO_VAGRANT=1 RUN_ARGS="mtrRocksdbParallelTest" results/zenfs-mtr.xml
run: |
podman run --rm -i --device /dev/$ZBD0 \
--device /dev/$ZBD1 \
--device /dev/$ZBD2 \
--device /dev/$ZBD3 \
--volume ${GITHUB_WORKSPACE}/zenfs/.github/workflows/mtr:/scripts \
--workdir /scripts \
--env DEVICE0="$ZBD0" \
--env DEVICE1="$ZBD1" \
--env DEVICE2="$ZBD2" \
--env DEVICE3="$ZBD3" \
percona-debian \
bash wrapper.sh bash mtr-rocksdb-parallel-test.sh
continue-on-error: true
- name: Collect MTR RocksDB parallel results
run: cd harness && make NO_VAGRANT=1 upload
if: always()

- name: Run MTR RocksDB parallel replication test
id: mtrTest4
run: cd harness && st --silent -o logs/makeMtrRocksdbParallelReplication -- disk-select --disk 1TB --disk 1TB --disk 1TB --disk 1TB -- make NO_VAGRANT=1 RUN_ARGS="mtrRocksdbParallelReplicationTest" results/zenfs-mtr.xml
run: |
podman run --rm -i --device /dev/$ZBD0 \
--device /dev/$ZBD1 \
--device /dev/$ZBD2 \
--device /dev/$ZBD3 \
--volume ${GITHUB_WORKSPACE}/zenfs/.github/workflows/mtr:/scripts \
--workdir /scripts \
--env DEVICE0="$ZBD0" \
--env DEVICE1="$ZBD1" \
--env DEVICE2="$ZBD2" \
--env DEVICE3="$ZBD3" \
percona-debian \
bash wrapper.sh bash mtr-rocksdb-parallel-replication-test.sh
continue-on-error: true
- name: Collect MTR RocksDB parallel replication results
run: cd harness && make NO_VAGRANT=1 upload
if: always()

- name: Remove images
run: podman image prune --force
if: always()

- name: Failure check
if: steps.mtrTest1.outcome != 'success' || steps.mtrTest2.outcome != 'success' || steps.mtrTest3.outcome != 'success' || steps.mtrTest4.outcome != 'success'
if: steps.mtrTest1.outcome != 'success' || steps.mtrTest2.outcome != 'success' || steps.mtrTest3.outcome != 'success' || steps.mtrTest4.outcome != 'success'
run: exit 1
17 changes: 17 additions & 0 deletions .github/workflows/mtr/expected-mtr-failures
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
rocksdb.check_ignore_unknown_options : WL#0000 Need adapting
rocksdb.drop_table2 : WL#0000 Need adapting
rocksdb.rocksdb_fault_injection : WL#0000 Need adapting
rocksdb.track_and_verify_wals_in_manifest : WL#0000 Need adapting
rocksdb.type_char_index_ver_bump_verify : WL#0000 Need adapting
rocksdb.checkpoint : WL#0000 Need fixing the server
rocksdb.bloomfilter3 : WL#0000 Sporadic failures
rocksdb.bloomfilter_skip : WL#0000 Sporadic failures
rocksdb.rocksdb_read_free_rpl : WL#0000 Sporadic failures
rocksdb.optimize_table : WL#0000 Need adapting
rocksdb.issue896 : WL#0000 Sporadic failures
rocksdb.non_blocking_manual_compaction : WL#0000 Sporadic failures
rocksdb.add_index_inplace: WL#0000 Sporadic failures
rocksdb.partial_index_stress: WL#0000 TODO FIND OUT WHY THIS FAILS
rocksdb.show_table_status: WL#0000 TODO FIND OUT WHY THIS FAILS
rocksdb.rocksdb_icp: WL#0000 TODO FIND OUT WHY THIS FAILS
rocksdb.rocksdb_icp_rev: WL#0000 TODO FIND OUT WHY THIS FAILS
Loading

0 comments on commit 5de0863

Please sign in to comment.