From 904aa44b9d243dc457cdd8fc2b2d979454acef49 Mon Sep 17 00:00:00 2001 From: Zach Hoffman Date: Thu, 18 Jul 2024 20:44:13 -0600 Subject: [PATCH] Update Trafficserver Alpine image to 9.2.4 (#7994) * No substitution in the name * Download ATS from the Apache archive download.apache.org only contains currently-supported releases. * Use Alpine main repo version 3.16 for adding package libexecinfo-dev Alpine versions above 3.16 do not contain package libexecinfo-dev, which ATS needs. Alpine 3.19 still fails for unknown reasons, but Alpine 3.18 builds with this fix. * Set default for GITHUB_REPOSITORY * Update Apache Traffic Server to 9.2.4 --- .env | 2 +- .../trafficserver-alpine/Dockerfile | 28 ++++++++++++++----- .../trafficserver-alpine/docker-compose.yml | 2 +- .../container-trafficserver-alpine.yml | 2 +- 4 files changed, 24 insertions(+), 10 deletions(-) diff --git a/.env b/.env index 2f8c858f5a..bd33306652 100644 --- a/.env +++ b/.env @@ -1,2 +1,2 @@ -ATS_VERSION=9.1.2 +ATS_VERSION=9.2.4 GO_VERSION=1.22.5 diff --git a/.github/containers/trafficserver-alpine/Dockerfile b/.github/containers/trafficserver-alpine/Dockerfile index 9efce0a9b8..6ce641c268 100644 --- a/.github/containers/trafficserver-alpine/Dockerfile +++ b/.github/containers/trafficserver-alpine/Dockerfile @@ -15,15 +15,15 @@ # specific language governing permissions and limitations # under the License. -FROM alpine:latest AS build-trafficserver +FROM alpine:3.18 AS build-trafficserver ARG ATS_VERSION -ADD https://downloads.apache.org/trafficserver/trafficserver-${ATS_VERSION}.tar.bz2 /tmp/ +ADD https://archive.apache.org/dist/trafficserver/trafficserver-${ATS_VERSION}.tar.bz2 /tmp/ RUN set -o errexit -o nounset -o xtrace; \ cd tmp; \ dirname=trafficserver-${ATS_VERSION}; \ tar xf ${dirname}.tar.bz2; \ rm ${dirname}.tar.bz2; \ - apk add --no-cache \ + apk add --update --no-cache \ # configure dependencies g++ \ perl \ @@ -31,11 +31,20 @@ RUN set -o errexit -o nounset -o xtrace; \ pcre-dev \ make \ # build dependencies - libexecinfo-dev \ fortify-headers \ linux-headers \ zlib-dev; \ + # Alpine versions above 3.16 do not contain package libexecinfo-dev, + # which ATS needs. + # https://github.com/aws/aws-lambda-nodejs-runtime-interface-client/issues/68#issuecomment-1571877109 + apk add --update --no-cache \ + --repository=https://dl-cdn.alpinelinux.org/alpine/v3.16/main/ \ + libexecinfo-dev; \ cd $dirname; \ + # Fix is from https://github.com/apache/trafficserver-ingress-controller/pull/151 + sed -i 's/PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP/PTHREAD_RWLOCK_INITIALIZER/' \ + include/tscore/ink_rwlock.h \ + include/tscpp/util/TsSharedMutex.h; \ ./configure \ --disable-tests \ --enable-experimental-plugins \ @@ -52,13 +61,18 @@ RUN set -o errexit -o nounset -o xtrace; \ cd ..; \ rm -r $dirname -FROM alpine:latest +FROM alpine:3.18 COPY --from=build-trafficserver /tmp/built/ / -RUN apk add --no-cache \ +RUN apk add --update --no-cache \ # runtime dependencies - libexecinfo \ libstdc++ \ pcre && \ + # Alpine versions above 3.16 do not contain package libexecinfo, + # which ATS needs. + # https://github.com/aws/aws-lambda-nodejs-runtime-interface-client/issues/68#issuecomment-1571877109 + apk add --update --no-cache \ + --repository=https://dl-cdn.alpinelinux.org/alpine/v3.16/main/ \ + libexecinfo && \ adduser -D ats USER ats CMD /bin/traffic_server diff --git a/.github/containers/trafficserver-alpine/docker-compose.yml b/.github/containers/trafficserver-alpine/docker-compose.yml index 465a0d08c7..e5b4c2dc64 100644 --- a/.github/containers/trafficserver-alpine/docker-compose.yml +++ b/.github/containers/trafficserver-alpine/docker-compose.yml @@ -41,4 +41,4 @@ services: - linux/amd64 - linux/arm64 # for example, ghcr.io/apache/trafficcontrol/ci/trafficserver-alpine:9.1.2 - image: ${CONTAINER:-ghcr.io/apache/trafficcontrol/ci/trafficserver-alpine}:${ATS_VERSION} + image: ${CONTAINER:-ghcr.io/${GITHUB_REPOSITORY:-apache/trafficcontrol}/ci/trafficserver-alpine}:${ATS_VERSION} diff --git a/.github/workflows/container-trafficserver-alpine.yml b/.github/workflows/container-trafficserver-alpine.yml index 7a1da09030..2ed1669ea6 100644 --- a/.github/workflows/container-trafficserver-alpine.yml +++ b/.github/workflows/container-trafficserver-alpine.yml @@ -15,7 +15,7 @@ # specific language governing permissions and limitations # under the License. -name: Container ghcr.io/apache/trafficcontrol/ci/trafficserver-alpine +name: Container trafficserver-alpine env: CONTAINER: ghcr.io/${{ github.repository }}/ci/trafficserver-alpine