Repository navigation
test/docker: bake mysql+postgres data dirs so cold start is ~2-3s, stop healthcheck wedge #33822
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
Merged
Merged
Changes from 2 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
54d0d6d
test/docker: stop mysql healthcheck wedging at 'starting' on slow init
robobun 98cb5da
test/docker: bake pre-initialized mysql data dirs so cold start is ~3s
robobun 0d3b798
test/websocket-proxy: bump squid ensure() beforeAll to 240s to match …
robobun d25a0a1
test/docker/README: list the new mysql Dockerfiles in the Architectur…
robobun 2e3c961
test/docker: give the mysql bake RUN a 180s readiness poll
robobun 3bfb1e7
[build linux images] bootstrap.sh v38: bake the mysql test images int…
robobun 4b4660c
[build linux images] test/docker: bake pre-initialized PGDATA for pos…
robobun b6e37ee
[publish images] bootstrap.sh v38: bake mysql+postgres test images in…
robobun File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| FROM mysql:8.0 | ||
|
|
||
| # See Dockerfile.mysql-plain for the rationale. This variant pins mysql:8.0 and | ||
| # the mysql_native_password auth plugin to cover the legacy-auth code path. | ||
| ENV MYSQL_ROOT_PASSWORD=bun \ | ||
| MYSQL_DATABASE=bun_sql_test \ | ||
| MYSQL_ROOT_HOST=% \ | ||
| MYSQL_INITDB_SKIP_TZINFO=1 | ||
|
|
||
| RUN set -e; \ | ||
| docker-entrypoint.sh mysqld \ | ||
| --datadir=/var/lib/mysql-init \ | ||
| --default-authentication-plugin=mysql_native_password & pid=$!; \ | ||
| for i in $(seq 60); do \ | ||
| mysql -h127.0.0.1 -uroot -pbun -e 'SELECT 1' >/dev/null 2>&1 && break; \ | ||
| sleep 1; \ | ||
| done; \ | ||
| mysql -h127.0.0.1 -uroot -pbun -e 'SELECT 1'; \ | ||
| mysqladmin -h127.0.0.1 -uroot -pbun shutdown; \ | ||
| wait "$pid" | ||
|
|
||
| CMD ["mysqld", "--datadir=/var/lib/mysql-init", "--default-authentication-plugin=mysql_native_password"] | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| FROM mysql:8.4 | ||
|
robobun marked this conversation as resolved.
Resolved
|
||
|
|
||
| # Bake a fully initialized data directory into the image so cold container | ||
| # start skips `mysqld --initialize` and the temp-server dance entirely and is | ||
| # just `exec mysqld` (~2-3s instead of ~60s). The base image declares | ||
| # `VOLUME /var/lib/mysql`, which discards build-time writes there, so | ||
| # initialize into a sibling path and point mysqld at it via CMD; at runtime the | ||
| # entrypoint sees `$DATADIR/mysql` exists and goes straight to exec. tzinfo | ||
| # loading is skipped since no test uses MySQL's named-timezone tables. | ||
| ENV MYSQL_ALLOW_EMPTY_PASSWORD=yes \ | ||
| MYSQL_DATABASE=bun_sql_test \ | ||
| MYSQL_INITDB_SKIP_TZINFO=1 | ||
|
|
||
| RUN set -e; \ | ||
| docker-entrypoint.sh mysqld --datadir=/var/lib/mysql-init & pid=$!; \ | ||
| for i in $(seq 60); do \ | ||
| mysql -h127.0.0.1 -uroot -e 'SELECT 1' >/dev/null 2>&1 && break; \ | ||
| sleep 1; \ | ||
| done; \ | ||
| mysql -h127.0.0.1 -uroot -e 'SELECT 1'; \ | ||
| mysqladmin -h127.0.0.1 -uroot shutdown; \ | ||
| wait "$pid" | ||
|
coderabbitai[bot] marked this conversation as resolved.
Resolved
|
||
|
|
||
| CMD ["mysqld", "--datadir=/var/lib/mysql-init"] | ||
|
coderabbitai[bot] marked this conversation as resolved.
Resolved
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.