Repository navigation
107 lines (94 loc) · 3.34 KB
/
Copy pathazure_integration.yml
File metadata and controls
107 lines (94 loc) · 3.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
# Azure Blob connector integration test against the Azurite emulator.
#
# Runs the full write->read transaction of AzureConnector through the real
# azure-storage-blob async client against Azurite (a local Azure Blob emulator)
# started as a service container. No cloud account, credentials, or GPU needed,
# so this can gate every PR that touches the Azure connector.
name: Azure integration
on:
push:
branches:
- "main"
- "release-**"
paths:
- "lmcache/inprocess/v1/storage_backend/connector/azure_connector.py"
- "tests/inprocess/v1/storage_backend/test_azure_connector.py"
- "tests/inprocess/v1/storage_backend/test_azure_connector_azurite.py"
- ".github/workflows/azure_integration.yml"
pull_request:
branches:
- "main"
- "release-**"
paths:
- "lmcache/inprocess/v1/storage_backend/connector/azure_connector.py"
- "tests/inprocess/v1/storage_backend/test_azure_connector.py"
- "tests/inprocess/v1/storage_backend/test_azure_connector_azurite.py"
- ".github/workflows/azure_integration.yml"
workflow_dispatch:
defaults:
run:
shell: bash
# Cancel older in-flight runs on the same PR / branch.
concurrency:
group: azure-integration-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
azure-blob-azurite:
name: Azure connector (Azurite)
runs-on: ubuntu-24.04
timeout-minutes: 20
steps:
- name: Harden Runner
uses: step-security/harden-runner@20cf305ff2072d973412fa9b1e3a4f227bda3c76 # v2.14.0
with:
egress-policy: audit
- name: Checkout
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
fetch-depth: 0
- name: Setup Python 3.12
uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0
with:
python-version: "3.12"
cache: pip
cache-dependency-path: |
**/pyproject.toml
**/requirements/*.txt
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install torch --index-url https://download.pytorch.org/whl/cpu
python -m pip install -r requirements/test.txt
python -m pip install azure-storage-blob
NO_GPU_EXT=1 bash scripts/install_ci_dependencies.sh
- name: Start Azurite
run: |
docker run --detach --rm \
--name lmcache-azurite \
--publish 10000:10000 \
mcr.microsoft.com/azure-storage/azurite:latest \
azurite-blob \
--blobHost 0.0.0.0 \
--skipApiVersionCheck \
--disableTelemetry
- name: Wait for Azurite
run: |
for i in $(seq 1 30); do
if (echo > /dev/tcp/127.0.0.1/10000) 2>/dev/null; then
echo "Azurite is up"
exit 0
fi
echo "Waiting for Azurite ($i/30)"
sleep 1
done
echo "Azurite did not become reachable on 127.0.0.1:10000" >&2
exit 1
- name: Run Azure connector integration test
run: |
pytest -v --tb=short \
tests/inprocess/v1/storage_backend/test_azure_connector_azurite.py
- name: Stop Azurite
if: always()
run: docker rm --force lmcache-azurite