Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI: Replace opaque test harness workflows with explicit workflow implementation #294

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
111 changes: 111 additions & 0 deletions .github/workflows/containerfiles/Dockerfile.percona-debian-build
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
FROM docker.io/ubuntu:20.04

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 \
wget \
zlib1g-dev \
valgrind \
libssl1.1 \
libncurses6 \
libncursesw6 \
libldap-2.4-2 \
libreadline8 \
libcurl4 \
libgflags2.2 \
perl \
curl \
lsb-release \
debsums \
dialog \
apt-utils \
libaio1 \
libmecab2 \
libnuma1 \
psmisc \
libjemalloc2 \
libjemalloc-dev \
python2 \
build-essential \
python-dev \
sudo \
automake \
libtool \
pkg-config \
libaio-dev \
&& apt-get clean

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

WORKDIR $WORK_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 \
libmysqlclient-dev \
libssl-dev \
python3-mysqldb \
&& apt-get clean

WORKDIR $WORK_PATH
RUN git clone https://github.com/akopytov/sysbench.git \
&& cd sysbench \
&& ./autogen.sh \
&& ./configure \
&& make -j \
&& make install \
&& cd -

WORKDIR $BUILD_PATH
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;
90 changes: 90 additions & 0 deletions .github/workflows/containerfiles/Dockerfile.rocksdb-zenfs
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
FROM docker.io/ubuntu:20.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 \
libgflags-dev \
libsnappy-dev \
uuid-dev \
bison \
autopoint \
&& apt-get clean

ENV WORK_PATH=/rocks/work
ENV INSTALL_PATH=/rocks/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

RUN git clone --depth 1 --single-branch --branch v2.37.2 https://github.com/util-linux/util-linux \
&& cd util-linux \
&& ./autogen.sh \
&& ./configure --prefix=$INSTALL_PATH \
&& make blkzone \
&& install blkzone $INSTALL_PATH/bin

COPY rocksdb rocksdb
ARG ROCKSDB_DEBUG_LEVEL
RUN cd rocksdb \
&& DEBUG_LEVEL=$ROCKSDB_DEBUG_LEVEL \
ROCKSDB_PLUGINS=zenfs \
PREFIX=$INSTALL_PATH \
PKG_CONFIG_PATH=$INSTALL_PATH/lib/pkgconfig \
OBJ_DIR=/tmp/zenfs-build \
make -j$(nproc) db_bench db_stress ldb \
&& DEBUG_LEVEL=$ROCKSDB_DEBUG_LEVEL \
ROCKSDB_PLUGINS=zenfs \
PREFIX=$INSTALL_PATH \
PKG_CONFIG_PATH=$INSTALL_PATH/lib/pkgconfig \
OBJ_DIR=/tmp/zenfs-build \
make -j$(nproc) install \
&& install db_bench $INSTALL_PATH/bin \
&& install db_stress $INSTALL_PATH/bin \
&& install ldb $INSTALL_PATH/bin \
&& cd plugin/zenfs/util \
&& PKG_CONFIG_PATH=$INSTALL_PATH/lib/pkgconfig make \
&& install zenfs $INSTALL_PATH/bin

FROM docker.io/ubuntu:20.04
RUN apt-get update \
&& \
DEBIAN_FRONTEND=noninteractive \
DEBCONF_NONINTERACTIVE_SEEN=true \
apt-get install --yes --quiet=2 \
libgflags2.2 \
libsnappy1v5 \
python3 \
python3-distutils \
python3-matplotlib \
nvme-cli \
&& apt-get clean

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

WORKDIR $WORK_PATH

COPY --from=builder $INSTALL_PATH $INSTALL_PATH
COPY --from=builder $WORK_PATH/rocksdb/plugin/zenfs/tests $INSTALL_PATH/zenfs/test

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