From 25862e24ee0f23610f7e62206ac6563271cc6835 Mon Sep 17 00:00:00 2001 From: Purelind Date: Mon, 9 Dec 2024 17:12:54 +0800 Subject: [PATCH] feat: ci image add mysql 5.7 (#502) Add more tools to ci jenkins * mysql 5.7 * percona-toolkit Fix rust install package error * cargo-platform v0.1.9 need rustc 1.78 or newer --- dockerfiles/ci/base/Dockerfile | 30 ++++++++++++++++++++------ dockerfiles/ci/jenkins/tikv/Dockerfile | 5 ++++- 2 files changed, 28 insertions(+), 7 deletions(-) diff --git a/dockerfiles/ci/base/Dockerfile b/dockerfiles/ci/base/Dockerfile index 663a1193..d5d290f6 100644 --- a/dockerfiles/ci/base/Dockerfile +++ b/dockerfiles/ci/base/Dockerfile @@ -17,19 +17,28 @@ RUN --mount=type=cache,target=/var/cache/dnf \ pip install s3cmd==2.3.0 requests==2.26.0 certifi==2021.10.8 && \ pip3 install requests==2.27.1 -ENV MARIADB_VERSION=5.5.68 -ENV PATH=$PATH:/usr/local/mariadb/bin +# Install MySQL 5.7 # linux amd64 only RUN if [ "$(arch)" = "x86_64" ]; then \ echo "Detected amd64 architecture, proceeding with installation" && \ - wget https://archive.mariadb.org/mariadb-${MARIADB_VERSION}/bintar-linux-systemd-x86_64/mariadb-${MARIADB_VERSION}-linux-systemd-x86_64.tar.gz && \ - tar -xvf mariadb-${MARIADB_VERSION}-linux-systemd-x86_64.tar.gz && \ - mv mariadb-${MARIADB_VERSION}-linux-systemd-x86_64 /usr/local/mariadb && \ - rm mariadb-${MARIADB_VERSION}-linux-systemd-x86_64.tar.gz; \ + dnf module disable mysql -y && \ + echo '[mysql57-community]' > /etc/yum.repos.d/mysql57.repo && \ + echo 'name=MySQL 5.7 Community Server' >> /etc/yum.repos.d/mysql57.repo && \ + echo 'baseurl=http://repo.mysql.com/yum/mysql-5.7-community/el/7/$basearch/' >> /etc/yum.repos.d/mysql57.repo && \ + echo 'enabled=1' >> /etc/yum.repos.d/mysql57.repo && \ + echo 'gpgcheck=0' >> /etc/yum.repos.d/mysql57.repo && \ + dnf install -y mysql-community-server && \ + dnf clean all && \ + rm -rf /var/cache/dnf; \ else \ echo "Architecture not supported: $(arch)"; \ fi +# Install gbk support +RUN --mount=type=cache,target=/var/cache/dnf \ + dnf install -y glibc-locale-source && \ + localedef -f GBK -i zh_CN zh_CN.gbk + # install golang toolchain # renovate: datasource=docker depName=golang ARG GOLANG_VERSION=1.23.3 @@ -109,3 +118,12 @@ RUN if [ "$(arch)" = "x86_64" ]; then \ echo "Architecture not supported: $(arch)"; \ fi ENV PATH=$PATH:/usr/local/pulsar/bin + +# install percona-toolkit +# linux amd64 only +RUN if [ "$(arch)" = "x86_64" ]; then \ + echo "Detected amd64 architecture, proceeding with installation" && \ + dnf install -y https://repo.percona.com/testing/centos/7/RPMS/x86_64/percona-toolkit-3.0.12-1.el7.x86_64.rpm; \ + else \ + echo "Architecture not supported: $(arch)"; \ + fi diff --git a/dockerfiles/ci/jenkins/tikv/Dockerfile b/dockerfiles/ci/jenkins/tikv/Dockerfile index dcd8a6ee..72918cf9 100644 --- a/dockerfiles/ci/jenkins/tikv/Dockerfile +++ b/dockerfiles/ci/jenkins/tikv/Dockerfile @@ -35,8 +35,11 @@ ENV PATH="${CARGO_HOME}/bin:${PATH}" # install components RUN rustup component add rustfmt clippy rust-src llvm-tools +RUN rustup set profile minimal + # Install specific versions of cargo-nextest and cargo-sort -RUN cargo install cargo-nextest --version 0.9.72 && \ +RUN rustup update stable && rustup default stable && \ + cargo install cargo-nextest --version 0.9.72 && \ cargo install cargo-sort --version 1.0.9 ENV CARGO_INCREMENTAL=0