From 18d7f39840e4ba86abc8cee273ba316522d229f3 Mon Sep 17 00:00:00 2001 From: Jonas Bergler Date: Wed, 27 Mar 2024 20:44:40 +0000 Subject: [PATCH 01/10] WT-12554 Treat git clone failures as setup failures in Evergreen In the evergreen builds we have a number of places where `git clone` is invoked in the middle of a complex build step. This can result in git problems being tracked as "test failures" This PR factors out those commands into their own steps where possible and marks them as setup steps to allow us to better track failure reasons in our build stats. --- test/evergreen.yml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/test/evergreen.yml b/test/evergreen.yml index 16ada1814f8..922a77062c3 100644 --- a/test/evergreen.yml +++ b/test/evergreen.yml @@ -141,6 +141,15 @@ functions: type: setup params: directory: wiredtiger + "get automation scripts": + command: shell.exec + type: setup + params: + shell: bash + script: | + if [ "$OS" != "Windows_NT" ] && ! -d "./automation-scripts" ]; then + git clone git@github.com:wiredtiger/automation-scripts.git + fi "fetch artifacts": &fetch_artifacts command: s3.get type: setup @@ -297,9 +306,8 @@ functions: else echo "Using config flags $DEFINED_EVERGREEN_CONFIG_FLAGS ${posix_configure_flags|}" # Fetch the gperftools library if needed. This will also get tcmalloc. - if [[ ${ENABLE_TCMALLOC|0} -eq 1 ]] && [ ! -d "./automation-scripts" ]; then + if [[ ${ENABLE_TCMALLOC|0} -eq 1 ]]; then is_cmake_build=true - git clone git@github.com:wiredtiger/automation-scripts.git . automation-scripts/evergreen/find_gperftools.sh ${s3_access_key} ${s3_secret_key} ${build_variant} $is_cmake_build fi # Compiling with CMake. @@ -2816,6 +2824,7 @@ tasks: - name: configure-combinations commands: - func: "get project" + - func: "get automation tools" - command: shell.exec params: working_dir: "wiredtiger" @@ -3280,6 +3289,7 @@ tasks: - name: long-test commands: - func: "get project" + - func: "get automation tools" - func: "configure wiredtiger" - func: "make wiredtiger" From 56ca9ccb66420e42145b2dc3249f680171192e7f Mon Sep 17 00:00:00 2001 From: Jonas Bergler Date: Wed, 27 Mar 2024 20:51:47 +0000 Subject: [PATCH 02/10] missing [ --- test/evergreen.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/evergreen.yml b/test/evergreen.yml index 922a77062c3..d823d7a3bd0 100644 --- a/test/evergreen.yml +++ b/test/evergreen.yml @@ -147,7 +147,7 @@ functions: params: shell: bash script: | - if [ "$OS" != "Windows_NT" ] && ! -d "./automation-scripts" ]; then + if [ "$OS" != "Windows_NT" ] && ! [ -d "./automation-scripts" ]; then git clone git@github.com:wiredtiger/automation-scripts.git fi "fetch artifacts": &fetch_artifacts From 0541d99ee381aace08d84f53e5b415c2e9e7b31a Mon Sep 17 00:00:00 2001 From: Jonas Bergler Date: Wed, 27 Mar 2024 20:54:25 +0000 Subject: [PATCH 03/10] shellopts --- test/evergreen.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/evergreen.yml b/test/evergreen.yml index d823d7a3bd0..884fea8a305 100644 --- a/test/evergreen.yml +++ b/test/evergreen.yml @@ -147,6 +147,8 @@ functions: params: shell: bash script: | + set -o errexit + set -o verbose if [ "$OS" != "Windows_NT" ] && ! [ -d "./automation-scripts" ]; then git clone git@github.com:wiredtiger/automation-scripts.git fi From f7bedb7e7323b0af656d6a07e0c18fc6facfc2c2 Mon Sep 17 00:00:00 2001 From: Jonas Bergler Date: Wed, 27 Mar 2024 20:57:06 +0000 Subject: [PATCH 04/10] use the correct name for func --- test/evergreen.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/evergreen.yml b/test/evergreen.yml index 884fea8a305..705acd7b6a8 100644 --- a/test/evergreen.yml +++ b/test/evergreen.yml @@ -2826,7 +2826,7 @@ tasks: - name: configure-combinations commands: - func: "get project" - - func: "get automation tools" + - func: "get automation scripts" - command: shell.exec params: working_dir: "wiredtiger" @@ -3291,7 +3291,7 @@ tasks: - name: long-test commands: - func: "get project" - - func: "get automation tools" + - func: "get automation scripts" - func: "configure wiredtiger" - func: "make wiredtiger" From b328d029825203f9b597f5963ef0e1fa8b9e0221 Mon Sep 17 00:00:00 2001 From: Jonas Bergler Date: Wed, 27 Mar 2024 21:03:42 +0000 Subject: [PATCH 05/10] clone automation scripts in 'get project' --- test/evergreen.yml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/test/evergreen.yml b/test/evergreen.yml index 705acd7b6a8..55cdf2eeca5 100644 --- a/test/evergreen.yml +++ b/test/evergreen.yml @@ -137,12 +137,11 @@ functions: echo "build --workspace_status_command=./evergreen/engflow_workspace_status.sh" >> .bazelrc.evergreen_engflow_creds fi "get project": - command: git.get_project + - command: git.get_project type: setup params: directory: wiredtiger - "get automation scripts": - command: shell.exec + - command: shell.exec type: setup params: shell: bash @@ -2826,7 +2825,6 @@ tasks: - name: configure-combinations commands: - func: "get project" - - func: "get automation scripts" - command: shell.exec params: working_dir: "wiredtiger" @@ -3291,7 +3289,6 @@ tasks: - name: long-test commands: - func: "get project" - - func: "get automation scripts" - func: "configure wiredtiger" - func: "make wiredtiger" From 1b1ab66d1e711b3c562ae070f78c61cceaf79cf6 Mon Sep 17 00:00:00 2001 From: Jonas Bergler Date: Wed, 27 Mar 2024 21:10:53 +0000 Subject: [PATCH 06/10] correct working dir --- test/evergreen.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/test/evergreen.yml b/test/evergreen.yml index 55cdf2eeca5..b34868dbae0 100644 --- a/test/evergreen.yml +++ b/test/evergreen.yml @@ -145,6 +145,7 @@ functions: type: setup params: shell: bash + working_dir: wiredtiger script: | set -o errexit set -o verbose From 8a82da865185f66de00cb349e75861c4d6585096 Mon Sep 17 00:00:00 2001 From: Jonas Bergler Date: Wed, 3 Apr 2024 19:46:27 +0000 Subject: [PATCH 07/10] get wiredtiger_previous using git worktree instead of clone --- test/evergreen.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/test/evergreen.yml b/test/evergreen.yml index 854fbcddfff..1dcce299126 100644 --- a/test/evergreen.yml +++ b/test/evergreen.yml @@ -3075,9 +3075,8 @@ tasks: ####################################################### # Obtain the complexity metrics for the 'previous' code ####################################################### - git clone https://github.com/wiredtiger/wiredtiger.git wiredtiger_previous + git worktree add -d wiredtiger_previous "${github_commit}" cd wiredtiger_previous - git checkout ${github_commit} if [ ${is_patch|false} = true ]; then # Checkout the point at which this patch/branch diverged from develop git checkout `python3 dist/common_functions.py last_commit_from_dev` From 6a231df7dd8b1c948e0e20ad7a54cb9b3b111f96 Mon Sep 17 00:00:00 2001 From: Jonas Bergler Date: Wed, 3 Apr 2024 19:57:26 +0000 Subject: [PATCH 08/10] cleanup separate step --- test/evergreen.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/test/evergreen.yml b/test/evergreen.yml index 1dcce299126..fd33fe694f4 100644 --- a/test/evergreen.yml +++ b/test/evergreen.yml @@ -137,11 +137,12 @@ functions: echo "build --workspace_status_command=./evergreen/engflow_workspace_status.sh" >> .bazelrc.evergreen_engflow_creds fi "get project": - - command: git.get_project + command: git.get_project type: setup params: directory: wiredtiger - - command: shell.exec + "get automation-scripts": &get_automation_scripts + command: shell.exec type: setup params: shell: bash @@ -149,7 +150,7 @@ functions: script: | set -o errexit set -o verbose - if [ "$OS" != "Windows_NT" ] && ! [ -d "./automation-scripts" ]; then + if ! [ -d "./automation-scripts" ]; then git clone git@github.com:wiredtiger/automation-scripts.git fi "fetch artifacts": &fetch_artifacts @@ -362,6 +363,7 @@ functions: fi echo "Ending 'make wiredtiger' step" "compile wiredtiger": + - *get_automation_scripts - *configure_wiredtiger - *make_wiredtiger "dump stacktraces": &dump_stacktraces @@ -1267,6 +1269,7 @@ functions: ${python_binary|python3} wiredtiger/bench/perf_run_py/perf_json_converter_for_atlas_evergreen.py -i ${input_file} -n ${test_name} -o ${output_path} "upload stats to atlas": + - *get_automation_scripts - command: shell.exec params: shell: bash @@ -1277,9 +1280,6 @@ functions: virtualenv -p ${python_binary|python3} venv source venv/bin/activate pip3 install pymongo[srv]==3.12.2 pygit2==1.10.1 - if [[ ! -d "automation-scripts" ]]; then - git clone git@github.com:wiredtiger/automation-scripts.git - fi EVERGREEN_TASK_INFO='{ "evergreen_task_info": { "is_patch": "'${is_patch}'", "task_id": "'${task_id}'", "distro_id": "'${distro_id}'", "execution": "'${execution}'", "task_name": "'${task_name}'", "version_id": "'${version_id}'", "branch_name": "'${branch_name}'" } }' echo "EVERGREEN_TASK_INFO: $EVERGREEN_TASK_INFO" ${python_binary|python3} automation-scripts/evergreen/upload_stats_atlas.py -u ${atlas_perf_test_username} -p ${atlas_perf_test_password} -c ${collection|} -d ${database|} -f ${stats_dir|./wiredtiger/cmake_build/bench/wtperf/test_stats}/atlas_out_${test-name}.json -t ${created_at} -i "$EVERGREEN_TASK_INFO" -g "./wiredtiger" From 48de1031a4358de3149d5e9cd5b431bc7ae38d7a Mon Sep 17 00:00:00 2001 From: Jonas Bergler Date: Wed, 3 Apr 2024 20:04:49 +0000 Subject: [PATCH 09/10] fix path for automation-scripts --- test/evergreen.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/test/evergreen.yml b/test/evergreen.yml index fd33fe694f4..093b14f53f3 100644 --- a/test/evergreen.yml +++ b/test/evergreen.yml @@ -146,7 +146,6 @@ functions: type: setup params: shell: bash - working_dir: wiredtiger script: | set -o errexit set -o verbose @@ -311,7 +310,7 @@ functions: # Fetch the gperftools library if needed. This will also get tcmalloc. if [[ ${ENABLE_TCMALLOC|0} -eq 1 ]]; then is_cmake_build=true - . automation-scripts/evergreen/find_gperftools.sh ${s3_access_key} ${s3_secret_key} ${build_variant} $is_cmake_build + . ../automation-scripts/evergreen/find_gperftools.sh ${s3_access_key} ${s3_secret_key} ${build_variant} $is_cmake_build fi # Compiling with CMake. echo "Find CMake" From 81eac31dc7a918029acd07937adb5e77fd80ebf8 Mon Sep 17 00:00:00 2001 From: Jonas Bergler Date: Wed, 3 Apr 2024 20:33:30 +0000 Subject: [PATCH 10/10] use --detach instead of -d for older git versions --- test/evergreen.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/evergreen.yml b/test/evergreen.yml index 093b14f53f3..8b54e8e5402 100644 --- a/test/evergreen.yml +++ b/test/evergreen.yml @@ -3074,7 +3074,7 @@ tasks: ####################################################### # Obtain the complexity metrics for the 'previous' code ####################################################### - git worktree add -d wiredtiger_previous "${github_commit}" + git worktree add --detach wiredtiger_previous "${github_commit}" cd wiredtiger_previous if [ ${is_patch|false} = true ]; then # Checkout the point at which this patch/branch diverged from develop