-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Add healthcheck commands for MySQL containers #70987
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
Conversation
Size Change: 0 B Total Size: 1.91 MB ℹ️ View Unchanged
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just writing this review as a reminder to add the conditional for the healtcheck.sh
const healthcheck = { | ||
test: [ | ||
'CMD-SHELL', | ||
'if [ "$LOCAL_DB_TYPE" = "mariadb" ]; then case "$LOCAL_DB_VERSION" in 5.5|10.0|10.1|10.2|10.3) mysqladmin ping -h localhost || exit $?;; *) mariadb-admin ping -h localhost || exit $?;; esac; fi', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not very familiar with Docker, but I think LOCAL_DB_TYPE
and LOCAL_DB_VERSION
are environment variables for core development. I think the image is always mariadb
in wp-env
, so can we simplify the command a bit?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah yes, you're right. Looks like lts
is always used as the version as well. So there's no need to guard against differences in older versions.
volumes: [ 'mysql:/var/lib/mysql' ], | ||
healthcheck, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we can delete the volumes
field because the database is reset every time we restart the environment.
I was mistaken that the version of |
What?
This adds some additional safe guards so that running
wp-env start
does not fail when a database container takes a while to finish starting.depends_on
setting for containers that rely on a database container has been expanded to expect aservice_healthy
status.healthcheck
that waits for a successful response to(mysql|mariadb)-admin ping
command and retries up to 10 times.Why?
The
wp-env start
command has been failing more frequently within GitHub Actions recently.How?
Testing Instructions