forked from duckdb/duckdb
-
Notifications
You must be signed in to change notification settings - Fork 3
439 lines (391 loc) · 15.4 KB
/
Extensions.yml
File metadata and controls
439 lines (391 loc) · 15.4 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
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
#
# This workflow is responsible for building all DuckDB extensions
#
name: Extensions (all platforms)
on:
workflow_call:
inputs:
override_git_describe:
type: string
git_ref:
type: string
skip_tests:
type: string
run_all:
type: string
# disabling this can result in faster builds, but may run out of space on some runners
run_disk_clean_step:
type: boolean
required: false
default: true
opt_in_archs:
type: string
required: false
default: ''
workflow_dispatch:
inputs:
override_git_describe:
description: 'Version tag to override git describe. Use to produce binaries'
type: string
git_ref:
description: 'Set to override the DuckDB version, leave empty for current commit'
type: string
required: false
default: ''
extra_exclude_archs:
description: 'Inject more architectures to skip'
type: string
required: false
default: ''
opt_in_archs:
description: 'Semicolon-separated list of architectures to opt into'
type: string
required: false
default: 'windows_arm64;'
skip_tests:
description: 'Set to true to skip all testing'
type: boolean
required: false
default: false
run_all:
type: string
required: false
default: 'true'
run_disk_clean_step:
description: 'Disabling this can result in faster builds, but may run out of space on some runners'
type: boolean
required: false
default: true
push:
branches-ignore:
- 'main'
- 'feature'
- 'v*.*-*'
paths-ignore:
- '**.md'
- 'tools/**'
- '!tools/shell/**'
- '.github/patches/duckdb-wasm/**'
- '.github/workflows/**'
- '!.github/workflows/Extensions.yml'
- '!.github/workflows/_extension_distribution.yml'
merge_group:
pull_request:
types: [opened, reopened, ready_for_review, converted_to_draft]
paths-ignore:
- '**.md'
- 'tools/**'
- '!tools/shell/**'
- '.github/patches/duckdb-wasm/**'
- '.github/workflows/**'
- '!.github/workflows/Extensions.yml'
- '!.github/workflows/_extension_distribution.yml'
concurrency:
group: extensions-${{ github.workflow }}-${{ github.ref }}-${{ github.head_ref || '' }}-${{ github.base_ref || '' }}-${{ github.ref != 'refs/heads/main' || github.sha }}-${{ inputs.override_git_describe }}
cancel-in-progress: true
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
BRANCHES_TO_BE_CACHED: ${{ github.repository == 'duckdb/duckdb' && '["refs/heads/main", "refs/heads/v1.4-andium", "refs/heads/v1.5-variegata"]' || ''}}
jobs:
check-draft:
# We run all other jobs on PRs only if they are not draft PR
if: github.event_name != 'pull_request' || github.event.pull_request.draft == false
runs-on: ubuntu-24.04
steps:
- name: Preliminary checks on CI
run: echo "Event name is ${{ github.event_name }}"
vars:
runs-on: ubuntu-24.04
needs: check-draft
outputs:
BRANCHES_TO_BE_CACHED: ${{ env.BRANCHES_TO_BE_CACHED }}
steps:
- run: echo "Exposing env vars"
# This first step loads the various extension configs from the ~/.github/config directory storing them to drive the build jobs
load-extension-configs:
name: Load Extension Configs
runs-on: ubuntu-latest
needs: check-draft
outputs:
main_extensions_config: ${{ steps.set-main-extensions.outputs.extension_config }}
main_extensions_exclude_archs: ${{ steps.set-main-extensions.outputs.exclude_archs }}
main_extensions_opt_in_archs: ${{ steps.set-main-extensions.outputs.opt_in_archs }}
rust_based_extensions_config: ${{ steps.set-rust-based-extensions.outputs.extension_config }}
rust_based_extensions_exclude_archs: ${{ steps.set-rust-based-extensions.outputs.exclude_archs }}
external_extensions_config: ${{ steps.set-external-extensions.outputs.extension_config }}
external_extensions_exclude_archs: ${{ steps.set-external-extensions.outputs.exclude_archs }}
env:
# NOTE: on PRs we exclude some archs to speed things up
BASE_EXCLUDE_ARCHS: ${{ (github.event_name == 'pull_request' || inputs.run_all != 'true') && 'wasm_mvp;wasm_threads;windows_amd64_mingw;osx_amd64;osx_arm64;linux_arm64;linux_amd64_musl;' || '' }}
EXTRA_EXCLUDE_ARCHS: ${{ inputs.extra_exclude_archs }}
OPT_IN_ARCHS: ${{ inputs.opt_in_archs }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ inputs.git_ref }}
- id: set-main-extensions
name: Configure main extensions
env:
IN_TREE_CONFIG_FILE: .github/config/in_tree_extensions.cmake
OUT_OF_TREE_CONFIG_FILE: .github/config/out_of_tree_extensions.cmake
DEFAULT_EXCLUDE_ARCHS: ''
run: |
# Set config
echo exclude_archs="$DEFAULT_EXCLUDE_ARCHS;$BASE_EXCLUDE_ARCHS;$EXTRA_EXCLUDE_ARCHS" >> $GITHUB_OUTPUT
echo opt_in_archs="$OPT_IN_ARCHS" >> $GITHUB_OUTPUT
in_tree_extensions="`cat $IN_TREE_CONFIG_FILE`"
out_of_tree_extensions="`cat $OUT_OF_TREE_CONFIG_FILE`"
echo "extension_config<<EOF" >> $GITHUB_OUTPUT
echo "$in_tree_extensions" >> $GITHUB_OUTPUT
echo -e "\n" >> $GITHUB_OUTPUT
echo "$out_of_tree_extensions" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
cat $GITHUB_OUTPUT
- id: set-rust-based-extensions
name: Configure Rust-based extensions
env:
CONFIG_FILE: .github/config/rust_based_extensions.cmake
DEFAULT_EXCLUDE_ARCHS: 'wasm_mvp;wasm_eh;wasm_threads;windows_amd64_rtools;windows_amd64_mingw;linux_amd64_musl'
run: |
echo exclude_archs="$DEFAULT_EXCLUDE_ARCHS;$BASE_EXCLUDE_ARCHS;$EXTRA_EXCLUDE_ARCHS" >> $GITHUB_OUTPUT
rust_based_extensions="`cat .github/config/rust_based_extensions.cmake`"
echo "extension_config<<EOF" >> $GITHUB_OUTPUT
echo "$rust_based_extensions" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
cat $GITHUB_OUTPUT
- id: set-external-extensions
name: Configure External extensions
env:
CONFIG_FILE: .github/config/external_extensions.cmake
DEFAULT_EXCLUDE_ARCHS: 'wasm_mvp;wasm_eh;wasm_threads;windows_amd64_mingw;windows_amd64;linux_amd64_musl'
run: |
echo exclude_archs="$DEFAULT_EXCLUDE_ARCHS;$BASE_EXCLUDE_ARCHS;$EXTRA_EXCLUDE_ARCHS" >> $GITHUB_OUTPUT
external_extensions="`cat .github/config/external_extensions.cmake`"
echo "extension_config<<EOF" >> $GITHUB_OUTPUT
echo "$external_extensions" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
cat $GITHUB_OUTPUT
# Build the extensions from .github/config/in_tree_extensions.cmake
main-extensions:
name: Main Extensions
needs:
- load-extension-configs
- vars
uses: ./.github/workflows/_extension_distribution.yml
with:
artifact_prefix: main-extensions
exclude_archs: ${{ needs.load-extension-configs.outputs.main_extensions_exclude_archs }}
opt_in_archs: ${{ needs.load-extension-configs.outputs.main_extensions_opt_in_archs }}
extension_config: ${{ needs.load-extension-configs.outputs.main_extensions_config }}
extra_toolchains: 'unixodbc'
override_tag: ${{ inputs.override_git_describe }}
override_duckdb_version: ${{ inputs.git_ref }}
skip_tests: ${{ inputs.skip_tests == 'true' && true || false }}
save_cache: ${{ needs.vars.outputs.BRANCHES_TO_BE_CACHED == '' || contains(needs.vars.outputs.BRANCHES_TO_BE_CACHED, github.ref) }}
# Build the extensions from .github/config/rust_based_extensions.cmake
rust-based-extensions:
name: Rust-based Extensions
needs:
- load-extension-configs
- vars
uses: ./.github/workflows/_extension_distribution.yml
with:
exclude_archs: ${{ needs.load-extension-configs.outputs.rust_based_extensions_exclude_archs }}
artifact_prefix: rust-based-extensions
extension_config: ${{ needs.load-extension-configs.outputs.rust_based_extensions_config }}
extra_toolchains: 'rust'
override_tag: ${{ inputs.override_git_describe }}
override_duckdb_version: ${{ inputs.git_ref }}
skip_tests: ${{ inputs.skip_tests == 'true' && true || false }}
save_cache: ${{ needs.vars.outputs.BRANCHES_TO_BE_CACHED == '' || contains(needs.vars.outputs.BRANCHES_TO_BE_CACHED, github.ref) }}
# Build the extensions from .github/config/external_extensions.cmake
external-extensions:
name: External Extensions
needs:
- load-extension-configs
- vars
uses: ./.github/workflows/_extension_distribution.yml
with:
exclude_archs: ${{ needs.load-extension-configs.outputs.external_extensions_exclude_archs }}
artifact_prefix: external-extensions
extension_config: ${{ needs.load-extension-configs.outputs.external_extensions_config }}
extra_toolchains: 'rust'
override_tag: ${{ inputs.override_git_describe }}
override_duckdb_version: ${{ inputs.git_ref }}
skip_tests: ${{ inputs.skip_tests == 'true' && true || false }}
save_cache: ${{ needs.vars.outputs.BRANCHES_TO_BE_CACHED == '' || contains(needs.vars.outputs.BRANCHES_TO_BE_CACHED, github.ref) }}
# Merge all extensions into a single, versioned repository
create-extension-repository:
name: Create Extension Repository
runs-on: ubuntu-latest
needs:
- main-extensions
- rust-based-extensions
- external-extensions
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: ./.github/actions/cleanup_runner
- uses: actions/download-artifact@v4
name: Download main extensions
with:
pattern: main-extensions*
path: /tmp/repository_generation/main-extensions
- uses: actions/download-artifact@v4
name: Download rust-based extensions
with:
pattern: rust-based-extensions*
path: /tmp/repository_generation/rust-based-extensions
- uses: actions/download-artifact@v4
name: Download external extensions
with:
pattern: external-extensions*
path: /tmp/repository_generation/external-extensions
- name: Print all extensions
run: |
tree /tmp/repository_generation
- name: Merge into single repository
run: |
mkdir /tmp/merged_repository
cp -r /tmp/repository_generation/*/*/* /tmp/merged_repository
tree /tmp/merged_repository
- uses: actions/upload-artifact@v4
with:
if-no-files-found: error
name: extension-repository
path: |
/tmp/merged_repository/**/*.duckdb_extension*
upload-extensions:
name: Upload Extensions
runs-on: ubuntu-latest
needs:
- create-extension-repository
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: ./.github/actions/cleanup_runner
- uses: actions/download-artifact@v4
with:
pattern: extension-repository
path: /tmp
- name: List extensions to deploy
shell: bash
run: |
tree /tmp/extension-repository
- name: Deploy extensions
shell: bash
env:
AWS_ENDPOINT_URL: ${{ secrets.DUCKDB_CORE_EXTENSION_S3_ENDPOINT }}
AWS_ACCESS_KEY_ID: ${{secrets.DUCKDB_CORE_EXTENSION_S3_ID}}
AWS_SECRET_ACCESS_KEY: ${{secrets.DUCKDB_CORE_EXTENSION_S3_SECRET}}
DUCKDB_DEPLOY_SCRIPT_MODE: for_real
DUCKDB_EXTENSION_SIGNING_PK: ${{ secrets.DUCKDB_EXTENSION_SIGNING_PK }}
run: |
pip install awscli
./scripts/extension-upload-repository.sh /tmp/extension-repository
autoload-tests:
name: Extension Autoloading Tests
if: ${{ inputs.skip_tests != 'true' }}
runs-on: ubuntu-latest
needs: create-extension-repository
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ inputs.git_ref }}
- name: Setup Build Environment
run: |
sudo apt-get update -y -qq
sudo apt-get install -y -qq ninja-build ccache
- uses: ./.github/actions/ccache-action
- uses: actions/download-artifact@v4
with:
pattern: extension-repository
path: /tmp
- name: List extensions to test with
shell: bash
run: |
tree /tmp/extension-repository
- name: Build DuckDB
env:
GEN: ninja
CC: gcc
CXX: g++
EXTENSION_CONFIGS: './.github/config/rust_based_extensions.cmake;./.github/config/out_of_tree_extensions.cmake;./.github/config/in_tree_extensions.cmake'
EXTENSION_TESTS_ONLY: 1
ENABLE_EXTENSION_AUTOLOADING: 1
ENABLE_EXTENSION_AUTOINSTALL: 1
run: |
make release
- name: Run Tests
env:
LOCAL_EXTENSION_REPO: /tmp/extension-repository
run: |
./build/release/test/unittest --autoloading available --skip-compiled
check-load-install-extensions:
name: Checks extension entries
if: ${{ inputs.skip_tests != 'true' }}
runs-on: ubuntu-22.04
needs: create-extension-repository
env:
CC: gcc-10
CXX: g++-10
GEN: ninja
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ inputs.git_ref }}
- uses: actions/setup-python@v5
with:
python-version: '3.9'
- name: Install
shell: bash
run: sudo apt-get update -y -qq && sudo apt-get install -y -qq ninja-build
- uses: ./.github/actions/ccache-action
- name: Build
shell: bash
env:
GENERATE_EXTENSION_ENTRIES: 1
LOCAL_EXTENSION_REPO: build/release/repository_other
run: |
make
- uses: actions/download-artifact@v4
name: Download extension repository artifact
with:
pattern: extension-repository
path: /tmp
- name: Copy over local extension repository
shell: bash
run: |
cp -r /tmp/extension-repository build/release/repository
tree build/release/repository
find build/release/repository -type f ! -path "build/release/repository/*/linux_amd64/*" -delete
tree build/release/repository
- name: Check if extension_entries.hpp is up to date
shell: bash
env:
EXTENSION_CONFIGS: '.github/config/in_tree_extensions.cmake;.github/config/out_of_tree_extensions.cmake'
run: |
make extension_configuration
python scripts/generate_extensions_function.py
pip install "black>=24"
pip install cmake-format
pip install "clang_format==11.0.1"
make format-fix
- uses: actions/upload-artifact@v4
with:
name: extension_entries.hpp
path: |
src/include/duckdb/main/extension_entries.hpp
- name: Check for any difference
run: |
git diff --exit-code src/include/duckdb/main/extension_entries.hpp && echo "No differences found"
- name: Explainer
if: failure()
run: |
echo "There are differences in src/include/duckdb/main/extension_entries.hpp"
echo "Check the uploaded extension_entries.hpp (in the workflow Summary), and check that in instead of src/include/duckdb/main/extension_entries.hpp"