Skip to content

Support MySQL on arm64 (Apple Silicon M1) #3002

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

Closed
rfay opened this issue May 14, 2021 · 8 comments
Closed

Support MySQL on arm64 (Apple Silicon M1) #3002

rfay opened this issue May 14, 2021 · 8 comments
Milestone

Comments

@rfay
Copy link
Member

rfay commented May 14, 2021

Unfortunately, Oracle does not provide Debian packages for MySQL (any version).

As noted in the docs and because there are no options for mysql packages or images, DDEV on the Mac M1 (and any other arm64) does not currently have the capability to use MySQL as a db server.

There are a few ways we may be able to solve this:

  1. Of course Oracle could support Debian arm64 and provide packages for it. Then there would be a docker image, or we could build one. The request for this is support arm64 architecture docker-library/mysql#318
  2. There is an OracleLinux docker image of MySQL 8 (only) at https://hub.docker.com/r/mysql/mysql-server - so it would be possible to implement mysql 8 right now with some nontrivial Docker work. This might relieve some of the pressure.
  3. We could build MySQL for arm64 ourselves and incorporate it into an image. This is likely to work but means yet another thing to maintain, and it's not easy. And of course there is risk, because we're not Oracle and don't know the ins and outs of what might need to be enabled in the build. This would be a whole effort to automate the build of MySQL and then build images for it.
  4. We could allow the use of the amd64 MySQL images with ddev on arm64. This can work on the Apple M1 (doesn't help at all on other arm64 architectures). However, because it's emulated, it's both risky (lots of crashes reported) and has performance problems.

The most likely options at this point are 2 and 3 but it will likely require somebody to sponsor the effort or take it on themselves.

Please remember that the vast majority of uses of MySQL work fine with recent MariaDB. This isn't true of every single website, as some things about MariaDB and MySQL have diverged in recent years. But mostly...

@rfay rfay added the Prioritized We expect to do this in an upcoming release label Jul 11, 2021
@rfay rfay added this to the v1.19 milestone Oct 7, 2021
@rfay
Copy link
Member Author

rfay commented Oct 7, 2021

Tag1 Consulting has provisionally agreed to sponsor this one /cc @jeffsheltren @LionsAd - Request an estimate once it has been explored a bit.

@rfay
Copy link
Member Author

rfay commented Oct 8, 2021

One requirement here is that the Major.Minor versions on amd64 and arm64 need to be kept in sync, which probably means pinning both carefully. So 5.7.x and 8.0.x should be the same on arm64 and amd64.

@rfay
Copy link
Member Author

rfay commented Oct 17, 2021

It turns out that Ubuntu 18.04 arm64 has a mysql-server-5.7 package, and Ubuntu 20.04 has mysql-server-8.0. Those are the key two items to support, and we shouldn't really have any trouble with it I don't think. I don't see a particular reason to support mysql versions earlier than 5.7, so just 5.7 and 8.0 should be fine. However... Ubuntu 16.04 does have percona-server-server-5.6, and Ubuntu 14.04 has mysql-server-5.5 and mysql-server-5.6

In addition, Ubuntu 16.04 has Mariadb 10.0 and Ubuntu 18.04 has mariadb-server 10.1, and ubuntu 14.04 even has mariadb-server 5.5

@rfay
Copy link
Member Author

rfay commented Oct 17, 2021

  • build_image.sh conflates DATABASE_TYPE and the actual image FROM. So it uses "mysql" as both the database type and the FROM. Because they are the same in dockerhub normally.
  • build_image.sh will have to derive an upstream FROM as a separate variable and pass that into the dockerfile. Probably with better naming.
  • We'll need to push drud/mysql:5.7 and drud/mysql:8.0 images
  • It might be possible to use the drud-pushed images instead of the official mysql images and then have exactly the same on arm64/amd64. But it would prevent forward movement probably on new releases. Not sure.

@rfay
Copy link
Member Author

rfay commented Oct 17, 2021

Percona does not publish any arm64 packages for xtrabackup 2 or 8.0, but percona-xtrabackup (2) is part of Ubuntu 18.04 (only)

@rfay
Copy link
Member Author

rfay commented Oct 17, 2021

@rfay
Copy link
Member Author

rfay commented Oct 18, 2021

  • mysql5.7 arm64 using Ubuntu 18.04 base
  • mysql8.0 arm64 using Ubuntu 20.04 base
  • Allow usage of mysql 5.7 and 8.0 on m1 and linux
  • Simplify the go:build instructions in the values area
  • Build/systematize drud/mysql:5.7 and drud/mysql:8.0 upstreams
  • make sure the drud/mysql docs are adequate to be able to maintain
  • preinstall xtrabackup in mysql 8.0, so it won't be done later. Use packages for amd64 and built image for arm64
  • Decide whether both arm64 and amd64 should use the drud upstreams
  • Decide whether this change can be introduced in a point release or not.
  • Make sure that the amd64 usages are using the original upstream mysql image.
  • Build and publish arm64 xtrabackup 8.0
  • xtrabackup update and release instructions should be checked carefully
  • mysql 5.7 and 8.0 builds are actually picking up latest, not what's specified in base_version.txt
  • ddev-dbserver needs a test for mysql8 to make sure that the xtrabackup version is >= the mysql-server version
  • percona-xtrabackup-8.0 built for arm64 is huge, not a release build. Need to figure out how to build an appropriately sized build.

@rfay rfay removed the Prioritized We expect to do this in an upcoming release label Oct 20, 2021
@rfay
Copy link
Member Author

rfay commented Oct 26, 2021

This can be released as point release because it only affects arm64 in cases where arm64 didn't have any support.

The problem with huge percona-xtrabackup being huge was resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant