Skip to content

Commit

Permalink
issue-686: support MySQL 8.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
shunki-fujita committed Jun 11, 2024
1 parent 52c7caa commit 1a1e6f3
Show file tree
Hide file tree
Showing 10 changed files with 71 additions and 15 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci-e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
name: Integration tests with MySQL
strategy:
matrix:
mysql-version: ["8.0.35", "8.0.36", "8.0.37"]
mysql-version: ["8.0.28", "8.0.36", "8.0.37", "8.4.0"]
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
Expand All @@ -44,7 +44,7 @@ jobs:
name: Supported Kubernetes versions End-to-End Tests
strategy:
matrix:
mysql-version: ["8.0.37"]
mysql-version: ["8.4.0"]
k8s-version: ["1.27.13", "1.28.9", "1.29.4"]
runs-on:
group: moco
Expand All @@ -67,7 +67,7 @@ jobs:
name: Supported MySQL versions End-to-End Tests
strategy:
matrix:
mysql-version: ["8.0.35", "8.0.36", "8.0.37"]
mysql-version: ["8.0.28", "8.0.36", "8.0.37"]
k8s-version: ["1.29.4"]
runs-on:
group: moco
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/weekly.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
name: Integration tests with MySQL
strategy:
matrix:
mysql-version: ["8.0.18", "8.0.25", "8.0.26", "8.0.27", "8.0.28", "8.0.30", "8.0.31", "8.0.32", "8.0.33", "8.0.34", "8.0.35", "8.0.36", "8.0.37"]
mysql-version: ["8.0.28", "8.0.36", "8.0.37", "8.4.0"]
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
Expand All @@ -29,7 +29,7 @@ jobs:
name: Supported Kubernetes versions End-to-End Tests
strategy:
matrix:
mysql-version: ["8.0.37"]
mysql-version: ["8.4.0"]
k8s-version: ["1.27.13", "1.28.9", "1.29.4"]
runs-on:
group: moco
Expand All @@ -44,7 +44,7 @@ jobs:
name: Supported MySQL versions End-to-End Tests
strategy:
matrix:
mysql-version: ["8.0.18", "8.0.25", "8.0.26", "8.0.27", "8.0.28", "8.0.30", "8.0.31", "8.0.32", "8.0.33", "8.0.34", "8.0.35", "8.0.36", "8.0.37"]
mysql-version: ["8.0.28", "8.0.36", "8.0.37", "8.4.0"]
k8s-version: ["1.29.4"]
runs-on:
group: moco
Expand Down
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ USER 10000:10000
ENTRYPOINT ["/moco-controller"]

# For MySQL binaries
FROM --platform=$TARGETPLATFORM ghcr.io/cybozu-go/moco/mysql:8.0.37.1 as mysql
FROM --platform=$TARGETPLATFORM ghcr.io/cybozu-go/moco/mysql:8.4.0.1 as mysql

# the backup image
FROM --platform=$TARGETPLATFORM ghcr.io/cybozu/ubuntu:22.04
LABEL org.opencontainers.image.source https://github.com/cybozu-go/moco

ARG MYSQLSH_VERSION=8.0.37
ARG MYSQLSH_VERSION=8.4.0
ARG MYSQLSH_GLIBC_VERSION=2.28
ARG TARGETARCH

Expand All @@ -41,7 +41,7 @@ RUN apt-get update \
&& rm -rf /var/lib/apt/lists/* \
&& if [ "${TARGETARCH}" = 'amd64' ]; then MYSQLSH_ARCH='x86-64'; fi \
&& if [ "${TARGETARCH}" = 'arm64' ]; then MYSQLSH_ARCH='arm-64'; fi \
&& curl -o /tmp/mysqlsh.tar.gz -fsL "https://cdn.mysql.com//Downloads/MySQL-Shell/mysql-shell-${MYSQLSH_VERSION}-linux-glibc${MYSQLSH_GLIBC_VERSION}-${MYSQLSH_ARCH:-unknown}bit.tar.gz" \
&& curl -o /tmp/mysqlsh.tar.gz -fsL "https://cdn.mysql.com/Downloads/MySQL-Shell/mysql-shell-${MYSQLSH_VERSION}-linux-glibc${MYSQLSH_GLIBC_VERSION}-${MYSQLSH_ARCH:-unknown}bit.tar.gz" \
&& mkdir /usr/local/mysql-shell \
&& tar -xf /tmp/mysqlsh.tar.gz -C /usr/local/mysql-shell --strip-components=1 \
&& rm -f /tmp/mysqlsh.tar.gz
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ CTRL_RUNTIME_VERSION := $(shell awk '/sigs.k8s.io\/controller-runtime/ {print su
KUSTOMIZE_VERSION = 5.4.1
HELM_VERSION = 3.15.0
CRD_TO_MARKDOWN_VERSION = 0.0.3
MYSQLSH_VERSION = 8.0.37-1
MYSQLSH_VERSION = 8.4.0-1
MDBOOK_VERSION = 0.4.37
GORELEASER_VERSION = 1.26.1
YQ_VERSION = 4.44.1
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Blog article: [Introducing MOCO, a modern MySQL operator on Kubernetes](https://

## Supported software

- MySQL: 8.0.18, 8.0.25, 8.0.26, 8.0.27, 8.0.28, 8.0.30, 8.0.31, 8.0.32, 8.0.33, 8.0.34, 8.0.35, 8.0.36, 8.0.37
- MySQL: 8.0.28, 8.0.36, 8.0.37, 8.4.0
- Kubernetes: 1.27, 1.28, 1.29

MOCO supports (tests) the LTS releases of MySQL 8.
Expand Down Expand Up @@ -74,7 +74,7 @@ spec:
spec:
containers:
- name: mysqld
image: ghcr.io/cybozu-go/moco/mysql:8.0.37
image: ghcr.io/cybozu-go/moco/mysql:8.4.0
volumeClaimTemplates:
- metadata:
name: mysql-data
Expand Down
40 changes: 40 additions & 0 deletions containers/mysql/8.4.0/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
FROM ghcr.io/cybozu/ubuntu-dev:22.04 AS builder

ARG MYSQL_VERSION=8.4.0

RUN apt-get update && apt-get -y install --no-install-recommends \
cmake \
libncurses5-dev \
libjemalloc-dev \
libnuma-dev \
libaio-dev \
pkg-config

RUN cd tmp/ \
&& curl -fsSL -O https://dev.mysql.com/get/Downloads/MySQL-8.4/mysql-${MYSQL_VERSION}.tar.gz \
&& tar -x -z -f mysql-${MYSQL_VERSION}.tar.gz \
&& cd mysql-${MYSQL_VERSION} \
&& mkdir bld \
&& cd bld \
&& cmake .. -DBUILD_CONFIG=mysql_release -DCMAKE_BUILD_TYPE=Release -DWITH_NUMA=1 -DWITH_JEMALLOC=1 -DWITH_PACKAGE_FLAGS=0 \
&& make -j 20 \
&& make install

FROM ghcr.io/cybozu/ubuntu:22.04

COPY --from=builder /usr/local/mysql/LICENSE /usr/local/mysql/LICENSE
COPY --from=builder /usr/local/mysql/bin /usr/local/mysql/bin
COPY --from=builder /usr/local/mysql/lib /usr/local/mysql/lib
COPY --from=builder /usr/local/mysql/share /usr/local/mysql/share

RUN apt-get update \
&& apt-get install -y --no-install-recommends libjemalloc2 libnuma1 libaio1 \
&& rm -rf /var/lib/apt/lists/* \
&& mkdir -p /var/lib/mysql \
&& chown -R 10000:10000 /var/lib/mysql

ENV PATH=/usr/local/mysql/bin:"$PATH"
VOLUME /var/lib/mysql
ENTRYPOINT ["mysqld"]
EXPOSE 3306 33060 33062 8080
USER 10000:10000
1 change: 1 addition & 0 deletions containers/mysql/8.4.0/TAG
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
8.4.0.1
15 changes: 15 additions & 0 deletions containers/mysql/8.4.0/container-structure-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
schemaVersion: '2.0.0'
fileExistenceTests:
- name: 'mysqld'
path: '/usr/local/mysql/bin/mysqld'
shouldExist: true
isExecutableBy: 'owner'
- name: 'mysql lib'
path: '/usr/local/mysql/lib'
shouldExist: true
- name: 'mysql share'
path: '/usr/local/mysql/share'
shouldExist: true
- name: 'mysql LICENSE'
path: '/usr/local/mysql/LICENSE'
shouldExist: true
2 changes: 1 addition & 1 deletion e2e/Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
KIND_VERSION = 0.23.0
KUBERNETES_VERSION = 1.29.4
CERT_MANAGER_VERSION = 1.14.5
MYSQL_VERSION = 8.0.37
MYSQL_VERSION = 8.4.0

KIND := $(dir $(shell pwd))/bin/kind
KUBECTL := $(dir $(shell pwd))/bin/kubectl
Expand Down
4 changes: 2 additions & 2 deletions e2e/upgrade_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ import (
var upgradeYAML string

const (
mysqlVersionOld = "8.0.18"
mysqlVersionNew = "8.0.25"
mysqlVersionOld = "8.0.28"
mysqlVersionNew = "8.0.37"
)

var _ = Context("upgrade", func() {
Expand Down

0 comments on commit 1a1e6f3

Please sign in to comment.