Skip to content

Commit fdbc93e

Browse files
authored
Refactor asv benchmarks so they take less time (#2546)
#### Reference Issues/PRs Monday ref: 168855452 #### What does this implement or fix? - Reduces the execution time of the ASV benchmarks by: - Changing how batch methods are tested/set up [here](https://github.com/man-group/ArcticDB/pull/2546/files#diff-bd6f7ed49253f7e07ef3817909be39afba58dca4b80448750c537faef6943c42R159) - Using an extended Version cache during the setup of the version chain tests [here](https://github.com/man-group/ArcticDB/pull/2546/files#diff-bad9b902faf66d6bfc62eb9bd759040b1795510451bc9f419c4b7f322d93ca72R56) - Fixes how persistent tests are run so we can both run against the full matrix when needed but also run only against 3.11 during regular runs [here](https://github.com/man-group/ArcticDB/pull/2546/files#diff-267681e241c6c8b359dce14041003317cb3e43d9a1040fac0264e2ed993bc3dcR326) The key insight for the ASV tests is that the IOPS for the ec2 machines degrades over time and it becomes quite bad after around 2.5h. After that point the IOPS start to take exponentially more time and this PR aims to reduce the number of operation that need to be done so we don't exceed the 2.5h threshold too much and even after we do exceed it it is not by too much. #### Any other comments? #### Checklist <details> <summary> Checklist for code changes... </summary> - [ ] Have you updated the relevant docstrings, documentation and copyright notice? - [ ] Is this contribution tested against [all ArcticDB's features](../docs/mkdocs/docs/technical/contributing.md)? - [ ] Do all exceptions introduced raise appropriate [error messages](https://docs.arcticdb.io/error_messages/)? - [ ] Are API changes highlighted in the PR description? - [ ] Is the PR labelled as enhancement or bug so it appears in autogenerated release notes? </details> <!-- Thanks for contributing a Pull Request to ArcticDB! Please ensure you have taken a look at: - ArcticDB's Code of Conduct: https://github.com/man-group/ArcticDB/blob/master/CODE_OF_CONDUCT.md - ArcticDB's Contribution Licensing: https://github.com/man-group/ArcticDB/blob/master/docs/mkdocs/docs/technical/contributing.md#contribution-licensing -->
1 parent 633e6fd commit fdbc93e

12 files changed

+274
-213
lines changed

.github/workflows/benchmark_commits.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,4 +138,4 @@ jobs:
138138
with:
139139
job_type: stop
140140
label: ${{ needs.start_ec2_runner.outputs.label }}
141-
ec2-instance-id: ${{ needs.start_ec2_runner.outputs.ec2-instance-id }}
141+
ec2-instance-id: ${{ needs.start_ec2_runner.outputs.ec2-instance-id }}

.github/workflows/build.yml

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,11 @@ on:
4848
required: false
4949
default: false
5050
type: boolean
51+
run_full_matrix_of_persistent_tests:
52+
description: Run full matrix of persistent tests
53+
required: false
54+
default: false
55+
type: boolean
5156
run-name: Building ${{github.ref_name}} on ${{github.event_name}} by ${{github.actor}}
5257
concurrency:
5358
group: ${{github.ref}}
@@ -209,7 +214,7 @@ jobs:
209214
fail-fast: false
210215
matrix:
211216
# This uses old arcticdb versions which won't work on python < 3.12
212-
python3: ${{fromJson(vars.LINUX_PYTHON_VERSIONS || '[11]')}}
217+
python3: ${{fromJson(inputs.run_full_matrix_of_persistent_tests && '[8, 9, 10, 11]' || '[11]')}}
213218
arcticdb_version: ["oldest", "latest"]
214219
include:
215220
- python_deps_ids: [""]
@@ -233,7 +238,7 @@ jobs:
233238
fail-fast: false
234239
matrix:
235240
# This uses old arcticdb versions which won't work on python < 3.12
236-
python3: ${{fromJson(vars.WINDOWS_PYTHON_VERSIONS || '[11]')}}
241+
python3: ${{fromJson(inputs.run_full_matrix_of_persistent_tests && '[8, 9, 10, 11]' || '[11]')}}
237242
arcticdb_version: ["oldest", "latest"]
238243
include:
239244
- python_deps_ids: [""]
@@ -267,7 +272,7 @@ jobs:
267272
strategy:
268273
fail-fast: false
269274
matrix:
270-
python3: ${{fromJson(vars.LINUX_PYTHON_VERSIONS || '[8, 9, 10, 11, 12, 13]')}}
275+
python3: ${{fromJson(vars.LINUX_PYTHON_VERSIONS || '[8, 9, 10, 11]')}}
271276
include:
272277
- python_deps_ids: [""]
273278
matrix_override: ${{fromJson(needs.common_config.outputs.linux_matrix)}}
@@ -331,7 +336,7 @@ jobs:
331336
strategy:
332337
fail-fast: false
333338
matrix:
334-
python3: ${{fromJson(vars.WINDOWS_PYTHON_VERSIONS || '[8, 9, 10, 11, 12, 13]')}}
339+
python3: ${{fromJson(vars.LINUX_PYTHON_VERSIONS || '[8, 9, 10, 11]')}}
335340
include:
336341
- matrix_override: ${{fromJson(needs.common_config.outputs.windows_matrix)}}
337342
name: 3.${{matrix.python3}} Windows
@@ -359,7 +364,7 @@ jobs:
359364
fail-fast: false
360365
matrix:
361366
# This uses old arcticdb versions which won't work on python < 3.12
362-
python3: ${{fromJson(vars.LINUX_PYTHON_VERSIONS || '[11]')}}
367+
python3: ${{ fromJson(inputs.run_full_matrix_of_persistent_tests && '[8, 9, 10, 11]' || '[11]') }}
363368
arcticdb_version: ["oldest", "latest"]
364369
include:
365370
- python_deps_ids: [""]
@@ -382,7 +387,7 @@ jobs:
382387
fail-fast: false
383388
matrix:
384389
# This uses old arcticdb versions which won't work on python < 3.12
385-
python3: ${{fromJson(vars.WINDOWS_PYTHON_VERSIONS || '[11]')}}
390+
python3: ${{ fromJson(inputs.run_full_matrix_of_persistent_tests && '[8, 9, 10, 11]' || '[11]') }}
386391
arcticdb_version: ["oldest", "latest"]
387392
include:
388393
- python_deps_ids: [""]
@@ -401,7 +406,11 @@ jobs:
401406
post_verify_cleanup:
402407
needs: [persistent_storage_verify_windows, persistent_storage_verify_linux, storage_type]
403408
# This step is valid only for AWS_S3.
404-
if: ${{ needs.storage_type.outputs.storage == 'AWS_S3' }}
409+
if: |
410+
always() &&
411+
!failure() &&
412+
!cancelled() &&
413+
${{ needs.storage_type.outputs.storage == 'AWS_S3' }}
405414
name: Cleanup persistent storages
406415
uses: ./.github/workflows/persistent_storage.yml
407416
secrets: inherit
@@ -414,7 +423,7 @@ jobs:
414423
strategy:
415424
fail-fast: false
416425
matrix:
417-
python3: ${{fromJson(vars.MACOS_PYTHON_VERSIONS || '[8, 9, 10, 11, 12, 13]')}}
426+
python3: ${{ fromJson(vars.LINUX_PYTHON_VERSIONS || '[8, 9, 10, 11]') }}
418427
include:
419428
- python_deps_ids: [""]
420429
matrix_override: ${{fromJson(needs.common_config.outputs.macos_matrix)}}

.github/workflows/build_steps.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ on:
1313
pytest_xdist_mode: {default: "", type: string, description: additional argument to pass for pytest-xdist}
1414
pytest_args: {default: "", type: string, description: a way to rewrite the pytest args to change what tests are being run}
1515
version_cache_full_test: {default: false, type: boolean, description: if true - tests will run with both version cache 0 and 2000000000 otherwise only 2000000000}
16+
run_full_matrix_of_persistent_tests: {default: false, type: boolean, description: if true - persistent tests will run for all python versions else only for 12 }
1617
jobs:
1718
compile:
1819
strategy:
@@ -322,7 +323,7 @@ jobs:
322323
python_impl_name: ${{needs.compile.outputs.python_impl_name}}
323324
distinguishing_name: ${{matrix.os}}-${{needs.compile.outputs.python_impl_name}}-${{matrix.type}}${{matrix.python_deps_id}}-${{matrix.version_cache_timeout}}
324325
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
325-
real_tests_storage_type: ${{inputs.persistent_storage || 'no'}}
326+
real_tests_storage_type: ${{(inputs.run_full_matrix_of_persistent_tests || needs.compile.outputs.python_impl_name == 'cp311') && inputs.persistent_storage || 'no'}}
326327
steps:
327328
- name: Checkout
328329
uses: actions/[email protected]

0 commit comments

Comments
 (0)