This is an automated email from the ASF dual-hosted git repository.
potiuk pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/main by this push:
new f8f976dffcf Remove MySQL client (#57146)
f8f976dffcf is described below
commit f8f976dffcf3216e00b95667e0d9a4cbee112c94
Author: Jarek Potiuk <[email protected]>
AuthorDate: Thu Oct 23 14:07:28 2025 +0200
Remove MySQL client (#57146)
As discussed in
https://lists.apache.org/thread/cwfmqbzxsm0gobtpo8kmfr99nfv29c2y
we are temporarily (or not) removing MySQL client support from Airflow
container images in order to stop our CI canary builds from failing.
If consensus or vote will be reached to remove it, we will leave it as
is, if we will find other ways how to keep mysql client support, we
will revert that change and restore MySQL client support.
---
.github/workflows/prod-image-extra-checks.yml | 23 +-----
Dockerfile | 87 ++++++++------------
Dockerfile.ci | 87 ++++++++------------
dev/breeze/doc/images/output_ci-image_build.svg | 2 +-
dev/breeze/doc/images/output_ci-image_build.txt | 2 +-
dev/breeze/doc/images/output_prod-image_build.svg | 2 +-
dev/breeze/doc/images/output_prod-image_build.txt | 2 +-
dev/breeze/src/airflow_breeze/global_constants.py | 2 +-
docker-stack-docs/build.rst | 16 ++--
.../docker-examples/customizing/mysql-client.sh | 37 ---------
scripts/docker/install_mysql.sh | 93 ++++++++--------------
11 files changed, 106 insertions(+), 247 deletions(-)
diff --git a/.github/workflows/prod-image-extra-checks.yml
b/.github/workflows/prod-image-extra-checks.yml
index 2d8a950982f..5b3d072a49a 100644
--- a/.github/workflows/prod-image-extra-checks.yml
+++ b/.github/workflows/prod-image-extra-checks.yml
@@ -59,27 +59,6 @@ on: # yamllint disable-line rule:truthy
permissions:
contents: read
jobs:
- myssql-client-image:
- uses: ./.github/workflows/prod-image-build.yml
- with:
- runners: ${{ inputs.runners }}
- platform: ${{ inputs.platform }}
- build-type: "MySQL Client"
- upload-image-artifact: "false"
- upload-package-artifact: "false"
- install-mysql-client-type: "mysql"
- python-versions: ${{ inputs.python-versions }}
- default-python-version: "${{ inputs.default-python-version }}"
- branch: ${{ inputs.branch }}
- # Always build images during the extra checks and never push them
- push-image: "false"
- use-uv: "true"
- upgrade-to-newer-dependencies: ${{ inputs.upgrade-to-newer-dependencies
}}
- constraints-branch: ${{ inputs.constraints-branch }}
- docker-cache: ${{ inputs.docker-cache }}
- disable-airflow-repo-cache: ${{ inputs.disable-airflow-repo-cache }}
- prod-image-build: "true"
-
pip-image:
uses: ./.github/workflows/prod-image-build.yml
with:
@@ -88,7 +67,7 @@ jobs:
build-type: "pip"
upload-image-artifact: "false"
upload-package-artifact: "false"
- install-mysql-client-type: "mysql"
+ install-mysql-client-type: "mariadb"
python-versions: ${{ inputs.python-versions }}
default-python-version: "${{ inputs.default-python-version }}"
branch: ${{ inputs.branch }}
diff --git a/Dockerfile b/Dockerfile
index 0879f495a9b..514dd53aa1c 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -443,12 +443,41 @@ set -euo pipefail
common::get_colors
declare -a packages
-readonly MYSQL_LTS_VERSION="8.0"
readonly MARIADB_LTS_VERSION="10.11"
: "${INSTALL_MYSQL_CLIENT:?Should be true or false}"
: "${INSTALL_MYSQL_CLIENT_TYPE:-mariadb}"
+if [[ "${INSTALL_MYSQL_CLIENT}" != "true" && "${INSTALL_MYSQL_CLIENT}" !=
"false" ]]; then
+ echo
+ echo "${COLOR_RED}INSTALL_MYSQL_CLIENT must be either true or
false${COLOR_RESET}"
+ echo
+ exit 1
+fi
+
+if [[ "${INSTALL_MYSQL_CLIENT_TYPE}" != "mysql" &&
"${INSTALL_MYSQL_CLIENT_TYPE}" != "mariadb" ]]; then
+ echo
+ echo "${COLOR_RED}INSTALL_MYSQL_CLIENT_TYPE must be either mysql or
mariadb${COLOR_RESET}"
+ echo
+ exit 1
+fi
+
+if [[ "${INSTALL_MYSQL_CLIENT_TYPE}" == "mysql" ]]; then
+ echo
+ echo "${COLOR_RED}The 'mysql' client type is not supported any more. Use
'mariadb' instead.${COLOR_RESET}"
+ echo
+ echo "The MySQL drivers are wrongly packaged and released by Oracle with
an expiration date on their GPG keys,"
+ echo "which causes builds to fail after the expiration date. MariaDB
client is protocol-compatible with MySQL client."
+ echo ""
+ echo "Every two years the MySQL packages fail and Oracle team is always
surprised and struggling"
+ echo "with fixes and re-signing the packages which lasts few days"
+ echo "See https://bugs.mysql.com/bug.php?id=113432 for more details."
+ echo "As a community we are not able to support this broken packaging
practice from Oracle"
+ echo "Feel free however to install MySQL drivers on your own as extension
of the image."
+ echo
+ exit 1
+fi
+
retry() {
local retries=3
local count=0
@@ -467,44 +496,6 @@ retry() {
done
}
-install_mysql_client() {
- if [[ "${1}" == "dev" ]]; then
- packages=("libmysqlclient-dev" "mysql-client")
- elif [[ "${1}" == "prod" ]]; then
- # `libmysqlclientXX` where XX is number, and it should be increased
every new GA MySQL release, for example
- # 18 - MySQL 5.6.48
- # 20 - MySQL 5.7.42
- # 21 - MySQL 8.0.34
- # 22 - MySQL 8.1
- packages=("libmysqlclient21" "mysql-client")
- else
- echo
- echo "${COLOR_RED}Specify either prod or dev${COLOR_RESET}"
- echo
- exit 1
- fi
-
- common::import_trusted_gpg "B7B3B788A8D3785C" "mysql"
-
- echo
- echo "${COLOR_BLUE}Installing Oracle MySQL client version
${MYSQL_LTS_VERSION}: ${1}${COLOR_RESET}"
- echo
-
- echo "deb http://repo.mysql.com/apt/debian/ $(lsb_release -cs)
mysql-${MYSQL_LTS_VERSION}" > \
- /etc/apt/sources.list.d/mysql.list
- retry apt-get update
- retry apt-get install --no-install-recommends -y "${packages[@]}"
- apt-get autoremove -yqq --purge
- apt-get clean && rm -rf /var/lib/apt/lists/*
-
- # Remove mysql repository from sources.list.d as MySQL repos have a basic
flaw that they put expiry
- # date on their GPG signing keys and they sign their repo with those keys.
This means that after a
- # certain date, the GPG key becomes invalid and if you have the repository
added in your sources.list
- # then you will not be able to install anything from any other repository.
This id unlike any other
- # repository we have seen (for example Postgres, MariaDB, MsSQL - all have
non-expiring signing keys)
- rm /etc/apt/sources.list.d/mysql.list
-}
-
install_mariadb_client() {
# List of compatible package Oracle MySQL -> MariaDB:
# `mysql-client` -> `mariadb-client` or `mariadb-client-compat` (11+)
@@ -544,23 +535,7 @@ install_mariadb_client() {
}
if [[ ${INSTALL_MYSQL_CLIENT:="true"} == "true" ]]; then
- if [[ $(uname -m) == "arm64" || $(uname -m) == "aarch64" ]]; then
- INSTALL_MYSQL_CLIENT_TYPE="mariadb"
- echo
- echo "${COLOR_YELLOW}Client forced to mariadb for ARM${COLOR_RESET}"
- echo
- fi
-
- if [[ "${INSTALL_MYSQL_CLIENT_TYPE}" == "mysql" ]]; then
- install_mysql_client "${@}"
- elif [[ "${INSTALL_MYSQL_CLIENT_TYPE}" == "mariadb" ]]; then
- install_mariadb_client "${@}"
- else
- echo
- echo "${COLOR_RED}Specify either mysql or mariadb, got
${INSTALL_MYSQL_CLIENT_TYPE}${COLOR_RESET}"
- echo
- exit 1
- fi
+ install_mariadb_client "${@}"
fi
EOF
diff --git a/Dockerfile.ci b/Dockerfile.ci
index 6eb557ad7d4..74d29fb2527 100644
--- a/Dockerfile.ci
+++ b/Dockerfile.ci
@@ -383,12 +383,41 @@ set -euo pipefail
common::get_colors
declare -a packages
-readonly MYSQL_LTS_VERSION="8.0"
readonly MARIADB_LTS_VERSION="10.11"
: "${INSTALL_MYSQL_CLIENT:?Should be true or false}"
: "${INSTALL_MYSQL_CLIENT_TYPE:-mariadb}"
+if [[ "${INSTALL_MYSQL_CLIENT}" != "true" && "${INSTALL_MYSQL_CLIENT}" !=
"false" ]]; then
+ echo
+ echo "${COLOR_RED}INSTALL_MYSQL_CLIENT must be either true or
false${COLOR_RESET}"
+ echo
+ exit 1
+fi
+
+if [[ "${INSTALL_MYSQL_CLIENT_TYPE}" != "mysql" &&
"${INSTALL_MYSQL_CLIENT_TYPE}" != "mariadb" ]]; then
+ echo
+ echo "${COLOR_RED}INSTALL_MYSQL_CLIENT_TYPE must be either mysql or
mariadb${COLOR_RESET}"
+ echo
+ exit 1
+fi
+
+if [[ "${INSTALL_MYSQL_CLIENT_TYPE}" == "mysql" ]]; then
+ echo
+ echo "${COLOR_RED}The 'mysql' client type is not supported any more. Use
'mariadb' instead.${COLOR_RESET}"
+ echo
+ echo "The MySQL drivers are wrongly packaged and released by Oracle with
an expiration date on their GPG keys,"
+ echo "which causes builds to fail after the expiration date. MariaDB
client is protocol-compatible with MySQL client."
+ echo ""
+ echo "Every two years the MySQL packages fail and Oracle team is always
surprised and struggling"
+ echo "with fixes and re-signing the packages which lasts few days"
+ echo "See https://bugs.mysql.com/bug.php?id=113432 for more details."
+ echo "As a community we are not able to support this broken packaging
practice from Oracle"
+ echo "Feel free however to install MySQL drivers on your own as extension
of the image."
+ echo
+ exit 1
+fi
+
retry() {
local retries=3
local count=0
@@ -407,44 +436,6 @@ retry() {
done
}
-install_mysql_client() {
- if [[ "${1}" == "dev" ]]; then
- packages=("libmysqlclient-dev" "mysql-client")
- elif [[ "${1}" == "prod" ]]; then
- # `libmysqlclientXX` where XX is number, and it should be increased
every new GA MySQL release, for example
- # 18 - MySQL 5.6.48
- # 20 - MySQL 5.7.42
- # 21 - MySQL 8.0.34
- # 22 - MySQL 8.1
- packages=("libmysqlclient21" "mysql-client")
- else
- echo
- echo "${COLOR_RED}Specify either prod or dev${COLOR_RESET}"
- echo
- exit 1
- fi
-
- common::import_trusted_gpg "B7B3B788A8D3785C" "mysql"
-
- echo
- echo "${COLOR_BLUE}Installing Oracle MySQL client version
${MYSQL_LTS_VERSION}: ${1}${COLOR_RESET}"
- echo
-
- echo "deb http://repo.mysql.com/apt/debian/ $(lsb_release -cs)
mysql-${MYSQL_LTS_VERSION}" > \
- /etc/apt/sources.list.d/mysql.list
- retry apt-get update
- retry apt-get install --no-install-recommends -y "${packages[@]}"
- apt-get autoremove -yqq --purge
- apt-get clean && rm -rf /var/lib/apt/lists/*
-
- # Remove mysql repository from sources.list.d as MySQL repos have a basic
flaw that they put expiry
- # date on their GPG signing keys and they sign their repo with those keys.
This means that after a
- # certain date, the GPG key becomes invalid and if you have the repository
added in your sources.list
- # then you will not be able to install anything from any other repository.
This id unlike any other
- # repository we have seen (for example Postgres, MariaDB, MsSQL - all have
non-expiring signing keys)
- rm /etc/apt/sources.list.d/mysql.list
-}
-
install_mariadb_client() {
# List of compatible package Oracle MySQL -> MariaDB:
# `mysql-client` -> `mariadb-client` or `mariadb-client-compat` (11+)
@@ -484,23 +475,7 @@ install_mariadb_client() {
}
if [[ ${INSTALL_MYSQL_CLIENT:="true"} == "true" ]]; then
- if [[ $(uname -m) == "arm64" || $(uname -m) == "aarch64" ]]; then
- INSTALL_MYSQL_CLIENT_TYPE="mariadb"
- echo
- echo "${COLOR_YELLOW}Client forced to mariadb for ARM${COLOR_RESET}"
- echo
- fi
-
- if [[ "${INSTALL_MYSQL_CLIENT_TYPE}" == "mysql" ]]; then
- install_mysql_client "${@}"
- elif [[ "${INSTALL_MYSQL_CLIENT_TYPE}" == "mariadb" ]]; then
- install_mariadb_client "${@}"
- else
- echo
- echo "${COLOR_RED}Specify either mysql or mariadb, got
${INSTALL_MYSQL_CLIENT_TYPE}${COLOR_RESET}"
- echo
- exit 1
- fi
+ install_mariadb_client "${@}"
fi
EOF
diff --git a/dev/breeze/doc/images/output_ci-image_build.svg
b/dev/breeze/doc/images/output_ci-image_build.svg
index c3d011bfc6b..a2747cd73b0 100644
--- a/dev/breeze/doc/images/output_ci-image_build.svg
+++ b/dev/breeze/doc/images/output_ci-image_build.svg
@@ -366,7 +366,7 @@
</text><text class="breeze-ci-image-build-r5" x="0" y="1044.8"
textLength="12.2" clip-path="url(#breeze-ci-image-build-line-42)">│</text><text
class="breeze-ci-image-build-r4" x="24.4" y="1044.8" textLength="195.2"
clip-path="url(#breeze-ci-image-build-line-42)">--debian-version</text><text
class="breeze-ci-image-build-r1" x="439.2" y="1044.8" textLength="793"
clip-path="url(#breeze-ci-image-build-line-42)">Debian version used in Airflow image as base&#
[...]
</text><text class="breeze-ci-image-build-r5" x="0" y="1069.2"
textLength="12.2" clip-path="url(#breeze-ci-image-build-line-43)">│</text><text
class="breeze-ci-image-build-r5" x="439.2" y="1069.2" textLength="793"
clip-path="url(#breeze-ci-image-build-line-43)">[default: bookworm]                                  &#
[...]
</text><text class="breeze-ci-image-build-r5" x="0" y="1093.6"
textLength="12.2" clip-path="url(#breeze-ci-image-build-line-44)">│</text><text
class="breeze-ci-image-build-r4" x="24.4" y="1093.6" textLength="341.6"
clip-path="url(#breeze-ci-image-build-line-44)">--disable-airflow-repo-cache</text><text
class="breeze-ci-image-build-r1" x="439.2" y="1093.6" textLength="658.8"
clip-path="url(#breeze-ci-image-build-line-44)">Disable cache from Airflow repository duri
[...]
-</text><text class="breeze-ci-image-build-r5" x="0" y="1118" textLength="12.2"
clip-path="url(#breeze-ci-image-build-line-45)">│</text><text
class="breeze-ci-image-build-r4" x="24.4" y="1118" textLength="329.4"
clip-path="url(#breeze-ci-image-build-line-45)">--install-mysql-client-type</text><text
class="breeze-ci-image-build-r1" x="439.2" y="1118" textLength="475.8"
clip-path="url(#breeze-ci-image-build-line-45)">Which client to choose when installing.</text><te
[...]
+</text><text class="breeze-ci-image-build-r5" x="0" y="1118" textLength="12.2"
clip-path="url(#breeze-ci-image-build-line-45)">│</text><text
class="breeze-ci-image-build-r4" x="24.4" y="1118" textLength="329.4"
clip-path="url(#breeze-ci-image-build-line-45)">--install-mysql-client-type</text><text
class="breeze-ci-image-build-r1" x="439.2" y="1118" textLength="475.8"
clip-path="url(#breeze-ci-image-build-line-45)">Which client to choose when installing.</text><te
[...]
</text><text class="breeze-ci-image-build-r5" x="0" y="1142.4"
textLength="12.2" clip-path="url(#breeze-ci-image-build-line-46)">│</text><text
class="breeze-ci-image-build-r4" x="24.4" y="1142.4" textLength="170.8"
clip-path="url(#breeze-ci-image-build-line-46)">--python-image</text><text
class="breeze-ci-image-build-r1" x="439.2" y="1142.4" textLength="1000.4"
clip-path="url(#breeze-ci-image-build-line-46)">If specified this is the base python image
[...]
</text><text class="breeze-ci-image-build-r5" x="0" y="1166.8"
textLength="12.2" clip-path="url(#breeze-ci-image-build-line-47)">│</text><text
class="breeze-ci-image-build-r1" x="439.2" y="1166.8" textLength="1000.4"
clip-path="url(#breeze-ci-image-build-line-47)">something like: python:VERSION-slim-bookworm.                            
[...]
</text><text class="breeze-ci-image-build-r5" x="0" y="1191.2"
textLength="12.2" clip-path="url(#breeze-ci-image-build-line-48)">│</text><text
class="breeze-ci-image-build-r7" x="439.2" y="1191.2" textLength="1000.4"
clip-path="url(#breeze-ci-image-build-line-48)">(TEXT)                                     
[...]
diff --git a/dev/breeze/doc/images/output_ci-image_build.txt
b/dev/breeze/doc/images/output_ci-image_build.txt
index fa6a3ac990e..8787e9d5ea9 100644
--- a/dev/breeze/doc/images/output_ci-image_build.txt
+++ b/dev/breeze/doc/images/output_ci-image_build.txt
@@ -1 +1 @@
-7dee09c877f9b36af3952837456dfff7
+b2a363e61908ad8ae59df620f9c9ab46
diff --git a/dev/breeze/doc/images/output_prod-image_build.svg
b/dev/breeze/doc/images/output_prod-image_build.svg
index e2da038343f..5a5371d9af1 100644
--- a/dev/breeze/doc/images/output_prod-image_build.svg
+++ b/dev/breeze/doc/images/output_prod-image_build.svg
@@ -453,7 +453,7 @@
</text><text class="breeze-prod-image-build-r5" x="0" y="1850"
textLength="12.2"
clip-path="url(#breeze-prod-image-build-line-75)">│</text><text
class="breeze-prod-image-build-r4" x="24.4" y="1850" textLength="329.4"
clip-path="url(#breeze-prod-image-build-line-75)">--install-airflow-reference</text><text
class="breeze-prod-image-build-r1" x="597.8" y="1850" textLength="524.6"
clip-path="url(#breeze-prod-image-build-line-75)">Install Airflow using GitHub tag or&#
[...]
</text><text class="breeze-prod-image-build-r5" x="0" y="1874.4"
textLength="12.2"
clip-path="url(#breeze-prod-image-build-line-76)">│</text><text
class="breeze-prod-image-build-r4" x="24.4" y="1874.4" textLength="439.2"
clip-path="url(#breeze-prod-image-build-line-76)">--install-distributions-from-context</text><text
class="breeze-prod-image-build-r1" x="597.8" y="1874.4" textLength="841.8"
clip-path="url(#breeze-prod-image-build-line-76)">Install distributions from local
[...]
</text><text class="breeze-prod-image-build-r5" x="0" y="1898.8"
textLength="12.2"
clip-path="url(#breeze-prod-image-build-line-77)">│</text><text
class="breeze-prod-image-build-r1" x="597.8" y="1898.8" textLength="183"
clip-path="url(#breeze-prod-image-build-line-77)">image. Implies </text><text
class="breeze-prod-image-build-r4" x="780.8" y="1898.8" textLength="341.6"
clip-path="url(#breeze-prod-image-build-line-77)">--disable-airflow-repo-cache</text><text
class="breeze-prod [...]
-</text><text class="breeze-prod-image-build-r5" x="0" y="1923.2"
textLength="12.2"
clip-path="url(#breeze-prod-image-build-line-78)">│</text><text
class="breeze-prod-image-build-r4" x="24.4" y="1923.2" textLength="329.4"
clip-path="url(#breeze-prod-image-build-line-78)">--install-mysql-client-type</text><text
class="breeze-prod-image-build-r1" x="597.8" y="1923.2" textLength="475.8"
clip-path="url(#breeze-prod-image-build-line-78)">Which client to choose when ins
[...]
+</text><text class="breeze-prod-image-build-r5" x="0" y="1923.2"
textLength="12.2"
clip-path="url(#breeze-prod-image-build-line-78)">│</text><text
class="breeze-prod-image-build-r4" x="24.4" y="1923.2" textLength="329.4"
clip-path="url(#breeze-prod-image-build-line-78)">--install-mysql-client-type</text><text
class="breeze-prod-image-build-r1" x="597.8" y="1923.2" textLength="475.8"
clip-path="url(#breeze-prod-image-build-line-78)">Which client to choose when ins
[...]
</text><text class="breeze-prod-image-build-r5" x="0" y="1947.6"
textLength="12.2"
clip-path="url(#breeze-prod-image-build-line-79)">│</text><text
class="breeze-prod-image-build-r4" x="24.4" y="1947.6" textLength="207.4"
clip-path="url(#breeze-prod-image-build-line-79)">--cleanup-context</text><text
class="breeze-prod-image-build-r1" x="597.8" y="1947.6" textLength="841.8"
clip-path="url(#breeze-prod-image-build-line-79)">Clean up docker context files before 
[...]
</text><text class="breeze-prod-image-build-r5" x="0" y="1972"
textLength="12.2"
clip-path="url(#breeze-prod-image-build-line-80)">│</text><text
class="breeze-prod-image-build-r1" x="597.8" y="1972" textLength="170.8"
clip-path="url(#breeze-prod-image-build-line-80)">together with </text><text
class="breeze-prod-image-build-r4" x="768.6" y="1972" textLength="439.2"
clip-path="url(#breeze-prod-image-build-line-80)">--install-distributions-from-context</text><text
class="breeze-p [...]
</text><text class="breeze-prod-image-build-r5" x="0" y="1996.4"
textLength="12.2"
clip-path="url(#breeze-prod-image-build-line-81)">│</text><text
class="breeze-prod-image-build-r4" x="24.4" y="1996.4" textLength="524.6"
clip-path="url(#breeze-prod-image-build-line-81)">--use-constraints-for-context-distributions</text><text
class="breeze-prod-image-build-r1" x="597.8" y="1996.4" textLength="841.8"
clip-path="url(#breeze-prod-image-build-line-81)">Uses constraints for cont
[...]
diff --git a/dev/breeze/doc/images/output_prod-image_build.txt
b/dev/breeze/doc/images/output_prod-image_build.txt
index 2fd3840285b..97e34144209 100644
--- a/dev/breeze/doc/images/output_prod-image_build.txt
+++ b/dev/breeze/doc/images/output_prod-image_build.txt
@@ -1 +1 @@
-0a491d82c3fa865682261b5cc0c2be56
+6a4b4f459d411770268a2d1590c4dab6
diff --git a/dev/breeze/src/airflow_breeze/global_constants.py
b/dev/breeze/src/airflow_breeze/global_constants.py
index 1d1f9dadfd6..9dc98cc222c 100644
--- a/dev/breeze/src/airflow_breeze/global_constants.py
+++ b/dev/breeze/src/airflow_breeze/global_constants.py
@@ -202,7 +202,7 @@ ALLOWED_MYSQL_VERSIONS = [*MYSQL_OLD_RELEASES,
*MYSQL_LTS_RELEASES]
if MYSQL_INNOVATION_RELEASE:
ALLOWED_MYSQL_VERSIONS.append(MYSQL_INNOVATION_RELEASE)
-ALLOWED_INSTALL_MYSQL_CLIENT_TYPES = ["mariadb", "mysql"]
+ALLOWED_INSTALL_MYSQL_CLIENT_TYPES = ["mariadb"]
PIP_VERSION = "25.2"
UV_VERSION = "0.9.4"
diff --git a/docker-stack-docs/build.rst b/docker-stack-docs/build.rst
index c0c3260a0e2..cabbdfff6b2 100644
--- a/docker-stack-docs/build.rst
+++ b/docker-stack-docs/build.rst
@@ -792,15 +792,13 @@ Building images with MySQL client
.. warning::
- By default Airflow images as of Airflow 2.8.0 use "MariaDB" client by
default on both "X86_64" and "ARM64"
- platforms. However, you can also build images with MySQL client. The
following example builds the
- production image in default Python version with "MySQL" client.
-
-.. exampleinclude:: docker-examples/customizing/mysql-client.sh
- :language: bash
- :start-after: [START build]
- :end-before: [END build]
-
+ As of Airflow 3.2.0 - our images only support installation of "MariaDB"
client from default Debian
+ repositories. If you need to use "MySQL" client from Oracle, you need to
extend the images and add
+ your own ways of installing the client. The main reason for that is that
Oracle's
+ ``MySQL`` client installation is broken due to expiring GPG keys and every
2 years the old
+ packages stop installing unless you manually update the keys (but there is
a period of time when the
+ packages are not installable at all). MariaDB client is a drop-in
replacement for MySQL client
+ and it works perfectly well with MySQL server.
.. _image-build-custom:
diff --git a/docker-stack-docs/docker-examples/customizing/mysql-client.sh
b/docker-stack-docs/docker-examples/customizing/mysql-client.sh
deleted file mode 100755
index 3585598f363..00000000000
--- a/docker-stack-docs/docker-examples/customizing/mysql-client.sh
+++ /dev/null
@@ -1,37 +0,0 @@
-#!/usr/bin/env bash
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-# This is an example docker build script. It is not intended for PRODUCTION use
-set -euo pipefail
-AIRFLOW_SOURCES="$(cd "$(dirname "${BASH_SOURCE[0]}")/../../../" && pwd)"
-
-TEMP_DOCKER_DIR=$(mktemp -d)
-pushd "${TEMP_DOCKER_DIR}"
-
-cp "${AIRFLOW_SOURCES}/Dockerfile" "${TEMP_DOCKER_DIR}"
-
-# [START build]
-export DOCKER_BUILDKIT=1
-
-docker build . \
- --build-arg INSTALL_MYSQL_CLIENT_TYPE="mysql" \
- --tag "my-mysql-airflow:0.0.1"
-# [END build]
-docker rmi --force "my-mysql-airflow:0.0.1"
-popd
-rm -rf "${TEMP_DOCKER_DIR}"
diff --git a/scripts/docker/install_mysql.sh b/scripts/docker/install_mysql.sh
index 9ed49699c5c..012ef9f14ac 100644
--- a/scripts/docker/install_mysql.sh
+++ b/scripts/docker/install_mysql.sh
@@ -24,14 +24,42 @@ set -euo pipefail
common::get_colors
declare -a packages
-#
https://dev.mysql.com/blog-archive/introducing-mysql-innovation-and-long-term-support-lts-versions/
-readonly MYSQL_LTS_VERSION="8.0"
# https://mariadb.org/about/#maintenance-policy
readonly MARIADB_LTS_VERSION="10.11"
: "${INSTALL_MYSQL_CLIENT:?Should be true or false}"
: "${INSTALL_MYSQL_CLIENT_TYPE:-mariadb}"
+if [[ "${INSTALL_MYSQL_CLIENT}" != "true" && "${INSTALL_MYSQL_CLIENT}" !=
"false" ]]; then
+ echo
+ echo "${COLOR_RED}INSTALL_MYSQL_CLIENT must be either true or
false${COLOR_RESET}"
+ echo
+ exit 1
+fi
+
+if [[ "${INSTALL_MYSQL_CLIENT_TYPE}" != "mysql" &&
"${INSTALL_MYSQL_CLIENT_TYPE}" != "mariadb" ]]; then
+ echo
+ echo "${COLOR_RED}INSTALL_MYSQL_CLIENT_TYPE must be either mysql or
mariadb${COLOR_RESET}"
+ echo
+ exit 1
+fi
+
+if [[ "${INSTALL_MYSQL_CLIENT_TYPE}" == "mysql" ]]; then
+ echo
+ echo "${COLOR_RED}The 'mysql' client type is not supported any more. Use
'mariadb' instead.${COLOR_RESET}"
+ echo
+ echo "The MySQL drivers are wrongly packaged and released by Oracle with
an expiration date on their GPG keys,"
+ echo "which causes builds to fail after the expiration date. MariaDB
client is protocol-compatible with MySQL client."
+ echo ""
+ echo "Every two years the MySQL packages fail and Oracle team is always
surprised and struggling"
+ echo "with fixes and re-signing the packages which lasts few days"
+ echo "See https://bugs.mysql.com/bug.php?id=113432 for more details."
+ echo "As a community we are not able to support this broken packaging
practice from Oracle"
+ echo "Feel free however to install MySQL drivers on your own as extension
of the image."
+ echo
+ exit 1
+fi
+
retry() {
local retries=3
local count=0
@@ -50,44 +78,6 @@ retry() {
done
}
-install_mysql_client() {
- if [[ "${1}" == "dev" ]]; then
- packages=("libmysqlclient-dev" "mysql-client")
- elif [[ "${1}" == "prod" ]]; then
- # `libmysqlclientXX` where XX is number, and it should be increased
every new GA MySQL release, for example
- # 18 - MySQL 5.6.48
- # 20 - MySQL 5.7.42
- # 21 - MySQL 8.0.34
- # 22 - MySQL 8.1
- packages=("libmysqlclient21" "mysql-client")
- else
- echo
- echo "${COLOR_RED}Specify either prod or dev${COLOR_RESET}"
- echo
- exit 1
- fi
-
- common::import_trusted_gpg "B7B3B788A8D3785C" "mysql"
-
- echo
- echo "${COLOR_BLUE}Installing Oracle MySQL client version
${MYSQL_LTS_VERSION}: ${1}${COLOR_RESET}"
- echo
-
- echo "deb http://repo.mysql.com/apt/debian/ $(lsb_release -cs)
mysql-${MYSQL_LTS_VERSION}" > \
- /etc/apt/sources.list.d/mysql.list
- retry apt-get update
- retry apt-get install --no-install-recommends -y "${packages[@]}"
- apt-get autoremove -yqq --purge
- apt-get clean && rm -rf /var/lib/apt/lists/*
-
- # Remove mysql repository from sources.list.d as MySQL repos have a basic
flaw that they put expiry
- # date on their GPG signing keys and they sign their repo with those keys.
This means that after a
- # certain date, the GPG key becomes invalid and if you have the repository
added in your sources.list
- # then you will not be able to install anything from any other repository.
This id unlike any other
- # repository we have seen (for example Postgres, MariaDB, MsSQL - all have
non-expiring signing keys)
- rm /etc/apt/sources.list.d/mysql.list
-}
-
install_mariadb_client() {
# List of compatible package Oracle MySQL -> MariaDB:
# `mysql-client` -> `mariadb-client` or `mariadb-client-compat` (11+)
@@ -126,27 +116,6 @@ install_mariadb_client() {
apt-get clean && rm -rf /var/lib/apt/lists/*
}
-# Install MySQL client only if it is not disabled.
-# INSTALL_MYSQL_CLIENT_TYPE=mysql : Install MySQL client from Oracle
repository.
-# INSTALL_MYSQL_CLIENT_TYPE=mariadb : Install MariaDB client from MariaDB
repository.
-# https://mariadb.com/kb/en/mariadb-clientserver-tcp-protocol/
-# For ARM64 INSTALL_MYSQL_CLIENT_TYPE ignored and always install MariaDB.
if [[ ${INSTALL_MYSQL_CLIENT:="true"} == "true" ]]; then
- if [[ $(uname -m) == "arm64" || $(uname -m) == "aarch64" ]]; then
- INSTALL_MYSQL_CLIENT_TYPE="mariadb"
- echo
- echo "${COLOR_YELLOW}Client forced to mariadb for ARM${COLOR_RESET}"
- echo
- fi
-
- if [[ "${INSTALL_MYSQL_CLIENT_TYPE}" == "mysql" ]]; then
- install_mysql_client "${@}"
- elif [[ "${INSTALL_MYSQL_CLIENT_TYPE}" == "mariadb" ]]; then
- install_mariadb_client "${@}"
- else
- echo
- echo "${COLOR_RED}Specify either mysql or mariadb, got
${INSTALL_MYSQL_CLIENT_TYPE}${COLOR_RESET}"
- echo
- exit 1
- fi
+ install_mariadb_client "${@}"
fi