Skip to content

Commit efd868f

Browse files
committed
[build] build.sh: optional host container-socket mount for container-backed suites
The container envs run kyo's tests inside a Linux container so io_uring is available, but the kyo-sql and kyo-pod conformance suites start Postgres and MySQL through the container runtime's socket, which the container does not carry. On a host with no Linux io_uring (macOS) that left no way to run those suites on io_uring locally: the DB tests reported no reachable runtime. When KYO_POD_SOCKET names the host podman socket, mount it and share the host network so kyo-pod inside the container starts sibling DB containers and reaches their published ports on localhost. Off by default, so a normal run is unchanged. CI does not need it, since its JVM job runs on the host rather than nested.
1 parent e940d5c commit efd868f

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

scripts/build.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,13 @@ run_in_container() {
257257
# Forward the leak-debug flag so the forked test JVM (which inherits the container env) runs leaves serially and attributes each leaked
258258
# descriptor to the test that opened it (see kyo.test.runner.internal.LeakDebug). Unset by default, so a normal run is unaffected.
259259
[ -n "${KYO_TEST_LEAK_DEBUG:-}" ] && envs+=(-e "KYO_TEST_LEAK_DEBUG=$KYO_TEST_LEAK_DEBUG")
260+
# Docker-out-of-docker for the container-backed suites (kyo-sql / kyo-pod): when KYO_POD_SOCKET names the host podman socket, mount it and
261+
# share the host network so kyo-pod inside the container can start sibling DB containers and reach their published ports on localhost. Opt-in,
262+
# so a normal run is unaffected.
263+
if [ -n "${KYO_POD_SOCKET:-}" ]; then
264+
args+=(--network host -v "${KYO_POD_SOCKET}:${KYO_POD_SOCKET}")
265+
envs+=(-e "CONTAINER_HOST=unix://${KYO_POD_SOCKET}")
266+
fi
260267
# Forward the BoringSSL-staging flag; when set the container builds the vendored BoringSSL before the command so kyo-net's TLS tests run
261268
# against real libssl/libcrypto instead of cancelling.
262269
[ -n "${STAGE_BORINGSSL:-}" ] && envs+=(-e "STAGE_BORINGSSL=$STAGE_BORINGSSL")

0 commit comments

Comments
 (0)