From f26dd43f66d60f690e3dd073d2525dda8d397fc2 Mon Sep 17 00:00:00 2001 From: Sergey Kamardin Date: Sun, 25 Oct 2026 07:45:03 +0000 Subject: [PATCH 1/2] autobahn: use upstream suite image; read Go version from env --- autobahn/docker/autobahn/Dockerfile | 16 +++------------- autobahn/docker/server/Dockerfile | 6 +++++- autobahn/script/test.sh | 12 ++++++++++-- 3 files changed, 18 insertions(+), 16 deletions(-) diff --git a/autobahn/docker/autobahn/Dockerfile b/autobahn/docker/autobahn/Dockerfile index 0726c39..e2e6a52 100644 --- a/autobahn/docker/autobahn/Dockerfile +++ b/autobahn/docker/autobahn/Dockerfile @@ -1,16 +1,6 @@ -# Based on https://github.com/crossbario/autobahn-testsuite/blob/09cfbf74b0c8e335c6fc7df88e5c88349ca66879/docker/Dockerfile - -FROM pypy:2-slim - -# make "pypy" available as "python" -RUN ln -s /usr/local/bin/pypy /usr/local/bin/python - -# We need this to fix pip & cryptography -RUN apt-get update && apt-get install -y build-essential libssl-dev - -# install Autobahn|Testsuite -RUN pip install -U pip typing && \ - pip install autobahntestsuite=='0.8.2' +# Use the upstream Autobahn|Testsuite image, pinned by version so that CI runs +# are reproducible; bump it deliberately. +FROM crossbario/autobahn-testsuite:25.10.1 VOLUME /config VOLUME /report diff --git a/autobahn/docker/server/Dockerfile b/autobahn/docker/server/Dockerfile index e457c61..01757a5 100644 --- a/autobahn/docker/server/Dockerfile +++ b/autobahn/docker/server/Dockerfile @@ -1,4 +1,8 @@ -FROM golang:1.20.2-alpine3.17 +# GO_VERSION is passed by autobahn/script/test.sh from the host's +# `go env GOVERSION`, so the server under test is built with the same Go as the +# CI matrix entry. The default is only a fallback for manual builds. +ARG GO_VERSION=1.27 +FROM golang:${GO_VERSION}-alpine WORKDIR /go/src/github.com/gobwas/ws diff --git a/autobahn/script/test.sh b/autobahn/script/test.sh index 99fe120..8bc7d4f 100755 --- a/autobahn/script/test.sh +++ b/autobahn/script/test.sh @@ -2,6 +2,14 @@ FOLLOW_LOGS=0 +# Build the server image with the same Go version as the host (e.g. the CI +# matrix entry). GO_VERSION may be set explicitly to override it. +GO_VERSION="${GO_VERSION:-$(go env GOVERSION 2>/dev/null | sed 's/^go//')}" +SERVER_BUILD_ARGS=() +if [[ -n "$GO_VERSION" ]]; then + SERVER_BUILD_ARGS+=(--build-arg "GO_VERSION=$GO_VERSION") +fi + while [[ $# -gt 0 ]]; do key="$1" case $key in @@ -17,12 +25,12 @@ while [[ $# -gt 0 ]]; do shift ;; server) - docker build . --file autobahn/docker/server/Dockerfile --tag ws-server + docker build . --file autobahn/docker/server/Dockerfile --tag ws-server "${SERVER_BUILD_ARGS[@]}" shift ;; *) docker build . --file autobahn/docker/autobahn/Dockerfile --tag ws-autobahn - docker build . --file autobahn/docker/server/Dockerfile --tag ws-server + docker build . --file autobahn/docker/server/Dockerfile --tag ws-server "${SERVER_BUILD_ARGS[@]}" ;; esac ;; From e71dda8f080d974c86c0d200432bc4fd414bec1e Mon Sep 17 00:00:00 2001 From: Sergey Kamardin Date: Mon, 26 Oct 2026 07:09:35 +0000 Subject: [PATCH 2/2] autobahn: tighten docker build commands in script --- autobahn/script/test.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/autobahn/script/test.sh b/autobahn/script/test.sh index 8bc7d4f..a4785a5 100755 --- a/autobahn/script/test.sh +++ b/autobahn/script/test.sh @@ -21,16 +21,16 @@ while [[ $# -gt 0 ]]; do --build) case "$2" in autobahn) - docker build . --file autobahn/docker/autobahn/Dockerfile --tag ws-autobahn + docker build . --file autobahn/docker/autobahn/Dockerfile --tag ws-autobahn || exit 1 shift ;; server) - docker build . --file autobahn/docker/server/Dockerfile --tag ws-server "${SERVER_BUILD_ARGS[@]}" + docker build . --file autobahn/docker/server/Dockerfile --tag ws-server "${SERVER_BUILD_ARGS[@]}" || exit 1 shift ;; *) - docker build . --file autobahn/docker/autobahn/Dockerfile --tag ws-autobahn - docker build . --file autobahn/docker/server/Dockerfile --tag ws-server "${SERVER_BUILD_ARGS[@]}" + docker build . --file autobahn/docker/autobahn/Dockerfile --tag ws-autobahn || exit 1 + docker build . --file autobahn/docker/server/Dockerfile --tag ws-server "${SERVER_BUILD_ARGS[@]}" || exit 1 ;; esac ;;