Skip to content

Commit bf839b5

Browse files
authored
Azure tests added (#2498)
#### Reference Issues/PRs <!--Example: Fixes #1234. See also #3456.--> #### What does this implement or fix? Storage test execution against Azure blob storage for tests along with github workflow changes to support that in github with persistance test executions Environment variables needed to execute azure storage tests locally: ``` export ARCTICDB_REAL_AZURE_CONTAINER=.... export ARCTICDB_REAL_AZURE_CONNECTION_STRING=.... export ARCTICDB_STORAGE_AZURE=1 ``` **Additionally**: 1. there is support for ASV real storage test on Azure + log sanitization for AccountKey NOTE: The ASV tests cannot work under this PR due to the change introducing common logging.py for all tests. This is run from a build with merged PR (in my fork) https://github.com/grusev/ArcticDB/actions/runs/16874994643/job/47797467959 2. Installation tests now can run with Azure also **Other framework enhancements**: 1. Logging is now centralized in arcticdb\util\logger.py is the central logging utility. It contains sanitization code for secrets. Previously 2 loggers existed for ASV and functional tests. Now they are combined into one. Note that logger.py also exists in installation_tests. This is required due to the fact that this package although locally inside python folder is a package of its own and cannot use any of standard libs from arcticdb in order to not depend on any version, it is created to support ALL released versions. 2. As you will see in the logs below currently there is a MacOS related problem that affect significant number of tests. In order not to clutter code with many xfail statements there is a central code at conftest.py (again replicated twice for installation_tests also) that will XFAIL automatically all MacOs tests that experience that error. Imprtant note: this mechanism can be enhanced further to get rid potentially of all xfail statements and centralize xfailing in one file. That needs to be discussed first before accepted as it has both benefits and drawbacks. The case where we have massive failures like this one where benefits are much more than the drawbacks and therefore it perhaps should be the default option to go for in future. **Workflow enhancements**: - 'Build with conda' - ability to debug, ability to enable debug logging, custom commands execution. Azure tests can now work by passing ARCTICDB params for the test, a kind of backdoor) - "Installation tests" - same (Azure tests now can work fluently by selecting them) Both enhancement make possible to run Azure tests with those workflows makes possible logging debug information when needed and connect to git executor on demand. With those enhancements we now get enhanced ability to run and debug issues on Linux, Windows, MacOS using either builds from the top of branch as well as arcticdb install packages from conda and pypi **Build and Test**: https://github.com/man-group/ArcticDB/actions/runs/16614944930/job/47006507855 Windows is ok. Linux is having problems perhaps due to different image Working tests on Linux and Windows: https://github.com/man-group/ArcticDB/actions/runs/16621045959/job/47026145204 (reduced to Python 3.12 tests only) Full run : https://github.com/man-group/ArcticDB/actions/runs/16623323259/job/47033988304 One test failed due to error that needs to be investigated more closely, but the error is exatly same as the one with MacOS **Installation Tests**: https://github.com/man-group/ArcticDB/actions/runs/16588682801/job/46919014211 The tests work on Azure with Linux. There is problem with MacOs. Some tests fail due to bug most probably (to be logged) **Build with Conda** tets (running Azure tests): https://github.com/man-group/ArcticDB/actions/runs/16595281766/job/46940289302 The linux tests pass, while MacOS are full with errors of same type as previous: ``` ___ ERROR at setup of test_batch_methods_with_negative_as_of[real_azure-0] ____ [gw2] darwin -- Python 3.13.5 /Users/runner/micromamba/envs/arcticdb/bin/python arctic_client = Arctic(config=azure(endpoint=DefaultEndpointsProtocol=https;AccountName=arcticdbgithub;AccountKey=...;EndpointSuffix=core.windows.net, container=githubblob)) lib_name = 'test_batch_methods_with_negati.19784_8719781760_2025-07-29T12_11_50__56d7de65-510c-4134-9e1f-3eaf2ff19759' @pytest.fixture def arctic_library(arctic_client, lib_name) -> Generator[Library, None, None]: > yield arctic_client.create_library(lib_name) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ tests/conftest.py:628: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ arcticdb/arctic.py:205: in create_library if self.has_library(name): ^^^^^^^^^^^^^^^^^^^^^^ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = Arctic(config=azure(endpoint=DefaultEndpointsProtocol=https;AccountName=arcticdbgithub;AccountKey=...;EndpointSuffix=core.windows.net, container=githubblob)) name = 'test_batch_methods_with_negati.19784_8719781760_2025-07-29T12_11_50__56d7de65-510c-4134-9e1f-3eaf2ff19759' def has_library(self, name: str) -> bool: """ Query if the given library exists Parameters ---------- name: str Name of the library to check the existence of. Returns ------- True if the library exists, False otherwise. """ > return self._library_manager.has_library(self._library_adapter.get_name_for_library_manager(name)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ E arcticdb_ext.exceptions.InternalException: Azure::Storage::StorageException(404 The specified blob does not exist. E E Request ID: 5d961a76-e01e-005f-5e81-005af8000000) arcticdb/arctic.py:254: InternalException ``` #### 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 --> --------- Co-authored-by: Georgi Rusev <Georgi Rusev>
1 parent 506b336 commit bf839b5

39 files changed

+987
-340
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: 'Enable ArcticDB Debug Logging'
2+
description: 'Set the necessary variables for finer logging on all storage types'
3+
runs:
4+
using: "composite"
5+
steps:
6+
# add a step to run locally define python script
7+
- name: Enable ArcticDB Debug Logging
8+
shell: bash
9+
run: |
10+
# Enable all debug logs
11+
echo "ARCTICDB_all_loglevel=debug" >> $GITHUB_ENV
12+
echo "ARCTICDB_AWS_LogLevel_int=6" >> $GITHUB_ENV
13+
echo "AZURE_LOG_LEVEL=1" >> $GITHUB_ENV

.github/actions/set_persistent_storage_env_vars/action.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@ runs:
2323

2424
run: |
2525
# Common
26-
echo "ARCTICDB_PERSISTENT_STORAGE_TESTS=1" >> $GITHUB_ENV
26+
if [[ "${{inputs.persistent_storage}}" != "no" ]]; then
27+
echo "ARCTICDB_PERSISTENT_STORAGE_TESTS=1" >> $GITHUB_ENV
28+
fi
2729
echo "ARCTICDB_PERSISTENT_STORAGE_UNIQUE_ID=${{ github.ref_name }}_${{ github.run_id }}" >> $GITHUB_ENV
2830
echo "ARCTICDB_PERSISTENT_STORAGE_STRATEGY_BRANCH=${{ inputs.strategy_branch }}" >> $GITHUB_ENV
2931
# This is the top level path for all test, this is where to write data that should be shared between jobs (e.g. seed job)

.github/workflows/build.yml

Lines changed: 42 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ on:
1919
- 'no'
2020
- 'AWS_S3'
2121
- 'GCPXML'
22+
- 'AZURE'
2223
default: 'no'
2324

2425
pypi_publish:
@@ -34,20 +35,25 @@ on:
3435
description: Tag of the ArcticDB development image to use for the Linux C++ tests build
3536
type: string
3637
default: arcticdb-dev-clang:latest
37-
pytest_args:
38-
description: Rewrite what tests will run or do your own pytest line if string starts with pytest ... (Example -- pytest -n auto -v --count=50 -x python/tests/compat)
39-
type: string
40-
default: ""
41-
version_cache_full_test:
42-
description: 'Run tests with both version cache 0 and 2000000000'
38+
macos_enabled:
39+
description: Enable macOS tests
4340
required: false
4441
default: false
4542
type: boolean
46-
macos_enabled:
47-
description: Enable macOS tests
43+
version_cache_full_test:
44+
description: 'Run tests with both version cache 0 and 2000000000'
4845
required: false
4946
default: false
5047
type: boolean
48+
flags:
49+
type: string
50+
description: 'Enable debug logging or debug by setting respective value to 1'
51+
required: true
52+
default: "DEBUG_LOGGING=0;DEBUG=0"
53+
pytest_args:
54+
description: Rewrite what tests will run or do your own pytest line if string starts with pytest ... (Example -- pytest -n auto -v --count=50 -x python/tests/compat)
55+
type: string
56+
default: ""
5157
run_full_matrix_of_persistent_tests:
5258
description: Run full matrix of persistent tests
5359
required: false
@@ -66,6 +72,8 @@ jobs:
6672
INPUT_STORAGE: ${{ inputs.persistent_storage }}
6773
outputs:
6874
storage: ${{ steps.set-storage.outputs.storage }}
75+
DEBUG_LOGGING_ENABLED: ${{ steps.parse-flags.outputs.DEBUG_LOGGING_ENABLED }}
76+
DEBUG_ENABLED: ${{ steps.parse-flags.outputs.DEBUG_ENABLED }}
6977
steps:
7078
- name: Determine Storage Type Based On Schedule
7179
id: set-storage
@@ -78,6 +86,8 @@ jobs:
7886
_storage='AWS_S3'
7987
elif [[ "$day" == "Mon" || "$day" == "Wed" ]]; then
8088
_storage='GCPXML'
89+
elif [[ "$day" == "Fri" ]]; then
90+
_storage='AZURE'
8191
else
8292
echo "UNSPECIFIED RESULT for this day (assumed LMDB)"
8393
_storage='no'
@@ -99,6 +109,21 @@ jobs:
99109
echo "Final storage type for workflow execution: $_storage"
100110
echo "storage=$_storage" >> $GITHUB_OUTPUT
101111
112+
- name: Parse flags
113+
id: parse-flags
114+
run: |
115+
declare -A FLAGS
116+
IFS=';' read -ra PAIRS <<< "${{ inputs.flags }}"
117+
for pair in "${PAIRS[@]}"; do
118+
key="${pair%%=*}"
119+
value="${pair##*=}"
120+
# Trim leading/trailing whitespace
121+
value="$(echo "$value" | xargs)"
122+
echo "$key=$value"
123+
# Format of flags will be as defined below
124+
echo "${key}_ENABLED=$value" >> $GITHUB_OUTPUT
125+
done
126+
102127
cibw_docker_image:
103128
uses: ./.github/workflows/cibw_docker_image.yml
104129
permissions: {packages: write}
@@ -307,6 +332,9 @@ jobs:
307332
pytest_xdist_mode: ${{matrix.pytest_xdist_mode}}
308333
pytest_args: ${{inputs.pytest_args || ''}}
309334
version_cache_full_test: ${{inputs.version_cache_full_test || false}}
335+
DEBUG_ENABLED: ${{ needs.storage_type.outputs.DEBUG_ENABLED }}
336+
DEBUG_LOGGING_ENABLED: ${{ needs.storage_type.outputs.DEBUG_LOGGING_ENABLED }}
337+
310338

311339
cpp-test-windows:
312340
needs: [common_config]
@@ -355,6 +383,8 @@ jobs:
355383
pytest_xdist_mode: "-n logical --dist worksteal"
356384
pytest_args: ${{inputs.pytest_args || ''}}
357385
version_cache_full_test: ${{github.event_name == 'schedule' || inputs.version_cache_full_test || false}}
386+
DEBUG_ENABLED: ${{ needs.storage_type.outputs.DEBUG_ENABLED }}
387+
DEBUG_LOGGING_ENABLED: ${{ needs.storage_type.outputs.DEBUG_LOGGING_ENABLED }}
358388

359389
persistent_storage_verify_linux:
360390
needs: [common_config, build-python-wheels-linux, build-python-wheels-windows]
@@ -418,7 +448,7 @@ jobs:
418448
job_type: cleanup
419449

420450
build-python-wheels-macos:
421-
needs: [common_config]
451+
needs: [common_config, storage_type]
422452
if: ${{ inputs.macos_enabled }}
423453
strategy:
424454
fail-fast: false
@@ -439,9 +469,11 @@ jobs:
439469
cmake_preset_type: ${{needs.common_config.outputs.cmake_preset_type_resolved}}
440470
matrix: ${{toJson(matrix.matrix_override)}}
441471
python_deps_ids: ${{toJson(matrix.python_deps_ids)}}
442-
persistent_storage: ${{ inputs.persistent_storage }}
472+
persistent_storage: ${{ needs.storage_type.outputs.storage }}
443473
pytest_xdist_mode: ${{matrix.pytest_xdist_mode}}
444474
pytest_args: ${{inputs.pytest_args}}
475+
DEBUG_ENABLED: ${{ needs.storage_type.outputs.DEBUG_ENABLED }}
476+
DEBUG_LOGGING_ENABLED: ${{ needs.storage_type.outputs.DEBUG_LOGGING_ENABLED }}
445477

446478
can_merge:
447479
needs: [cpp-test-linux, cpp-test-windows, cpp-test-macos, build-python-wheels-linux, build-python-wheels-windows, build-python-wheels-macos, persistent_storage_verify_linux, persistent_storage_verify_windows]

.github/workflows/build_steps.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ on:
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}
1616
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 }
17+
DEBUG_LOGGING_ENABLED: {default: "0", type: string, required: false, description: 'Enable debug logging "1" (disabled "0")'}
18+
DEBUG_ENABLED: {default: "0", type: string, required: false, description: 'Enable debug logging "1" (disabled "0")'}
1719
jobs:
1820
compile:
1921
strategy:
@@ -419,8 +421,19 @@ jobs:
419421
aws_access_key: "${{ secrets.AWS_S3_ACCESS_KEY }}"
420422
aws_secret_key: "${{ secrets.AWS_S3_SECRET_KEY }}"
421423

424+
- name: Setup tmate session
425+
uses: mxschmitt/action-tmate@v3
426+
if: ${{ inputs.DEBUG_ENABLED == '1' }}
427+
428+
- name: Set ArcticDB Debug Logging
429+
if: ${{ inputs.DEBUG_LOGGING_ENABLED == '1' }}
430+
uses: ./.github/actions/enable_logging
431+
422432
- name: Run test
423433
run: |
434+
# find ssl directory where cacerts are (for Azure)
435+
openssl version -d
436+
# list file descriptors and other limits of the runner
424437
ulimit -a
425438
export ARCTICDB_WARN_ON_WRITING_EMPTY_DATAFRAME=0
426439
if [[ "$(echo "$ARCTICDB_PYTEST_ARGS" | xargs)" == pytest* ]]; then
@@ -438,6 +451,7 @@ jobs:
438451
HYPOTHESIS_PROFILE: ci_${{matrix.os}}
439452
PYTEST_XDIST_MODE: ${{inputs.pytest_xdist_mode}}
440453
ARCTICDB_PYTEST_ARGS: ${{inputs.pytest_args}}
454+
STORAGE_TYPE: ${{ env.real_tests_storage_type }}
441455
# Testing with 0(no version cache) and -1(will use default timeout)
442456
VERSION_MAP_RELOAD_INTERVAL: ${{matrix.version_cache_timeout == 'NoCache' && 0 || -1}}
443457

.github/workflows/build_with_conda.yml

Lines changed: 72 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,32 @@ on:
2222
type: boolean
2323
required: true
2424
default: true
25+
persistent_storage:
26+
description: "Run against what persistent storage type? (no is LMDB/default)"
27+
type: choice
28+
options:
29+
- 'no'
30+
- 'AWS_S3'
31+
- 'GCPXML'
32+
- 'AZURE'
33+
default: 'no'
34+
debug_enabled:
35+
type: boolean
36+
description: 'Run the build with debugging enabled'
37+
required: false
38+
default: false
39+
run_enable_logging:
40+
description: 'Enabled debug logging'
41+
type: boolean
42+
required: false
43+
default: false
44+
run_commandline:
45+
description: 'Run custom commandline before tests, Like: export ARCTICDB_STORAGE_AZURE=1; ....'
46+
type: string
47+
required: false
48+
default: ""
2549
run_custom_pytest_command:
26-
description: 'Run custom pytest command (curdir is project root). Or pass additional arguments to default command'
50+
description: '*Run custom pytest command, instead of standard(Note: curdir is project root), or pass additional arguments to default command'
2751
type: string
2852
required: false
2953
default: ""
@@ -107,11 +131,34 @@ jobs:
107131
- name: Check no arcticdb file depend on tests package
108132
shell: bash -l {0}
109133
run: |
110-
build_tooling/checks.sh
134+
build_tooling/checks.sh
135+
136+
- name: Set persistent storage variables
137+
# Should be executed for all persistent storages but not for LMDB
138+
if: ${{ env.real_tests_storage_type != 'no' }}
139+
uses: ./.github/actions/set_persistent_storage_env_vars
140+
with:
141+
aws_access_key: "${{ secrets.AWS_S3_ACCESS_KEY }}"
142+
aws_secret_key: "${{ secrets.AWS_S3_SECRET_KEY }}"
143+
gcp_access_key: "${{ secrets.GCP_S3_ACCESS_KEY }}"
144+
gcp_secret_key: "${{ secrets.GCP_S3_SECRET_KEY }}"
145+
azure_container: "githubblob" # DEFAULT BUCKET FOR AZURE
146+
azure_connection_string: "${{ secrets.AZURE_CONNECTION_STRING }}"
147+
persistent_storage: ${{ inputs.persistent_storage }}
148+
149+
- name: Set ArcticDB Debug Logging
150+
if: ${{ inputs.run_enable_logging }}
151+
uses: ./.github/actions/enable_logging
152+
153+
- name: Setup tmate session
154+
uses: mxschmitt/action-tmate@v3
155+
if: ${{ inputs.debug_enabled }}
111156

112157
- name: Test with pytest
113158
shell: bash -l {0}
114159
run: |
160+
echo "Run commandline: $COMMANDLINE"
161+
eval "$COMMANDLINE"
115162
export ARCTICDB_RAND_SEED=$RANDOM
116163
export ARCTICDB_WARN_ON_WRITING_EMPTY_DATAFRAME=0
117164
if [[ "$(echo "$ARCTICDB_PYTEST_ARGS" | xargs)" == *pytest* ]]; then
@@ -125,6 +172,7 @@ jobs:
125172
fi
126173
env:
127174
ARCTICDB_USING_CONDA: 1
175+
COMMANDLINE: ${{ inputs.run_commandline }}
128176
# Use the Mongo created in the service container above to test against
129177
CI_MONGO_HOST: mongodb
130178
ARCTICDB_PYTEST_ARGS: ${{ inputs.run_custom_pytest_command }}
@@ -191,9 +239,30 @@ jobs:
191239
run: |
192240
npm install -g azurite
193241
242+
- name: Set persistent storage variables
243+
uses: ./.github/actions/set_persistent_storage_env_vars
244+
with:
245+
aws_access_key: "${{ secrets.AWS_S3_ACCESS_KEY }}"
246+
aws_secret_key: "${{ secrets.AWS_S3_SECRET_KEY }}"
247+
gcp_access_key: "${{ secrets.GCP_S3_ACCESS_KEY }}"
248+
gcp_secret_key: "${{ secrets.GCP_S3_SECRET_KEY }}"
249+
azure_container: "githubblob" # DEFAULT BUCKET FOR AZURE
250+
azure_connection_string: "${{ secrets.AZURE_CONNECTION_STRING }}"
251+
persistent_storage: ${{ inputs.persistent_storage }}
252+
253+
- name: Set ArcticDB Debug Logging
254+
if: ${{ inputs.run_enable_logging }}
255+
uses: ./.github/actions/enable_logging
256+
257+
- name: Setup tmate session
258+
uses: mxschmitt/action-tmate@v3
259+
if: ${{ inputs.debug_enabled }}
260+
194261
- name: Test with pytest
195262
shell: bash -l {0}
196263
run: |
264+
echo "Run commandline: $COMMANDLINE"
265+
eval "$COMMANDLINE"
197266
export ARCTICDB_RAND_SEED=$RANDOM
198267
export ARCTICDB_WARN_ON_WRITING_EMPTY_DATAFRAME=0
199268
if [[ "$(echo "$ARCTICDB_PYTEST_ARGS" | xargs)" == pytest* ]]; then
@@ -208,5 +277,6 @@ jobs:
208277
fi
209278
env:
210279
ARCTICDB_USING_CONDA: 1
280+
COMMANDLINE: ${{ inputs.run_commandline }}
211281
ARCTICDB_PYTEST_ARGS: ${{ inputs.run_custom_pytest_command }}
212282

0 commit comments

Comments
 (0)