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

MySQL on M1: use architecture-specific image, and health check for readiness detection #25878

Merged
merged 1 commit into from
May 31, 2022

Conversation

holly-cummins
Copy link
Contributor

Partial resolution of #25428. See also discussion in #25648. This PR makes modules with docker-maven-plugin tests which use mysql able to run cleanly when -Dstart-containers is set on M1 with podman. There are other modules with ‘mysql’ in the name, but they use mariadb under the covers, so were dealt with in another commit.

Like with #25830, this will change the default dev services image, but only when quarkus is built on M1. That’s not ideal in either direction - in the unlikely event that we built on M1 and then released to all platforms, the mysql name would be wrong. For normal releases, the dev services image still won’t work out of the box on M1. However, I think that’s ok for the moment, since the alternative is some very complex architecture-detecting system for default dev services images, which kind of defeats the point of what containers are supposed to help with.

To test


TESTCONTAINERS_RYUK_DISABLED="true" ./mvnw -Dquickly -DskipTests=false -Dstart-containers -f integration-tests/jpa-mysql

With -dtest-containers I still see failures, but they’re outside the scope of this PR.

What’s changed

Like for DB2, I got a 404 if I tried to pull the image without explicitly specifying the architecture. However, just specifying the architecture wasn’t enough for the container to start. It would work on the command line with podman, but not in fabric8 with podman.

Following https://www.emmanuelgautier.com/blog/mysql-docker-arm-m1 and https://stackoverflow.com/questions/65456814/docker-apple-silicon-m1-preview-mysql-no-matching-manifest-for-linux-arm64-v8 I instead changed the image name to one with better behaviour on arm. Hopefully this tuning can be removed as M1 support matures.

I also switched to a health check for startup detection.

@quarkus-bot quarkus-bot bot added area/dependencies Pull requests that update a dependency file area/hibernate-orm Hibernate ORM area/persistence OBSOLETE, DO NOT USE labels May 31, 2022
gastaldi
gastaldi previously approved these changes May 31, 2022
Copy link
Contributor

@gastaldi gastaldi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@gastaldi gastaldi dismissed their stale review May 31, 2022 17:22

[ERROR] DOCKER> Unable to pull 'docker.io/mysql:8.0' from registry 'docker.io' : no matching manifest for linux/arm64/v8 in the manifest list entries [no matching manifest for linux/arm64/v8 in the manifest list entries ]

@gastaldi
Copy link
Contributor

@holly-cummins funny that it works if I run the TESTCONTAINERS_RYUK_DISABLED="true" ./mvnw -Dquickly -DskipTests=false -Dstart-containers -f integration-tests/jpa-mysql with -Pmac-m1.

For some reason the profile isn't enabled automatically for me, giving me the error above

@gastaldi
Copy link
Contributor

This is the output of my mvn -v:

Maven home: /Users/ggastald/.m2/wrapper/dists/apache-maven-3.8.4-bin/52ccbt68d252mdldqsfsn03jlf/apache-maven-3.8.4
Java version: 17.0.3, vendor: GraalVM Community, runtime: /Users/ggastald/.sdkman/candidates/java/22.1.0.r17-grl
Default locale: en_BR, platform encoding: UTF-8
OS name: "mac os x", version: "12.4", arch: "x86_64", family: "mac"

I wonder if the arch: "x86_64" is caused because I have Rosetta 2 installed

@gastaldi
Copy link
Contributor

Turns out it works when I reinstalled my GraalVM. Good job!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/dependencies Pull requests that update a dependency file area/hibernate-orm Hibernate ORM area/persistence OBSOLETE, DO NOT USE
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants