From da68f9991a7bb1911c4512d1fb01a503ba69ba1a Mon Sep 17 00:00:00 2001 From: Privacy Sandbox Team Date: Fri, 27 Oct 2023 16:49:25 -0400 Subject: [PATCH] Release 0.49.0 (2023-10-27) ### Features * Add wrk2 to test-tools image * Extend normalize-bazel-symlink to normalize within containers ### Dependencies * **deps:** Update versions in test-tools image Bug: N/A Change-Id: I3877da945b4a2f0d80aa62a8fe5c5256eb917a1a GitOrigin-RevId: 66b9b605b6ce551869092782eafd646830bb8c41 --- CHANGELOG.md | 13 +++++++++++++ images/test-tools/Dockerfile | 26 +++++++++++++++----------- tests/data/hashes/test-tools | 2 +- tools/normalize-bazel-symlinks | 26 +++++++++++++++++++------- version.txt | 2 +- 5 files changed, 49 insertions(+), 20 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ecf0d25..9eef0c4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,19 @@ All notable changes to this project will be documented in this file. See [commit-and-tag-version](https://github.com/absolute-version/commit-and-tag-version) for commit guidelines. +## 0.49.0 (2023-10-27) + + +### Features + +* Add wrk2 to test-tools image +* Extend normalize-bazel-symlink to normalize within containers + + +### Dependencies + +* **deps:** Update versions in test-tools image + ## 0.48.0 (2023-10-11) diff --git a/images/test-tools/Dockerfile b/images/test-tools/Dockerfile index 21bb383..6b35913 100644 --- a/images/test-tools/Dockerfile +++ b/images/test-tools/Dockerfile @@ -12,31 +12,35 @@ # See the License for the specific language governing permissions and # limitations under the License. -FROM alpine:3.16 as builder +FROM alpine:3.18 as slowhttptest_builder # hadolint ignore=DL3018 -RUN apk add --no-cache build-base git openssl-dev autoconf automake +RUN apk add --no-cache autoconf automake build-base git openssl-dev WORKDIR /build -ADD https://github.com/shekyan/slowhttptest/archive/refs/tags/v1.9.0.tar.gz /build -RUN tar xz --strip-components 1 -f v1.9.0.tar.gz && ls -l && ./configure && make +ADD https://github.com/shekyan/slowhttptest/archive/refs/tags/v1.9.0.tar.gz /build/src.tar.gz +RUN tar xz --strip-components 1 -f src.tar.gz && ./configure && make -FROM golang:1.19.4-alpine3.17 AS golang +FROM alpine:3.18 as wrk_builder +# hadolint ignore=DL3018 +RUN apk add --no-cache autoconf automake build-base git openssl-dev zlib-dev +WORKDIR /build +ADD https://github.com/giltene/wrk2/archive/44a94c17d8e6a0bac8559b53da76848e430cb7a7.tar.gz /build/wrk.tar.gz +RUN tar xz --strip-components 1 -f wrk.tar.gz && make -j6 + +FROM golang:1.21-alpine3.18 AS golang ENV BUILD_ARCH="${TARGETARCH}" \ GOBIN=/usr/local/go/bin COPY build_golang_apps /scripts/ RUN /scripts/build_golang_apps -FROM fullstorydev/grpcurl:v1.8.7 AS grpcurl -FROM alpine:3.17.2 +FROM fullstorydev/grpcurl:v1.8.9-alpine AS grpcurl +FROM alpine:3.18 COPY --from=golang /usr/local/go/bin/* /usr/local/bin/ COPY --from=grpcurl /bin/grpcurl /usr/local/bin/ - ARG TARGETARCH ENV BUILD_ARCH="${TARGETARCH}" \ PATH="${PATH}:/usr/local/go/bin" \ GOBIN=/usr/local/go/bin - COPY install_apps /scripts/ - RUN /scripts/install_apps -COPY --from=builder /build/src/slowhttptest /usr/bin/ +COPY --from=slowhttptest_builder /build/src/slowhttptest /usr/bin/ diff --git a/tests/data/hashes/test-tools b/tests/data/hashes/test-tools index 72a3fa3..63482aa 100644 --- a/tests/data/hashes/test-tools +++ b/tests/data/hashes/test-tools @@ -1 +1 @@ -e19aaa4e08668be8056a6064e27be159ee7e158b3a90d75b7c4e5483369ebe41 +48ec49fead076d09cfeaad6de7466d33300972e8f9a678c99d16321ac5ae74a4 diff --git a/tools/normalize-bazel-symlinks b/tools/normalize-bazel-symlinks index a66f5f3..af609d4 100755 --- a/tools/normalize-bazel-symlinks +++ b/tools/normalize-bazel-symlinks @@ -12,11 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -if [[ -f /.dockerenv ]]; then - printf "Running inside Docker container? This script is only designed to be executed outside docker\n" &>/dev/stderr - exit 1 -fi - declare -r BAZEL_CACHE_DIR="${HOME}/.cache/bazel" function normalize_symlink() { @@ -26,11 +21,28 @@ function normalize_symlink() { return fi local -r link_path="$(readlink "${link_name}")" - local -r output_user_root="${link_path///bazel_root\/}" + local -r output_user_root="${link_path///bazel_root/}" rm -f "${link_name}" ln -s "${BAZEL_CACHE_DIR}/${output_user_root}" "${link_name}" } +function normalize_symlink_docker() { + declare -r link_name="$1" + if readlink --canonicalize-existing "${link_name}" &>/dev/null ; then + printf "symlink %s resolves fully, skipping\n" "${link_name}" + return + fi + local -r link_path="$(readlink "${link_name}")" + local -r output_user_root="${link_path##*/.cache/bazel/}" + rm -f "${link_name}" + ln -s "/bazel_root/${output_user_root}" "${link_name}" +} + +declare _normalize_fn=normalize_symlink +if [[ -f /.dockerenv ]]; then + _normalize_fn=normalize_symlink_docker +fi + declare -a -r LINK_DIRS=( bazel-bin bazel-out @@ -38,5 +50,5 @@ declare -a -r LINK_DIRS=( bazel-workspace ) for link in "${LINK_DIRS[@]}"; do - normalize_symlink "${link}" + ${_normalize_fn} "${link}" done diff --git a/version.txt b/version.txt index fdae41d..fbaaafa 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -0.48.0 \ No newline at end of file +0.49.0 \ No newline at end of file