From d5bcee218f4be1e2eea1f4947cb0d795acf29f06 Mon Sep 17 00:00:00 2001 From: Andrew Hopkins Date: Tue, 30 Jan 2024 15:37:17 -0800 Subject: [PATCH 1/2] Speed up CodeBuild CI: 1. Split OpenSSH into two jobs, one for main branch, and another for 8.9 2. Use RelWithDebInfo build for MySQL 3. Force MySQL to use double the number of jobs to run the tests 4. Update ARM fuzzer to run for a shorter period of time --- .../github_ci_integration_omnibus.yaml | 28 +++++++++++++++++-- tests/ci/integration/run_mysql_integration.sh | 6 ++-- .../ci/integration/run_openssh_integration.sh | 24 ++++++++-------- tests/ci/run_fuzz_tests.sh | 4 +-- 4 files changed, 43 insertions(+), 19 deletions(-) diff --git a/tests/ci/cdk/cdk/codebuild/github_ci_integration_omnibus.yaml b/tests/ci/cdk/cdk/codebuild/github_ci_integration_omnibus.yaml index 86d64dcbe29..a8dcdddd115 100644 --- a/tests/ci/cdk/cdk/codebuild/github_ci_integration_omnibus.yaml +++ b/tests/ci/cdk/cdk/codebuild/github_ci_integration_omnibus.yaml @@ -36,7 +36,7 @@ batch: variables: AWS_LC_CI_TARGET: "tests/ci/integration/run_crt_integration.sh" - - identifier: openssh_integration_x86_64 + - identifier: openssh_integration_master_x86_64 buildspec: tests/ci/codebuild/common/run_simple_target.yml env: type: LINUX_CONTAINER @@ -45,8 +45,31 @@ batch: image: 620771051181.dkr.ecr.us-west-2.amazonaws.com/aws-lc-docker-images-linux-x86:amazonlinux-2023_clang-15x_sanitizer_latest variables: AWS_LC_CI_TARGET: "tests/ci/integration/run_openssh_integration.sh" + OPENSSH_BRANCH: "master" - - identifier: openssh_integration_aarch + - identifier: openssh_integration_8_9_x86_64 + buildspec: tests/ci/codebuild/common/run_simple_target.yml + env: + type: LINUX_CONTAINER + privileged-mode: false + compute-type: BUILD_GENERAL1_SMALL + image: 620771051181.dkr.ecr.us-west-2.amazonaws.com/aws-lc-docker-images-linux-x86:amazonlinux-2023_clang-15x_sanitizer_latest + variables: + AWS_LC_CI_TARGET: "tests/ci/integration/run_openssh_integration.sh" + OPENSSH_BRANCH: "V_8_9" + + - identifier: openssh_integration_master_aarch + buildspec: tests/ci/codebuild/common/run_simple_target.yml + env: + type: ARM_CONTAINER + privileged-mode: false + compute-type: BUILD_GENERAL1_LARGE + image: 620771051181.dkr.ecr.us-west-2.amazonaws.com/aws-lc-docker-images-linux-aarch:amazonlinux-2023_clang-15x_sanitizer_latest + variables: + AWS_LC_CI_TARGET: "tests/ci/integration/run_openssh_integration.sh" + OPENSSH_BRANCH: "master" + + - identifier: openssh_integration_8_9_aarch buildspec: tests/ci/codebuild/common/run_simple_target.yml env: type: ARM_CONTAINER @@ -55,6 +78,7 @@ batch: image: 620771051181.dkr.ecr.us-west-2.amazonaws.com/aws-lc-docker-images-linux-aarch:amazonlinux-2023_clang-15x_sanitizer_latest variables: AWS_LC_CI_TARGET: "tests/ci/integration/run_openssh_integration.sh" + OPENSSH_BRANCH: "V_8_9" - identifier: postgres_integration_x86_64 buildspec: tests/ci/codebuild/common/run_nonroot_target.yml diff --git a/tests/ci/integration/run_mysql_integration.sh b/tests/ci/integration/run_mysql_integration.sh index b352422eb7f..9efd718c672 100755 --- a/tests/ci/integration/run_mysql_integration.sh +++ b/tests/ci/integration/run_mysql_integration.sh @@ -45,8 +45,8 @@ function mysql_patch_reminder() { } function mysql_build() { - cmake ${MYSQL_SRC_FOLDER} -GNinja -DWITH_BOOST=${BOOST_INSTALL_FOLDER} -DWITH_SSL=${AWS_LC_INSTALL_FOLDER} "-B${MYSQL_BUILD_FOLDER}" - ninja -C ${MYSQL_BUILD_FOLDER} + cmake ${MYSQL_SRC_FOLDER} -GNinja -DWITH_BOOST=${BOOST_INSTALL_FOLDER} -DWITH_SSL=${AWS_LC_INSTALL_FOLDER} "-B${MYSQL_BUILD_FOLDER}" -DCMAKE_BUILD_TYPE=RelWithDebInfo + time ninja -C ${MYSQL_BUILD_FOLDER} ls -R ${MYSQL_BUILD_FOLDER} } @@ -88,7 +88,7 @@ main.client_ssl_data_print : Bug#0002 AWS-LC does not support Stateful session main.ssl_cache : Bug#0002 AWS-LC does not support Stateful session resumption (Session Caching). main.ssl_cache_tls13 : Bug#0002 AWS-LC does not support Stateful session resumption (Session Caching). "> skiplist - ./mtr --suite=main --force --parallel=auto --skip-test-list=${MYSQL_BUILD_FOLDER}/mysql-test/skiplist --retry-failure=3 --retry=3 --report-unstable-tests + ./mtr --suite=main --force --parallel=$((NUM_CPU_THREADS * 2)) --skip-test-list=${MYSQL_BUILD_FOLDER}/mysql-test/skiplist --retry-failure=3 --retry=3 --report-unstable-tests popd } diff --git a/tests/ci/integration/run_openssh_integration.sh b/tests/ci/integration/run_openssh_integration.sh index 27177253e79..6bd92e0d03e 100755 --- a/tests/ci/integration/run_openssh_integration.sh +++ b/tests/ci/integration/run_openssh_integration.sh @@ -60,7 +60,6 @@ function openssh_build() { function checkout_openssh_branch() { pushd "${OPENSSH_WORKSPACE_FOLDER}" - make clean git clean -f -d git checkout --track origin/"$1" popd @@ -80,24 +79,25 @@ function openssh_run_tests() { mkdir -p "${AWS_LC_BUILD_FOLDER}" "${AWS_LC_INSTALL_FOLDER}" "${OPENSSH_INSTALL_FOLDER}" # Get latest OpenSSH version. -git clone https://github.com/openssh/openssh-portable.git +git clone https://github.com/openssh/openssh-portable.git "${OPENSSH_WORKSPACE_FOLDER}" ls -# Buld AWS-LC as a shared library +# Build AWS-LC as a shared library aws_lc_build "$SRC_ROOT" "$AWS_LC_BUILD_FOLDER" "$AWS_LC_INSTALL_FOLDER" -DBUILD_TESTING=OFF -DBUILD_TOOL=OFF -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_SHARED_LIBS=1 install_aws_lc -CODEBUILD_SKIPPED_TESTS="agent-subprocess forwarding multiplex channel-timeout forward-control agent-restrict connection-timeout" +if [ "$OPENSSH_BRANCH" != "master" ]; then + checkout_openssh_branch "$OPENSSH_BRANCH" +fi -# Using default branch. Build openssh and run tests. openssh_build -openssh_run_tests "${CODEBUILD_SKIPPED_TESTS}" -# Using branch V_8_9 -checkout_openssh_branch V_8_9 -openssh_build -# In v8.9, the "percent" test requires the 'openssl' cli command -openssh_run_tests "percent ${CODEBUILD_SKIPPED_TESTS}" +CODEBUILD_SKIPPED_TESTS="agent-subprocess forwarding multiplex channel-timeout forward-control agent-restrict connection-timeout" +if [ "$OPENSSH_BRANCH" == "V_8_9" ]; then + # In v8.9, the "percent" test requires the 'openssl' cli command + openssh_run_tests "percent ${CODEBUILD_SKIPPED_TESTS}" +else + openssh_run_tests "${CODEBUILD_SKIPPED_TESTS}" +fi popd - diff --git a/tests/ci/run_fuzz_tests.sh b/tests/ci/run_fuzz_tests.sh index 7fbe8551f4f..459c220ad29 100755 --- a/tests/ci/run_fuzz_tests.sh +++ b/tests/ci/run_fuzz_tests.sh @@ -15,8 +15,8 @@ set -u # 18 minutes for cleanup and merging files if [[ $PLATFORM == "aarch64" ]]; then # Arm sanitizers are very slow which causes the clean up time to take longer per - # fuzz test, only run for 16 minutes - TOTAL_FUZZ_TEST_TIME=1000 + # fuzz test, only run for 8 minutes + TOTAL_FUZZ_TEST_TIME=500 else TOTAL_FUZZ_TEST_TIME=1500 fi From cc2e7feb3f7040573141add5df9ae3bc005c0caf Mon Sep 17 00:00:00 2001 From: Andrew Hopkins Date: Wed, 31 Jan 2024 13:07:09 -0800 Subject: [PATCH 2/2] PR feedback: go back to using parallel=auto for mtr --- tests/ci/integration/run_mysql_integration.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/ci/integration/run_mysql_integration.sh b/tests/ci/integration/run_mysql_integration.sh index 9efd718c672..9256a31d967 100755 --- a/tests/ci/integration/run_mysql_integration.sh +++ b/tests/ci/integration/run_mysql_integration.sh @@ -88,7 +88,7 @@ main.client_ssl_data_print : Bug#0002 AWS-LC does not support Stateful session main.ssl_cache : Bug#0002 AWS-LC does not support Stateful session resumption (Session Caching). main.ssl_cache_tls13 : Bug#0002 AWS-LC does not support Stateful session resumption (Session Caching). "> skiplist - ./mtr --suite=main --force --parallel=$((NUM_CPU_THREADS * 2)) --skip-test-list=${MYSQL_BUILD_FOLDER}/mysql-test/skiplist --retry-failure=3 --retry=3 --report-unstable-tests + ./mtr --suite=main --force --parallel=auto --skip-test-list=${MYSQL_BUILD_FOLDER}/mysql-test/skiplist --retry-failure=3 --retry=3 --report-unstable-tests popd }