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

Adding VersionStream for percona-server-9.0 #35288

Merged
merged 5 commits into from
Dec 10, 2024
Merged
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
186 changes: 186 additions & 0 deletions percona-server-9.0.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,186 @@
package:
name: percona-server-9.0
version: 9.0.1.1
epoch: 0
description: "Percona Server for MySQL is a free, fully compatible, enhanced, and open source drop-in replacement for any MySQL database. It provides superior performance, scalability, and instrumentation."
copyright:
- license: GPL-3.0-or-later
- license: BSD-3-Clause
resources:
cpu: 16
memory: 16Gi
dependencies:
provides:
- percona-server=${{package.full-version}}
runtime:
- bash
- busybox

# Replace the last `.` with `-` to fetch the correct tag.
var-transforms:
- from: ${{package.version}}
match: '\.(\d+)$'
replace: "-$1"
to: mangled-package-version

environment:
contents:
packages:
- bison
- build-base
- busybox
- ca-certificates-bundle
- clang-extras
- cmake
- curl-dev
- icu-dev
- libaio-dev
- libedit-dev
- libevent-dev
- libfido2-dev
- libtirpc-dev
- linux-pam-dev
- lz4-dev
- ncurses-dev
- nfs-utils
- ninja
- openldap-dev
- openssl-dev
- pcre2-dev
- perl
- readline-dev
- reflex
- rpcgen
- samurai
- sed
- wolfi-baselayout
- xz-dev
- zlib-dev
- zstd-dev

pipeline:
# This package requires boost 1.77 and we are not building that version.
- working-directory: /home/build/boost
pipeline:
- uses: fetch
with:
uri: https://boostorg.jfrog.io/artifactory/main/release/1.77.0/source/boost_1_77_0.tar.bz2
expected-sha256: fc9f85fc030e233142908241af7a846e60630aa7388de9a5fafb1f3a26840854

- uses: git-checkout
with:
repository: https://github.com/percona/percona-server
tag: Percona-Server-${{vars.mangled-package-version}}
expected-commit: 6feb03ff8ed4663c03dd5553f77dd7e4bffbd950
recurse-submodules: true

- name: "Remove Coredumper Support"
runs: |
sed -i 's/INCLUDE(coredumper)//g' CMakeLists.txt
sed -i 's/MYSQL_CHECK_COREDUMPER()//g' CMakeLists.txt
sed -i 's/OPTION (WITH_COREDUMPER "Enable support for coredumper library" ON)//g' CMakeLists.txt

- name: "Cmake"
runs: |
mkdir build && cd build
cmake . -G Ninja \
-DBUILD_CONFIG=mysql_release \
-DWITH_EDITLINE=system \
-DCMAKE_INSTALL_PREFIX=/usr \
-DSYSCONFDIR=/etc \
-DMYSQL_DATADIR=/var/lib/mysql \
-DMYSQL_UNIX_ADDR=/run/mysqld/mysqld.sock \
-DDEFAULT_CHARSET=utf8mb4 \
-DDEFAULT_COLLATION=utf8mb4_general_ci \
-DENABLED_LOCAL_INFILE=ON \
-DINSTALL_INFODIR=share/info \
-DINSTALL_MANDIR=share/man \
-DINSTALL_PLUGINDIR=lib/${{package.name}}/plugin \
-DINSTALL_INCLUDEDIR=include/mysql \
-DINSTALL_DOCREADMEDIR=share/doc/${{package.name}} \
-DINSTALL_SUPPORTFILESDIR=share/${{package.name}} \
-DINSTALL_DOCDIR=share/doc/${{package.name}} \
-DWITH_ROCKSDB=YES \
-DWITH_ASAN=OFF \
-DWITH_EXTRA_CHARSETS=complex \
-DWITH_SYSTEMD=no \
-DWITH_SSL=system \
-DWITH_LZ4=system \
-DWITH_ICU=system \
-DWITH_FIDO=system \
-DWITH_VALGRIND=OFF \
-DWITH_ZLIB=system \
-DWITH_ZSTD=system \
-DWITH_TEST=off \
..

- name: "Install"
runs: |
cd build
DESTDIR="${{targets.destdir}}" ninja install

- name: "Remove extras"
runs: |
rm -rf "${{targets.destdir}}"/usr/mysql-test
rm -rf "${{targets.destdir}}"/usr/lib/libmysqlclient.so
rm -rf "${{targets.destdir}}"/usr/lib/libmysqlclient_r.so

- name: "Create required data directories"
runs: |
mkdir -p "${{targets.destdir}}"/run/mysqld
mkdir -p "${{targets.destdir}}"/var/lib/mysql
mkdir -p "${{targets.destdir}}"/var/tmp

subpackages:
- name: "${{package.name}}-dev"
description: "headers for percona-server"
pipeline:
- uses: split/dev

- name: ${{package.name}}-oci-entrypoint
description: Entrypoint for using Percona Server in OCI containers
pipeline:
- runs: |
mkdir -p ${{targets.contextdir}}/
cp docker-entrypoint.sh ${{targets.contextdir}}/docker-entrypoint.sh
chmod +x ${{targets.contextdir}}/docker-entrypoint.sh

update:
enabled: true
github:
identifier: percona/percona-server
tag-filter: Percona-Server-9.0.
strip-prefix: Percona-Server-
use-tag: true
version-transform:
- match: ^(.+)\-(\d+)$
replace: $1.$2

test:
pipeline:
- name: Create mysql user and prepare environment
runs: |
# Create a non-root user for the MySQL test...
adduser -D -h /home/mysql mysql
chown -R mysql:mysql /var/lib/mysql /run/mysqld /var/tmp
mkdir -p /run/mysqld /var/lib/mysql /var/tmp
chown -R mysql:mysql /run/mysqld /var/lib/mysql /var/tmp
- name: Initialize MySQL data directory
runs: |
su mysql -c "mysqld --initialize-insecure --datadir=/var/lib/mysql" || exit 1
- name: Start MySQL server with no password validation
runs: |
su mysql -c "mysqld --datadir=/var/lib/mysql --socket=/run/mysqld/mysqld.sock --skip-grant-tables &"
sleep 10
su mysql -c "mysqladmin ping --socket=/run/mysqld/mysqld.sock" || exit 1
- name: Create test database
runs: |
echo "CREATE DATABASE test_db;" | su mysql -c "mysql --socket=/run/mysqld/mysqld.sock" || exit 1
- name: Run test query
runs: |
echo "CREATE TABLE test_db.test_table (id INT PRIMARY KEY, name VARCHAR(50));" | su mysql -c "mysql --socket=/run/mysqld/mysqld.sock" || exit 1
echo "INSERT INTO test_db.test_table (id, name) VALUES (1, 'Percona Test');" | su mysql -c "mysql --socket=/run/mysqld/mysqld.sock" || exit 1
echo "SELECT * FROM test_db.test_table;" | su mysql -c "mysql --socket=/run/mysqld/mysqld.sock" || exit 1
- name: Stop MySQL server
runs: |
su mysql -c "mysqladmin shutdown --socket=/run/mysqld/mysqld.sock" || exit 1
Loading
Loading