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
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions build-parent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1241,6 +1241,12 @@
<properties>
<!-- Podman compatibility. Currently, mac file systems based on Plan 9 does not support SELinux labeling z and Z should not be used. When they transition to use virtiofsd, it should support SELinux labeling, and then we can use it for better container separation on the Mac.-->
<volume.access.modifier></volume.access.modifier>

<!-- See https://stackoverflow.com/questions/65456814/docker-apple-silicon-m1-preview-mysql-no-matching-manifest-for-linux-arm64-v8
and https://www.emmanuelgautier.com/blog/mysql-docker-arm-m1
This hopefully should be temporary -->
<mysql.image>arm64v8/mysql:8-oracle</mysql.image>
gastaldi marked this conversation as resolved.
Show resolved Hide resolved

</properties>
</profile>

Expand Down
2 changes: 1 addition & 1 deletion extensions/reactive-oracle-client/deployment/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@
<!-- good docs found at: http://dmp.fabric8.io/#build-healthcheck -->
<!-- Unfortunately booting this is slow, needs to set a generous timeout: -->
<time>60000</time>
<!-- leversge the healthcheck in the image we use -->
<!-- leverage the healthcheck in the image we use -->
<healthy>yes</healthy>
</wait>
</run>
Expand Down
26 changes: 20 additions & 6 deletions integration-tests/jpa-mysql/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,24 @@
<configuration>
<images>
<image>
<name>${mysql.image}</name>
<name>healthcheck-${mysql.image}</name>
<alias>quarkus-test-mysql</alias>
<build>
<from>${mysql.image}</from>
<healthCheck>
<!-- The exact values for these aren't very important, but it is important they are there -->
<interval>5s</interval>
<timeout>3s</timeout>
<startPeriod>5s</startPeriod>
<retries>5</retries>
<!-- We could also use /usr/local/bin/healthcheck.sh but it seemed complicated to get the right level.
Note that mysqladmin ping returns 0 even if the password is wrong so we don't need to pass in a password, but it makes the logs cleaner-->
<cmd>
<shell>mysqladmin ping -h localhost -u hibernate_orm_test -phibernate_orm_test || exit 1
</shell>
</cmd>
</healthCheck>
</build>
<run>
<ports>
<port>3306:3306</port>
Expand All @@ -182,13 +198,10 @@
</log>
<!-- Speed things up a bit by not actually flushing writes to disk -->
<tmpfs>/var/lib/mysql</tmpfs>
<!-- good docs found at: http://dmp.fabric8.io/#start-wait -->
<wait>
<!-- good docs found at: http://dmp.fabric8.io/#start-wait -->
<time>20000</time>
<!-- wait until MySQL is actually up by checking if mysqladmin can ping the server with specified username/password -->
<exec>
<postStart>mysqladmin ping -h localhost -u hibernate_orm_test -phibernate_orm_test</postStart>
</exec>
<healthy>true</healthy>
</wait>
</run>
</image>
Expand All @@ -203,6 +216,7 @@
<phase>compile</phase>
<goals>
<goal>stop</goal>
<goal>build</goal>
<goal>start</goal>
</goals>
</execution>
Expand Down