-
Notifications
You must be signed in to change notification settings - Fork 19
216 lines (203 loc) · 7.87 KB
/
build_template.yml
File metadata and controls
216 lines (203 loc) · 7.87 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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
name: Build Template
on:
workflow_call:
inputs:
arch:
required: false
type: string
default: x86_64
DISTR:
required: false
type: string
default: jammy
CTEST_CMAKE_GENERATOR:
required: false
type: string
default: Ninja
CTEST_CONFIGURATION_TYPE:
required: false
type: string
default: RelWithDebInfo
version:
required: false
type: string
default: ""
package_version:
required: false
type: string
default: ""
rpm_package_version:
required: false
type: string
default: ""
cmake_command:
required: false
type: string
default: "ctest -VV -S cmake/citest.cmake --no-compress-output"
cache_key:
required: false
type: string
default: build_linux_x86_64
boost:
required: false
type: string
default: boost_nov22
embeddings_artifact:
required: true
type: string
artifact_list:
required: false
type: string
default: "build/columnar/lib_manticore_columnar_avx2.so build/columnar/lib_manticore_columnar_avx512.so build/columnar/lib_manticore_columnar.so build/secondary/lib_manticore_secondary_avx2.so build/secondary/lib_manticore_secondary_avx512.so build/secondary/lib_manticore_secondary.so build/knn/lib_manticore_knn.so build/knn/lib_manticore_knn_avx2.so build/knn/lib_manticore_knn_avx512.so build/_deps/manticore-build/src/searchd build/_deps/manticore-build/src/indexer build/_deps/manticore-build/src/indextool build/_deps/manticore-build/config/*.c build/_deps/manticore-build/config/*.h"
HOMEBREW_PREFIX:
required: false
type: string
default: ""
MANTICORE_LOCATOR:
required: false
type: string
default: ""
skip_avx2_move:
required: false
type: boolean
default: false
artifact_name:
required: false
type: string
default: ""
jobs:
build:
runs-on: ubuntu-22.04
defaults:
run:
shell: bash
timeout-minutes: 30
container:
image: manticoresearch/external_toolchain:clang16_cmake3263
env:
CACHEB: "../cache"
VERBOSE: 1
DIAGNOSTIC: 1
NO_TESTS: 1
DISTR: ${{ inputs.DISTR }}
boost: ${{ inputs.boost }}
sysroot: roots_nov22
arch: ${{ inputs.arch }}
CTEST_CMAKE_GENERATOR: ${{ inputs.CTEST_CMAKE_GENERATOR }}
CTEST_CONFIGURATION_TYPE: ${{ inputs.CTEST_CONFIGURATION_TYPE }}
SYSROOT_URL: https://repo.manticoresearch.com/repository/sysroots
HOMEBREW_PREFIX: ${{ inputs.HOMEBREW_PREFIX }}
MANTICORE_LOCATOR: ${{ inputs.MANTICORE_LOCATOR }}
PACKAGE_VERSION: ${{ inputs.package_version }}
RPM_PACKAGE_VERSION: ${{ inputs.rpm_package_version }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
set-safe-directory: true
- name: Print Manticore Locator
run: |
echo "Using MANTICORE_LOCATOR: '${{ inputs.MANTICORE_LOCATOR }}'"
if [[ -n "${{ inputs.MANTICORE_LOCATOR }}" ]]; then
echo "Manticore locator is set and will be used for building"
else
echo "Manticore locator is empty, using default manticore sources"
fi
- name: Determine branch name for cache
id: branch
run: |
if [ "${{ github.event_name }}" = "pull_request" ]; then
echo "branch_name=${{ github.head_ref }}" >> $GITHUB_OUTPUT
else
echo "branch_name=${{ github.ref_name }}" >> $GITHUB_OUTPUT
fi
- name: Patch version
if: inputs.version != ''
run: |
sed -i "s/0\.0\.0/${{ inputs.version }}/g" CMakeLists.txt
cat CMakeLists.txt
- name: Download embeddings lib
uses: manticoresoftware/download_artifact_with_retries@v3
continue-on-error: true
with:
name: ${{ inputs.embeddings_artifact }}
path: ./embeddings-lib/
- name: Initialization
run: | # without adding the safe.directory cmake fails to do git log -1 --date=short --format=%cd
bash /sysroot/root/entry_point.sh
git config --global --add safe.directory /__w/columnar/columnar
mkdir -p embeddings/target/release
mv ./embeddings-lib/build/* embeddings/target/release/
rm -fr ./embeddings-lib
- name: Check out main cache before building
uses: actions/cache@v4
with:
path: cache
enableCrossOsArchive: true
key: ${{ inputs.cache_key }}_${{ steps.branch.outputs.branch_name }}
restore-keys: |
${{ inputs.cache_key }}_master
- name: Check out deps cache before building
uses: actions/cache@v4
with:
path: build/_deps/cache
enableCrossOsArchive: true
key: ${{ inputs.cache_key }}_deps_${{ steps.branch.outputs.branch_name }}
restore-keys: |
${{ inputs.cache_key }}_deps_master
- name: 🚀 Build
run: ${{ inputs.cmake_command }}
- name: Move AVX2/AVX-512-optimized libraries
if: success() && inputs.skip_avx2_move != true
run: |
if [ -d build/avx2/share/manticore/modules ]; then
echo "Move linux based AVX2 libs"
mv build/avx2/share/manticore/modules/lib_manticore_columnar_avx2.so build/columnar/
mv build/avx2/share/manticore/modules/lib_manticore_secondary_avx2.so build/secondary/
mv build/avx2/share/manticore/modules/lib_manticore_knn_avx2.so build/knn/
ls build/columnar/
ls build/secondary/
ls build/knn/
fi
if [ -d build/avx512/share/manticore/modules ]; then
echo "Move linux based AVX-512 libs"
mv build/avx512/share/manticore/modules/lib_manticore_columnar_avx512.so build/columnar/
mv build/avx512/share/manticore/modules/lib_manticore_secondary_avx512.so build/secondary/
mv build/avx512/share/manticore/modules/lib_manticore_knn_avx512.so build/knn/
ls build/columnar/
ls build/secondary/
ls build/knn/
fi
if [ -d build/avx2/share/modules ]; then
echo "Move windows based AVX2 libs"
mv build/avx2/share/modules/lib_manticore_columnar_avx2.dll build/columnar/Debug/
mv build/avx2/share/modules/lib_manticore_secondary_avx2.dll build/secondary/Debug/
mv build/avx2/share/modules/lib_manticore_knn_avx2.dll build/knn/Debug/
ls build/columnar/Debug/
ls build/secondary/Debug/
ls build/knn/Debug/
fi
if [ -d build/avx512/share/modules ]; then
echo "Move windows based AVX-512 libs"
mv build/avx512/share/modules/lib_manticore_columnar_avx512.dll build/columnar/Debug/
mv build/avx512/share/modules/lib_manticore_secondary_avx512.dll build/secondary/Debug/
mv build/avx512/share/modules/lib_manticore_knn_avx512.dll build/knn/Debug/
ls build/columnar/Debug/
ls build/secondary/Debug/
ls build/knn/Debug/
fi
- name: Set artifact name
id: artifact_name
run: |
if [ -n "${{ inputs.artifact_name }}" ]; then
echo "name=${{ inputs.artifact_name }}" >> $GITHUB_OUTPUT
else
echo "name=build_${{ inputs.DISTR }}_${{ inputs.CTEST_CONFIGURATION_TYPE }}_${{ inputs.arch }}" >> $GITHUB_OUTPUT
fi
- name: Upload build artifacts
if: success()
uses: manticoresoftware/upload_artifact_with_retries@v4
with:
name: ${{ steps.artifact_name.outputs.name }}
path: ${{ inputs.artifact_list }}