From 8cef1997a41e4f5565b6a834b5822b34b3b4e6f5 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Thu, 17 Oct 2024 13:45:00 -0500 Subject: [PATCH 1/2] PYTHON-4879 Use shrub.py for compressor tests --- .evergreen/config.yml | 300 +++++++++++++++++++++----- .evergreen/scripts/generate_config.py | 50 ++++- 2 files changed, 300 insertions(+), 50 deletions(-) diff --git a/.evergreen/config.yml b/.evergreen/config.yml index ae7c0a6590..cb04cd4a18 100644 --- a/.evergreen/config.yml +++ b/.evergreen/config.yml @@ -2112,23 +2112,6 @@ axes: AUTH: "noauth" SSL: "nossl" - # Choice of wire protocol compression support - - id: compression - display_name: Compression - values: - - id: snappy - display_name: snappy compression - variables: - COMPRESSORS: "snappy" - - id: zlib - display_name: zlib compression - variables: - COMPRESSORS: "zlib" - - id: zstd - display_name: zstd compression - variables: - COMPRESSORS: "zstd" - # Choice of MongoDB server version - id: mongodb-version display_name: "MongoDB" @@ -3125,6 +3108,257 @@ buildvariants: PYTHON_BINARY: C:/python/Python313/python.exe tags: [encryption_tag] +# Compressor tests. +- name: snappy-compression-rhel8-py3.9-no-c + tasks: + - name: .standalone + display_name: snappy compression RHEL8 py3.9 No C + run_on: + - rhel87-small + expansions: + COMPRESSORS: snappy + NO_EXT: "1" + PYTHON_BINARY: /opt/python/3.9/bin/python3 +- name: snappy-compression-rhel8-py3.9 + tasks: + - name: .standalone + display_name: snappy compression RHEL8 py3.9 + run_on: + - rhel87-small + expansions: + COMPRESSORS: snappy + PYTHON_BINARY: /opt/python/3.9/bin/python3 +- name: snappy-compression-rhel8-py3.13-no-c + tasks: + - name: .standalone + display_name: snappy compression RHEL8 py3.13 No C + run_on: + - rhel87-small + expansions: + COMPRESSORS: snappy + NO_EXT: "1" + PYTHON_BINARY: /opt/python/3.13/bin/python3 +- name: snappy-compression-rhel8-py3.13 + tasks: + - name: .standalone + display_name: snappy compression RHEL8 py3.13 + run_on: + - rhel87-small + expansions: + COMPRESSORS: snappy + PYTHON_BINARY: /opt/python/3.13/bin/python3 +- name: zlib-compression-rhel8-py3.9-no-c + tasks: + - name: .standalone + display_name: zlib compression RHEL8 py3.9 No C + run_on: + - rhel87-small + expansions: + COMPRESSORS: zlib + NO_EXT: "1" + PYTHON_BINARY: /opt/python/3.9/bin/python3 +- name: zlib-compression-rhel8-py3.9 + tasks: + - name: .standalone + display_name: zlib compression RHEL8 py3.9 + run_on: + - rhel87-small + expansions: + COMPRESSORS: zlib + PYTHON_BINARY: /opt/python/3.9/bin/python3 +- name: zlib-compression-rhel8-py3.13-no-c + tasks: + - name: .standalone + display_name: zlib compression RHEL8 py3.13 No C + run_on: + - rhel87-small + expansions: + COMPRESSORS: zlib + NO_EXT: "1" + PYTHON_BINARY: /opt/python/3.13/bin/python3 +- name: zlib-compression-rhel8-py3.13 + tasks: + - name: .standalone + display_name: zlib compression RHEL8 py3.13 + run_on: + - rhel87-small + expansions: + COMPRESSORS: zlib + PYTHON_BINARY: /opt/python/3.13/bin/python3 +- name: zstd-compression-rhel8-py3.9-no-c + tasks: + - name: .standalone !.4.0 + display_name: zstd compression RHEL8 py3.9 No C + run_on: + - rhel87-small + expansions: + COMPRESSORS: zstd + NO_EXT: "1" + PYTHON_BINARY: /opt/python/3.9/bin/python3 +- name: zstd-compression-rhel8-py3.9 + tasks: + - name: .standalone !.4.0 + display_name: zstd compression RHEL8 py3.9 + run_on: + - rhel87-small + expansions: + COMPRESSORS: zstd + PYTHON_BINARY: /opt/python/3.9/bin/python3 +- name: zstd-compression-rhel8-py3.13-no-c + tasks: + - name: .standalone !.4.0 + display_name: zstd compression RHEL8 py3.13 No C + run_on: + - rhel87-small + expansions: + COMPRESSORS: zstd + NO_EXT: "1" + PYTHON_BINARY: /opt/python/3.13/bin/python3 +- name: zstd-compression-rhel8-py3.13 + tasks: + - name: .standalone !.4.0 + display_name: zstd compression RHEL8 py3.13 + run_on: + - rhel87-small + expansions: + COMPRESSORS: zstd + PYTHON_BINARY: /opt/python/3.13/bin/python3 +- name: snappy-compression-rhel8-py3.10 + tasks: + - name: .standalone + display_name: snappy compression RHEL8 py3.10 + run_on: + - rhel87-small + expansions: + COMPRESSORS: snappy + PYTHON_BINARY: /opt/python/3.10/bin/python3 +- name: snappy-compression-rhel8-py3.11 + tasks: + - name: .standalone + display_name: snappy compression RHEL8 py3.11 + run_on: + - rhel87-small + expansions: + COMPRESSORS: snappy + PYTHON_BINARY: /opt/python/3.11/bin/python3 +- name: snappy-compression-rhel8-py3.12 + tasks: + - name: .standalone + display_name: snappy compression RHEL8 py3.12 + run_on: + - rhel87-small + expansions: + COMPRESSORS: snappy + PYTHON_BINARY: /opt/python/3.12/bin/python3 +- name: snappy-compression-rhel8-pypy3.9 + tasks: + - name: .standalone + display_name: snappy compression RHEL8 pypy3.9 + run_on: + - rhel87-small + expansions: + COMPRESSORS: snappy + PYTHON_BINARY: /opt/python/pypy3.9/bin/python3 +- name: snappy-compression-rhel8-pypy3.10 + tasks: + - name: .standalone + display_name: snappy compression RHEL8 pypy3.10 + run_on: + - rhel87-small + expansions: + COMPRESSORS: snappy + PYTHON_BINARY: /opt/python/pypy3.10/bin/python3 +- name: zlib-compression-rhel8-py3.10 + tasks: + - name: .standalone + display_name: zlib compression RHEL8 py3.10 + run_on: + - rhel87-small + expansions: + COMPRESSORS: zlib + PYTHON_BINARY: /opt/python/3.10/bin/python3 +- name: zlib-compression-rhel8-py3.11 + tasks: + - name: .standalone + display_name: zlib compression RHEL8 py3.11 + run_on: + - rhel87-small + expansions: + COMPRESSORS: zlib + PYTHON_BINARY: /opt/python/3.11/bin/python3 +- name: zlib-compression-rhel8-py3.12 + tasks: + - name: .standalone + display_name: zlib compression RHEL8 py3.12 + run_on: + - rhel87-small + expansions: + COMPRESSORS: zlib + PYTHON_BINARY: /opt/python/3.12/bin/python3 +- name: zlib-compression-rhel8-pypy3.9 + tasks: + - name: .standalone + display_name: zlib compression RHEL8 pypy3.9 + run_on: + - rhel87-small + expansions: + COMPRESSORS: zlib + PYTHON_BINARY: /opt/python/pypy3.9/bin/python3 +- name: zlib-compression-rhel8-pypy3.10 + tasks: + - name: .standalone + display_name: zlib compression RHEL8 pypy3.10 + run_on: + - rhel87-small + expansions: + COMPRESSORS: zlib + PYTHON_BINARY: /opt/python/pypy3.10/bin/python3 +- name: zstd-compression-rhel8-py3.10 + tasks: + - name: .standalone !.4.0 + display_name: zstd compression RHEL8 py3.10 + run_on: + - rhel87-small + expansions: + COMPRESSORS: zstd + PYTHON_BINARY: /opt/python/3.10/bin/python3 +- name: zstd-compression-rhel8-py3.11 + tasks: + - name: .standalone !.4.0 + display_name: zstd compression RHEL8 py3.11 + run_on: + - rhel87-small + expansions: + COMPRESSORS: zstd + PYTHON_BINARY: /opt/python/3.11/bin/python3 +- name: zstd-compression-rhel8-py3.12 + tasks: + - name: .standalone !.4.0 + display_name: zstd compression RHEL8 py3.12 + run_on: + - rhel87-small + expansions: + COMPRESSORS: zstd + PYTHON_BINARY: /opt/python/3.12/bin/python3 +- name: zstd-compression-rhel8-pypy3.9 + tasks: + - name: .standalone !.4.0 + display_name: zstd compression RHEL8 pypy3.9 + run_on: + - rhel87-small + expansions: + COMPRESSORS: zstd + PYTHON_BINARY: /opt/python/pypy3.9/bin/python3 +- name: zstd-compression-rhel8-pypy3.10 + tasks: + - name: .standalone !.4.0 + display_name: zstd compression RHEL8 pypy3.10 + run_on: + - rhel87-small + expansions: + COMPRESSORS: zstd + PYTHON_BINARY: /opt/python/pypy3.10/bin/python3 + - matrix_name: "tests-fips" matrix_spec: platform: @@ -3214,38 +3448,6 @@ buildvariants: - ".4.2" - ".4.0" -- matrix_name: "tests-python-version-rhel8-compression" - matrix_spec: - platform: rhel8 - python-version: "*" - c-extensions: "*" - compression: "*" - exclude_spec: - # These interpreters are always tested without extensions. - - platform: rhel8 - python-version: ["pypy3.9", "pypy3.10"] - c-extensions: "with-c-extensions" - compression: "*" - display_name: "${compression} ${c-extensions} ${python-version} ${platform}" - tasks: - - "test-latest-standalone" - - "test-8.0-standalone" - - "test-7.0-standalone" - - "test-6.0-standalone" - - "test-5.0-standalone" - - "test-4.4-standalone" - - "test-4.2-standalone" - - "test-4.0-standalone" - rules: - # Server version 4.0 supports snappy and zlib but not zstd. - - if: - python-version: "*" - c-extensions: "*" - compression: ["zstd"] - then: - remove_tasks: - - "test-4.0-standalone" - - matrix_name: "tests-python-version-green-framework-rhel8" matrix_spec: platform: rhel8 diff --git a/.evergreen/scripts/generate_config.py b/.evergreen/scripts/generate_config.py index 03b900301c..d1fd4b6080 100644 --- a/.evergreen/scripts/generate_config.py +++ b/.evergreen/scripts/generate_config.py @@ -30,12 +30,14 @@ BATCHTIME_WEEK = 10080 AUTH_SSLS = [("auth", "ssl"), ("noauth", "ssl"), ("noauth", "nossl")] TOPOLOGIES = ["standalone", "replica_set", "sharded_cluster"] +C_EXTS = ["with_ext", "without_ext"] SYNCS = ["sync", "async"] DISPLAY_LOOKUP = dict( ssl=dict(ssl="SSL", nossl="NoSSL"), auth=dict(auth="Auth", noauth="NoAuth"), test_suites=dict(default="Sync", default_async="Async"), coverage=dict(coverage="cov"), + no_ext={"1": "No C"}, ) HOSTS = dict() @@ -137,6 +139,12 @@ def zip_cycle(*iterables, empty_default=None): yield tuple(next(i, empty_default) for i in cycles) +def handle_c_ext(c_ext, expansions): + """Handle c extension option.""" + if c_ext == C_EXTS[0]: + expansions["NO_EXT"] = "1" + + def generate_yaml(tasks=None, variants=None): """Generate the yaml for a given set of tasks and variants.""" project = EvgProject(tasks=tasks, buildvariants=variants) @@ -337,8 +345,48 @@ def create_load_balancer_variants(): return variants +def create_compression_variants(): + # Compression tests - standalone versions of each server, across python versions, with and without c extensions. + # PyPy interpreters are always tested without extensions. + host = "rhel8" + task_names = dict(snappy=[".standalone"], zlib=[".standalone"], zstd=[".standalone !.4.0"]) + variants = [] + for compressor, python, c_ext in product(["snappy", "zlib", "zstd"], MIN_MAX_PYTHON, C_EXTS): + expansions = dict(COMPRESSORS=compressor) + handle_c_ext(c_ext, expansions) + base_name = f"{compressor} compression" + display_name = get_display_name(base_name, host, python=python, **expansions) + variant = create_variant( + task_names[compressor], + display_name, + python=python, + host=host, + expansions=expansions, + ) + variants.append(variant) + + other_pythons = [p for p in CPYTHONS if p not in MIN_MAX_PYTHON] + PYPYS + for compressor, python in product(["snappy", "zlib", "zstd"], other_pythons): + expansions = dict(COMPRESSORS=compressor) + handle_c_ext(c_ext, expansions) + base_name = f"{compressor} compression" + display_name = get_display_name(base_name, host, python=python, **expansions) + variant = create_variant( + task_names[compressor], + display_name, + python=python, + host=host, + expansions=expansions, + ) + variants.append(variant) + + return variants + + ################## # Generate Config ################## -generate_yaml(variants=create_load_balancer_variants()) +variants = create_compression_variants() +# print(len(variants)) +generate_yaml(variants=variants) From dde3a2dcb9d325621d6729f9de4711aac5d4dee0 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Thu, 17 Oct 2024 13:53:24 -0500 Subject: [PATCH 2/2] clean up matrix --- .evergreen/config.yml | 189 ++------------------------ .evergreen/scripts/generate_config.py | 7 +- 2 files changed, 16 insertions(+), 180 deletions(-) diff --git a/.evergreen/config.yml b/.evergreen/config.yml index cb04cd4a18..a7efc223b9 100644 --- a/.evergreen/config.yml +++ b/.evergreen/config.yml @@ -3119,91 +3119,34 @@ buildvariants: COMPRESSORS: snappy NO_EXT: "1" PYTHON_BINARY: /opt/python/3.9/bin/python3 -- name: snappy-compression-rhel8-py3.9 - tasks: - - name: .standalone - display_name: snappy compression RHEL8 py3.9 - run_on: - - rhel87-small - expansions: - COMPRESSORS: snappy - PYTHON_BINARY: /opt/python/3.9/bin/python3 -- name: snappy-compression-rhel8-py3.13-no-c - tasks: - - name: .standalone - display_name: snappy compression RHEL8 py3.13 No C - run_on: - - rhel87-small - expansions: - COMPRESSORS: snappy - NO_EXT: "1" - PYTHON_BINARY: /opt/python/3.13/bin/python3 -- name: snappy-compression-rhel8-py3.13 +- name: snappy-compression-rhel8-py3.10 tasks: - name: .standalone - display_name: snappy compression RHEL8 py3.13 + display_name: snappy compression RHEL8 py3.10 run_on: - rhel87-small expansions: COMPRESSORS: snappy - PYTHON_BINARY: /opt/python/3.13/bin/python3 -- name: zlib-compression-rhel8-py3.9-no-c - tasks: - - name: .standalone - display_name: zlib compression RHEL8 py3.9 No C - run_on: - - rhel87-small - expansions: - COMPRESSORS: zlib - NO_EXT: "1" - PYTHON_BINARY: /opt/python/3.9/bin/python3 -- name: zlib-compression-rhel8-py3.9 - tasks: - - name: .standalone - display_name: zlib compression RHEL8 py3.9 - run_on: - - rhel87-small - expansions: - COMPRESSORS: zlib - PYTHON_BINARY: /opt/python/3.9/bin/python3 -- name: zlib-compression-rhel8-py3.13-no-c + PYTHON_BINARY: /opt/python/3.10/bin/python3 +- name: zlib-compression-rhel8-py3.11-no-c tasks: - name: .standalone - display_name: zlib compression RHEL8 py3.13 No C + display_name: zlib compression RHEL8 py3.11 No C run_on: - rhel87-small expansions: COMPRESSORS: zlib NO_EXT: "1" - PYTHON_BINARY: /opt/python/3.13/bin/python3 -- name: zlib-compression-rhel8-py3.13 + PYTHON_BINARY: /opt/python/3.11/bin/python3 +- name: zlib-compression-rhel8-py3.12 tasks: - name: .standalone - display_name: zlib compression RHEL8 py3.13 + display_name: zlib compression RHEL8 py3.12 run_on: - rhel87-small expansions: COMPRESSORS: zlib - PYTHON_BINARY: /opt/python/3.13/bin/python3 -- name: zstd-compression-rhel8-py3.9-no-c - tasks: - - name: .standalone !.4.0 - display_name: zstd compression RHEL8 py3.9 No C - run_on: - - rhel87-small - expansions: - COMPRESSORS: zstd - NO_EXT: "1" - PYTHON_BINARY: /opt/python/3.9/bin/python3 -- name: zstd-compression-rhel8-py3.9 - tasks: - - name: .standalone !.4.0 - display_name: zstd compression RHEL8 py3.9 - run_on: - - rhel87-small - expansions: - COMPRESSORS: zstd - PYTHON_BINARY: /opt/python/3.9/bin/python3 + PYTHON_BINARY: /opt/python/3.12/bin/python3 - name: zstd-compression-rhel8-py3.13-no-c tasks: - name: .standalone !.4.0 @@ -3214,42 +3157,15 @@ buildvariants: COMPRESSORS: zstd NO_EXT: "1" PYTHON_BINARY: /opt/python/3.13/bin/python3 -- name: zstd-compression-rhel8-py3.13 +- name: zstd-compression-rhel8-py3.9 tasks: - name: .standalone !.4.0 - display_name: zstd compression RHEL8 py3.13 + display_name: zstd compression RHEL8 py3.9 run_on: - rhel87-small expansions: COMPRESSORS: zstd - PYTHON_BINARY: /opt/python/3.13/bin/python3 -- name: snappy-compression-rhel8-py3.10 - tasks: - - name: .standalone - display_name: snappy compression RHEL8 py3.10 - run_on: - - rhel87-small - expansions: - COMPRESSORS: snappy - PYTHON_BINARY: /opt/python/3.10/bin/python3 -- name: snappy-compression-rhel8-py3.11 - tasks: - - name: .standalone - display_name: snappy compression RHEL8 py3.11 - run_on: - - rhel87-small - expansions: - COMPRESSORS: snappy - PYTHON_BINARY: /opt/python/3.11/bin/python3 -- name: snappy-compression-rhel8-py3.12 - tasks: - - name: .standalone - display_name: snappy compression RHEL8 py3.12 - run_on: - - rhel87-small - expansions: - COMPRESSORS: snappy - PYTHON_BINARY: /opt/python/3.12/bin/python3 + PYTHON_BINARY: /opt/python/3.9/bin/python3 - name: snappy-compression-rhel8-pypy3.9 tasks: - name: .standalone @@ -3259,51 +3175,6 @@ buildvariants: expansions: COMPRESSORS: snappy PYTHON_BINARY: /opt/python/pypy3.9/bin/python3 -- name: snappy-compression-rhel8-pypy3.10 - tasks: - - name: .standalone - display_name: snappy compression RHEL8 pypy3.10 - run_on: - - rhel87-small - expansions: - COMPRESSORS: snappy - PYTHON_BINARY: /opt/python/pypy3.10/bin/python3 -- name: zlib-compression-rhel8-py3.10 - tasks: - - name: .standalone - display_name: zlib compression RHEL8 py3.10 - run_on: - - rhel87-small - expansions: - COMPRESSORS: zlib - PYTHON_BINARY: /opt/python/3.10/bin/python3 -- name: zlib-compression-rhel8-py3.11 - tasks: - - name: .standalone - display_name: zlib compression RHEL8 py3.11 - run_on: - - rhel87-small - expansions: - COMPRESSORS: zlib - PYTHON_BINARY: /opt/python/3.11/bin/python3 -- name: zlib-compression-rhel8-py3.12 - tasks: - - name: .standalone - display_name: zlib compression RHEL8 py3.12 - run_on: - - rhel87-small - expansions: - COMPRESSORS: zlib - PYTHON_BINARY: /opt/python/3.12/bin/python3 -- name: zlib-compression-rhel8-pypy3.9 - tasks: - - name: .standalone - display_name: zlib compression RHEL8 pypy3.9 - run_on: - - rhel87-small - expansions: - COMPRESSORS: zlib - PYTHON_BINARY: /opt/python/pypy3.9/bin/python3 - name: zlib-compression-rhel8-pypy3.10 tasks: - name: .standalone @@ -3313,33 +3184,6 @@ buildvariants: expansions: COMPRESSORS: zlib PYTHON_BINARY: /opt/python/pypy3.10/bin/python3 -- name: zstd-compression-rhel8-py3.10 - tasks: - - name: .standalone !.4.0 - display_name: zstd compression RHEL8 py3.10 - run_on: - - rhel87-small - expansions: - COMPRESSORS: zstd - PYTHON_BINARY: /opt/python/3.10/bin/python3 -- name: zstd-compression-rhel8-py3.11 - tasks: - - name: .standalone !.4.0 - display_name: zstd compression RHEL8 py3.11 - run_on: - - rhel87-small - expansions: - COMPRESSORS: zstd - PYTHON_BINARY: /opt/python/3.11/bin/python3 -- name: zstd-compression-rhel8-py3.12 - tasks: - - name: .standalone !.4.0 - display_name: zstd compression RHEL8 py3.12 - run_on: - - rhel87-small - expansions: - COMPRESSORS: zstd - PYTHON_BINARY: /opt/python/3.12/bin/python3 - name: zstd-compression-rhel8-pypy3.9 tasks: - name: .standalone !.4.0 @@ -3349,15 +3193,6 @@ buildvariants: expansions: COMPRESSORS: zstd PYTHON_BINARY: /opt/python/pypy3.9/bin/python3 -- name: zstd-compression-rhel8-pypy3.10 - tasks: - - name: .standalone !.4.0 - display_name: zstd compression RHEL8 pypy3.10 - run_on: - - rhel87-small - expansions: - COMPRESSORS: zstd - PYTHON_BINARY: /opt/python/pypy3.10/bin/python3 - matrix_name: "tests-fips" matrix_spec: diff --git a/.evergreen/scripts/generate_config.py b/.evergreen/scripts/generate_config.py index d1fd4b6080..91dedeb620 100644 --- a/.evergreen/scripts/generate_config.py +++ b/.evergreen/scripts/generate_config.py @@ -351,10 +351,11 @@ def create_compression_variants(): host = "rhel8" task_names = dict(snappy=[".standalone"], zlib=[".standalone"], zstd=[".standalone !.4.0"]) variants = [] - for compressor, python, c_ext in product(["snappy", "zlib", "zstd"], MIN_MAX_PYTHON, C_EXTS): + for ind, (compressor, c_ext) in enumerate(product(["snappy", "zlib", "zstd"], C_EXTS)): expansions = dict(COMPRESSORS=compressor) handle_c_ext(c_ext, expansions) base_name = f"{compressor} compression" + python = CPYTHONS[ind % len(CPYTHONS)] display_name = get_display_name(base_name, host, python=python, **expansions) variant = create_variant( task_names[compressor], @@ -365,8 +366,8 @@ def create_compression_variants(): ) variants.append(variant) - other_pythons = [p for p in CPYTHONS if p not in MIN_MAX_PYTHON] + PYPYS - for compressor, python in product(["snappy", "zlib", "zstd"], other_pythons): + other_pythons = PYPYS + CPYTHONS[ind:] + for compressor, python in zip_cycle(["snappy", "zlib", "zstd"], other_pythons): expansions = dict(COMPRESSORS=compressor) handle_c_ext(c_ext, expansions) base_name = f"{compressor} compression"