forked from facebookresearch/faiss
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex-io-backward-compatibility.yml
More file actions
132 lines (114 loc) · 4.27 KB
/
index-io-backward-compatibility.yml
File metadata and controls
132 lines (114 loc) · 4.27 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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
name: Index serialization backward compatibility test
on:
workflow_call:
env:
OMP_NUM_THREADS: '10'
MKL_THREADING_LAYER: GNU
jobs:
# Scenario 1: CMake writes files, then Conda reads them
cmake-write-conda-read:
name: CMake Write -> Conda Read
runs-on: ubuntu-latest
env:
# run_id does not change if we re-run the job, so this is safe for
# the partway-failure-rerun scenario.
SHARED_DATA_DIR: /tmp/faiss-serialization-backward-compatibility-${{ github.run_id }}-cmake-write
steps:
- name: Checkout
uses: actions/checkout@v4
# Step 1: Build with CMake and write files
- name: Build with CMake
uses: ./.github/actions/build_cmake
with:
upload_artifacts: 'false'
- name: Create shared data directory
shell: bash
run: |
mkdir -p ${{ env.SHARED_DATA_DIR }}
chmod 777 ${{ env.SHARED_DATA_DIR }}
- name: Run CMake writer (write Faiss index and metadata)
shell: bash
run: |
eval "$(conda shell.bash hook)"
conda activate
$CONDA/bin/python tests/index_io_backward_compatibility/cmake_writer.py ${{ env.SHARED_DATA_DIR }}
- name: Verify files were written
shell: bash
run: |
echo "Files created by CMake build:"
ls -lh ${{ env.SHARED_DATA_DIR }}
# Step 2: Install conda faiss-cpu in a clean environment and read files
- name: Create conda read environment with faiss-cpu
shell: bash
run: |
eval "$(conda shell.bash hook)"
conda create -n faiss_conda_read -y python=3.12
conda activate faiss_conda_read
conda install -y -c pytorch -c conda-forge faiss-cpu=1.14.1
conda list
- name: Run Conda reader (read Faiss index and verify)
shell: bash
run: |
eval "$(conda shell.bash hook)"
conda activate faiss_conda_read
python tests/index_io_backward_compatibility/conda_reader.py ${{ env.SHARED_DATA_DIR }}
- name: Upload artifacts from cmake->conda test
if: always()
uses: actions/upload-artifact@v4
with:
name: cmake-write-conda-read-data
path: ${{ env.SHARED_DATA_DIR }}
# Scenario 2: Conda writes files, then CMake reads them
conda-write-cmake-read:
name: Conda Write -> CMake Read
runs-on: ubuntu-latest
env:
SHARED_DATA_DIR: /tmp/faiss-serialization-backward-compatibility-${{ github.run_id }}-conda-write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true
# Step 1: Install conda faiss-cpu in a clean environment and write files
- name: Create conda write environment with faiss-cpu
shell: bash
run: |
eval "$(conda shell.bash hook)"
conda create -n faiss_conda_write -y python=3.12
conda activate faiss_conda_write
conda install -y -c pytorch -c conda-forge faiss-cpu=1.14.1
conda list
- name: Create shared data directory
shell: bash
run: |
mkdir -p ${{ env.SHARED_DATA_DIR }}
chmod 777 ${{ env.SHARED_DATA_DIR }}
- name: Run Conda writer (write Faiss index and metadata)
shell: bash
run: |
eval "$(conda shell.bash hook)"
conda activate faiss_conda_write
python tests/index_io_backward_compatibility/conda_writer.py ${{ env.SHARED_DATA_DIR }}
- name: Verify files were written
shell: bash
run: |
echo "Files created by Conda build:"
ls -lh ${{ env.SHARED_DATA_DIR }}
# Step 2: Build with CMake and read files
- name: Build with CMake
uses: ./.github/actions/build_cmake
with:
upload_artifacts: 'false'
- name: Run CMake reader (read Faiss index and verify)
shell: bash
run: |
eval "$(conda shell.bash hook)"
conda activate
$CONDA/bin/python tests/index_io_backward_compatibility/cmake_reader.py ${{ env.SHARED_DATA_DIR }}
- name: Upload artifacts from conda->cmake test
if: always()
uses: actions/upload-artifact@v4
with:
name: conda-write-cmake-read-data
path: ${{ env.SHARED_DATA_DIR }}