From 49e77aa7c4f626a2088154ed5a27530f1a58c079 Mon Sep 17 00:00:00 2001 From: Peter Adams Date: Wed, 30 Oct 2024 13:33:25 +0000 Subject: [PATCH] Remove unused dockerfiles and allocation scripts Motivation: Remove unused clutter from the repo. Modifications: Remove dockerfiles and scripts to getting allocation results Result: Cleaner repo. --- dev/alloc-limits-from-test-output.sh | 88 ------------------- dev/git.commit.template | 14 --- ...alloc-limits-to-last-completed-ci-build.sh | 47 ---------- docker/Dockerfile | 33 ------- docker/docker-compose.2204.510.yaml | 55 ------------ docker/docker-compose.2204.59.yaml | 55 ------------ docker/docker-compose.2204.main.yaml | 54 ------------ docker/docker-compose.yaml | 57 ------------ 8 files changed, 403 deletions(-) delete mode 100755 dev/alloc-limits-from-test-output.sh delete mode 100644 dev/git.commit.template delete mode 100755 dev/update-alloc-limits-to-last-completed-ci-build.sh delete mode 100644 docker/Dockerfile delete mode 100644 docker/docker-compose.2204.510.yaml delete mode 100644 docker/docker-compose.2204.59.yaml delete mode 100644 docker/docker-compose.2204.main.yaml delete mode 100644 docker/docker-compose.yaml diff --git a/dev/alloc-limits-from-test-output.sh b/dev/alloc-limits-from-test-output.sh deleted file mode 100755 index 1be49249..00000000 --- a/dev/alloc-limits-from-test-output.sh +++ /dev/null @@ -1,88 +0,0 @@ -#!/bin/bash -##===----------------------------------------------------------------------===## -## -## This source file is part of the SwiftNIO open source project -## -## Copyright (c) 2021 Apple Inc. and the SwiftNIO project authors -## Licensed under Apache License v2.0 -## -## See LICENSE.txt for license information -## See CONTRIBUTORS.txt for the list of SwiftNIO project authors -## -## SPDX-License-Identifier: Apache-2.0 -## -##===----------------------------------------------------------------------===## - -# This script allows you to consume any Jenkins/alloc counter run output and -# convert it into the right for for the docker-compose script. - -set -eu - -mode_flag=${1---docker-compose} - -function usage() { - echo >&1 "Usage: $0 [--docker-compose|--export]" - echo >&1 - echo >&1 "Example:" - echo >&1 " # copy the output from the Jenkins CI into your clipboard, then" - echo >&1 " pbpaste | $0 --docker-compose" -} - -function die() { - echo >&2 "ERROR: $*" - exit 1 -} - -case "$mode_flag" in - --docker-compose) - mode=docker - ;; - --export) - mode=export - ;; - *) - usage - exit 1 - ;; -esac - -function allow_slack() { - raw="$1" - if [[ ! "$raw" =~ ^[0-9]+$ ]]; then - die "not a malloc count: '$raw'" - fi - if [[ "$raw" -lt 1000 ]]; then - echo "$raw" - return - fi - - allocs=$raw - while true; do - allocs=$(( allocs + 1 )) - if [[ "$allocs" =~ [0-9]+00$ || "$allocs" =~ [0-9]+50$ ]]; then - echo "$allocs" - return - fi - done -} - -grep -e "total number of mallocs" -e ".total_allocations" -e "export MAX_ALLOCS_ALLOWED_" | \ - sed -e "s/: total number of mallocs: /=/g" \ - -e "s/.total_allocations: /=/g" \ - -e "s/info: /test_/g" \ - -e "s/export MAX_ALLOCS_ALLOWED_/test_/g" | \ - grep -Eo 'test_[a-zA-Z0-9_-]+=[0-9]+' | sort | uniq | while read info; do - test_name=$(echo "$info" | sed "s/test_//g" | cut -d= -f1 ) - allocs=$(allow_slack "$(echo "$info" | cut -d= -f2 | sed "s/ //g")") - case "$mode" in - docker) - echo " - MAX_ALLOCS_ALLOWED_$test_name=$allocs" - ;; - export) - echo "export MAX_ALLOCS_ALLOWED_$test_name=$allocs" - ;; - *) - die "Unexpected mode: $mode" - ;; - esac -done diff --git a/dev/git.commit.template b/dev/git.commit.template deleted file mode 100644 index c52bfa1a..00000000 --- a/dev/git.commit.template +++ /dev/null @@ -1,14 +0,0 @@ -One line description of your change - -Motivation: - -Explain here the context, and why you're making that change. -What is the problem you're trying to solve. - -Modifications: - -Describe the modifications you've done. - -Result: - -After your change, what will change. diff --git a/dev/update-alloc-limits-to-last-completed-ci-build.sh b/dev/update-alloc-limits-to-last-completed-ci-build.sh deleted file mode 100755 index 68f61a8c..00000000 --- a/dev/update-alloc-limits-to-last-completed-ci-build.sh +++ /dev/null @@ -1,47 +0,0 @@ -#!/bin/bash -##===----------------------------------------------------------------------===## -## -## This source file is part of the SwiftNIO open source project -## -## Copyright (c) 2021 Apple Inc. and the SwiftNIO project authors -## Licensed under Apache License v2.0 -## -## See LICENSE.txt for license information -## See CONTRIBUTORS.txt for the list of SwiftNIO project authors -## -## SPDX-License-Identifier: Apache-2.0 -## -##===----------------------------------------------------------------------===## - -set -eu -set -o pipefail - -here="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" - -url_prefix=${1-"https://ci.swiftserver.group/job/swift-nio-http2-2-"} -target_repo=${2-"$here/.."} -tmpdir=$(mktemp -d /tmp/.last-build_XXXXXX) - -for f in swift57 swift58 swift59 swift510 nightly; do - echo "$f" - url="$url_prefix$f-prb/lastCompletedBuild/consoleFull" - stripped=${f#"swift"} - echo "$url" - curl -s "$url" | "$here/alloc-limits-from-test-output" > "$tmpdir/limits$stripped" - - if [[ "$(wc -l < "$tmpdir/limits$stripped")" -lt 5 ]]; then - echo >&2 "ERROR: fewer than 5 limits found, something's not right" - exit 1 - fi - - - docker_file=$(if [[ "$stripped" == "nightly" ]]; then stripped=main; fi && ls "$target_repo/docker/docker-compose."*"$stripped"*".yaml") - - echo "$docker_file" - cat "$tmpdir/limits$stripped" - cat "$docker_file" | grep -v MAX_ALLOCS_ALLOWED | grep -B10000 "^ environment:" > "$tmpdir/pre$stripped" - cat "$docker_file" | grep -v MAX_ALLOCS_ALLOWED | grep -A10000 "^ environment:" | sed 1d > "$tmpdir/post$stripped" - cat "$tmpdir/pre$stripped" "$tmpdir/limits$stripped" "$tmpdir/post$stripped" > "$docker_file" -done - -rm -rf "$tmpdir" diff --git a/docker/Dockerfile b/docker/Dockerfile deleted file mode 100644 index f7b8c09d..00000000 --- a/docker/Dockerfile +++ /dev/null @@ -1,33 +0,0 @@ -ARG swift_version=5.7 -ARG ubuntu_version=focal -ARG base_image=swift:$swift_version-$ubuntu_version -FROM $base_image -# needed to do again after FROM due to docker limitation -ARG swift_version -ARG ubuntu_version - -# set as UTF-8 -RUN apt-get update && apt-get install -y locales locales-all -ENV LC_ALL en_US.UTF-8 -ENV LANG en_US.UTF-8 -ENV LANGUAGE en_US.UTF-8 - -# dependencies -RUN apt-get update && apt-get install -y wget -RUN apt-get update && apt-get install -y lsof dnsutils netcat-openbsd net-tools curl jq # used by integration tests - -# ruby for soundness -RUN apt-get update && apt-get install -y ruby ruby-dev libsqlite3-dev build-essential - -# tools -RUN mkdir -p $HOME/.tools -RUN echo 'export PATH="$HOME/.tools:$PATH"' >> $HOME/.profile - -# script to allow mapping framepointers on linux (until part of the toolchain) -RUN wget -q https://raw.githubusercontent.com/apple/swift/main/utils/symbolicate-linux-fatal -O $HOME/.tools/symbolicate-linux-fatal -RUN chmod 755 $HOME/.tools/symbolicate-linux-fatal - -# h2spec -ARG h2spec_version -RUN [ -z $h2spec_version ] || wget -q https://github.com/summerwind/h2spec/releases/download/v$h2spec_version/h2spec_linux_amd64.tar.gz -O $HOME/.tools/h2spec.tar.gz -RUN [ -z $h2spec_version ] || tar xzf $HOME/.tools/h2spec.tar.gz --directory $HOME/.tools diff --git a/docker/docker-compose.2204.510.yaml b/docker/docker-compose.2204.510.yaml deleted file mode 100644 index 6045dddd..00000000 --- a/docker/docker-compose.2204.510.yaml +++ /dev/null @@ -1,55 +0,0 @@ -version: "3" - -services: - - runtime-setup: - image: swift-nio-http2:22.04-5.10 - build: - args: - ubuntu_version: "jammy" - swift_version: "5.10" - h2spec_version: "2.2.1" - - unit-tests: - image: swift-nio-http2:22.04-5.10 - - integration-tests: - image: swift-nio-http2:22.04-5.10 - - performance-test: - image: swift-nio-http2:22.04-5.10 - - h2spec: - image: swift-nio-http2:22.04-5.10 - - documentation-check: - image: swift-nio-http2:22.04-5.10 - - test: - image: swift-nio-http2:22.04-5.10 - environment: - - MAX_ALLOCS_ALLOWED_1k_requests_inline_interleaved=30150 - - MAX_ALLOCS_ALLOWED_1k_requests_inline_noninterleaved=29100 - - MAX_ALLOCS_ALLOWED_1k_requests_interleaved=36150 - - MAX_ALLOCS_ALLOWED_1k_requests_noninterleaved=35100 - - MAX_ALLOCS_ALLOWED_client_server_h1_request_response=276050 - - MAX_ALLOCS_ALLOWED_client_server_h1_request_response_inline=261050 - - MAX_ALLOCS_ALLOWED_client_server_request_response=245050 - - MAX_ALLOCS_ALLOWED_client_server_request_response_inline=236050 - - MAX_ALLOCS_ALLOWED_client_server_request_response_many=1190050 - - MAX_ALLOCS_ALLOWED_client_server_request_response_many_inline=881050 - - MAX_ALLOCS_ALLOWED_create_client_stream_channel=35050 - - MAX_ALLOCS_ALLOWED_create_client_stream_channel_inline=35050 - - MAX_ALLOCS_ALLOWED_create_client_stream_channel_inline_no_promise_based_API=35050 - - MAX_ALLOCS_ALLOWED_create_client_stream_channel_no_promise_based_API=35050 - - MAX_ALLOCS_ALLOWED_get_100000_headers_canonical_form=200050 - - MAX_ALLOCS_ALLOWED_get_100000_headers_canonical_form_trimming_whitespace=200050 - - MAX_ALLOCS_ALLOWED_get_100000_headers_canonical_form_trimming_whitespace_from_long_string=300050 - - MAX_ALLOCS_ALLOWED_get_100000_headers_canonical_form_trimming_whitespace_from_short_string=200050 - - MAX_ALLOCS_ALLOWED_hpack_decoding=5050 - - MAX_ALLOCS_ALLOWED_stream_teardown_100_concurrent=262550 - - MAX_ALLOCS_ALLOWED_stream_teardown_100_concurrent_inline=261650 - - IMPORT_CHECK_ARG=--explicit-target-dependency-import-check error - - shell: - image: swift-nio-http2:22.04-5.10 diff --git a/docker/docker-compose.2204.59.yaml b/docker/docker-compose.2204.59.yaml deleted file mode 100644 index d9661cc6..00000000 --- a/docker/docker-compose.2204.59.yaml +++ /dev/null @@ -1,55 +0,0 @@ -version: "3" - -services: - - runtime-setup: - image: swift-nio-http2:22.04-5.9 - build: - args: - ubuntu_version: "jammy" - swift_version: "5.9" - h2spec_version: "2.2.1" - - unit-tests: - image: swift-nio-http2:22.04-5.9 - - integration-tests: - image: swift-nio-http2:22.04-5.9 - - performance-test: - image: swift-nio-http2:22.04-5.9 - - h2spec: - image: swift-nio-http2:22.04-5.9 - - documentation-check: - image: swift-nio-http2:22.04-5.9 - - test: - image: swift-nio-http2:22.04-5.9 - environment: - - MAX_ALLOCS_ALLOWED_1k_requests_inline_interleaved=30150 - - MAX_ALLOCS_ALLOWED_1k_requests_inline_noninterleaved=29100 - - MAX_ALLOCS_ALLOWED_1k_requests_interleaved=36150 - - MAX_ALLOCS_ALLOWED_1k_requests_noninterleaved=35100 - - MAX_ALLOCS_ALLOWED_client_server_h1_request_response=276050 - - MAX_ALLOCS_ALLOWED_client_server_h1_request_response_inline=261050 - - MAX_ALLOCS_ALLOWED_client_server_request_response=245050 - - MAX_ALLOCS_ALLOWED_client_server_request_response_inline=236050 - - MAX_ALLOCS_ALLOWED_client_server_request_response_many=1190050 - - MAX_ALLOCS_ALLOWED_client_server_request_response_many_inline=881050 - - MAX_ALLOCS_ALLOWED_create_client_stream_channel=35050 - - MAX_ALLOCS_ALLOWED_create_client_stream_channel_inline=35050 - - MAX_ALLOCS_ALLOWED_create_client_stream_channel_inline_no_promise_based_API=35050 - - MAX_ALLOCS_ALLOWED_create_client_stream_channel_no_promise_based_API=35050 - - MAX_ALLOCS_ALLOWED_get_100000_headers_canonical_form=200050 - - MAX_ALLOCS_ALLOWED_get_100000_headers_canonical_form_trimming_whitespace=200050 - - MAX_ALLOCS_ALLOWED_get_100000_headers_canonical_form_trimming_whitespace_from_long_string=300050 - - MAX_ALLOCS_ALLOWED_get_100000_headers_canonical_form_trimming_whitespace_from_short_string=200050 - - MAX_ALLOCS_ALLOWED_hpack_decoding=5050 - - MAX_ALLOCS_ALLOWED_stream_teardown_100_concurrent=262550 - - MAX_ALLOCS_ALLOWED_stream_teardown_100_concurrent_inline=261650 - - IMPORT_CHECK_ARG=--explicit-target-dependency-import-check error - - shell: - image: swift-nio-http2:22.04-5.9 diff --git a/docker/docker-compose.2204.main.yaml b/docker/docker-compose.2204.main.yaml deleted file mode 100644 index 0c4eb23b..00000000 --- a/docker/docker-compose.2204.main.yaml +++ /dev/null @@ -1,54 +0,0 @@ -version: "3" - -services: - - runtime-setup: - image: swift-nio-http2:22.04-main - build: - args: - base_image: "swiftlang/swift:nightly-main-jammy" - h2spec_version: "2.2.1" - - unit-tests: - image: swift-nio-http2:22.04-main - - integration-tests: - image: swift-nio-http2:22.04-main - - performance-test: - image: swift-nio-http2:22.04-main - - h2spec: - image: swift-nio-http2:22.04-main - - documentation-check: - image: swift-nio-http2:22.04-main - - test: - image: swift-nio-http2:22.04-main - environment: - - MAX_ALLOCS_ALLOWED_1k_requests_inline_interleaved=30150 - - MAX_ALLOCS_ALLOWED_1k_requests_inline_noninterleaved=29100 - - MAX_ALLOCS_ALLOWED_1k_requests_interleaved=36150 - - MAX_ALLOCS_ALLOWED_1k_requests_noninterleaved=35100 - - MAX_ALLOCS_ALLOWED_client_server_h1_request_response=278050 - - MAX_ALLOCS_ALLOWED_client_server_h1_request_response_inline=263050 - - MAX_ALLOCS_ALLOWED_client_server_request_response=247050 - - MAX_ALLOCS_ALLOWED_client_server_request_response_inline=238050 - - MAX_ALLOCS_ALLOWED_client_server_request_response_many=1192050 - - MAX_ALLOCS_ALLOWED_client_server_request_response_many_inline=883050 - - MAX_ALLOCS_ALLOWED_create_client_stream_channel=36050 - - MAX_ALLOCS_ALLOWED_create_client_stream_channel_inline=36050 - - MAX_ALLOCS_ALLOWED_create_client_stream_channel_inline_no_promise_based_API=36050 - - MAX_ALLOCS_ALLOWED_create_client_stream_channel_no_promise_based_API=36050 - - MAX_ALLOCS_ALLOWED_get_100000_headers_canonical_form=200050 - - MAX_ALLOCS_ALLOWED_get_100000_headers_canonical_form_trimming_whitespace=200050 - - MAX_ALLOCS_ALLOWED_get_100000_headers_canonical_form_trimming_whitespace_from_long_string=300050 - - MAX_ALLOCS_ALLOWED_get_100000_headers_canonical_form_trimming_whitespace_from_short_string=200050 - - MAX_ALLOCS_ALLOWED_hpack_decoding=5050 - - MAX_ALLOCS_ALLOWED_stream_teardown_100_concurrent=262650 - - MAX_ALLOCS_ALLOWED_stream_teardown_100_concurrent_inline=261750 - - IMPORT_CHECK_ARG=--explicit-target-dependency-import-check error - - shell: - image: swift-nio-http2:22.04-main diff --git a/docker/docker-compose.yaml b/docker/docker-compose.yaml deleted file mode 100644 index 7b80a630..00000000 --- a/docker/docker-compose.yaml +++ /dev/null @@ -1,57 +0,0 @@ -# this file is not designed to be run directly -# instead, use the docker-compose.. files -# eg docker-compose -f docker/docker-compose.yaml -f docker/docker-compose.1804.42.yaml run test -version: "3" - -services: - - runtime-setup: - image: swift-nio-http2:default - build: - context: . - dockerfile: Dockerfile - - common: &common - image: swift-nio-http2:default - depends_on: [runtime-setup] - volumes: - - ~/.ssh:/root/.ssh - - ..:/code:z - working_dir: /code - cap_drop: - - CAP_NET_RAW - - CAP_NET_BIND_SERVICE - - soundness: - <<: *common - command: /bin/bash -xcl "./scripts/soundness.sh" - - unit-tests: - <<: *common - command: /bin/bash -xcl "swift test -Xswiftc -warnings-as-errors --enable-test-discovery" - - integration-tests: - <<: *common - command: /bin/bash -xcl "./scripts/integration_tests.sh" - - performance-test: - <<: *common - command: /bin/bash -xcl "swift build -c release && ./.build/release/NIOHTTP2PerformanceTester" - - documentation-check: - <<: *common - command: /bin/bash -xcl "./scripts/check-docs.sh" - - h2spec: - <<: *common - command: /bin/bash -xcl "./scripts/test_h2spec.sh" - - test: - <<: *common - command: /bin/bash -xcl "swift test -Xswiftc -warnings-as-errors --enable-test-discovery $${SANITIZER_ARG-} $${IMPORT_CHECK_ARG-} && ./scripts/integration_tests.sh && ./scripts/test_h2spec.sh $${SANITIZER_ARG-}" - - # util - - shell: - <<: *common - entrypoint: /bin/bash