Skip to content

Commit 25c73af

Browse files
committed
Merge branch 'main' into open-sharing
2 parents 92912d2 + 4533c87 commit 25c73af

File tree

324 files changed

+5677
-2708
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

324 files changed

+5677
-2708
lines changed

.github/actions/artifact_upload/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ runs:
3434
3535
- name: Upload artifact to github
3636
if: steps.info.outputs.src == 'github'
37-
uses: actions/upload-artifact@v2
37+
uses: actions/upload-artifact@v3
3838
with:
3939
name: ${{ inputs.profile }}-${{ inputs.sha }}-${{ inputs.target }}-${{ inputs.category }}
4040
path: ./target/${{ inputs.target }}/${{ inputs.profile }}/databend-*

.github/actions/build_linux/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ runs:
1414
uses: ./.github/actions/setup_build_tool
1515
with:
1616
image: ${{ inputs.target }}
17-
bypass_env_vars: RUSTFLAGS,RUST_LOG,RUSTC_WRAPPER,SCCACHE_BUCKET,SCCACHE_S3_KEY_PREFIX,SCCACHE_S3_USE_SSL,AWS_DEFAULT_REGION,AWS_REGION,AWS_ROLE_ARN,AWS_STS_REGIONAL_ENDPOINTS,AWS_WEB_IDENTITY_TOKEN_FILE
17+
bypass_env_vars: RUSTFLAGS,RUST_LOG,RUSTC_WRAPPER,SCCACHE_BUCKET,SCCACHE_S3_KEY_PREFIX,SCCACHE_S3_USE_SSL,AWS_DEFAULT_REGION,AWS_REGION,AWS_ROLE_ARN,AWS_STS_REGIONAL_ENDPOINTS,AWS_WEB_IDENTITY_TOKEN_FILE,je_cv_pthread_getname_np
1818

1919
- name: Build Debug
2020
if: inputs.profile == 'debug'
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: "${name}"
2+
arch: "amd64"
3+
platform: "linux"
4+
version: "${version}"
5+
section: "database"
6+
priority: "extra"
7+
maintainer: "Databend Authors <opensource@datafuselabs.com>"
8+
description: |
9+
Databend is a powerful cloud data warehouse. Built for elasticity and efficiency.
10+
Free and open. Also available in the cloud: https://app.databend.com
11+
vendor: "Datafuse Labs"
12+
homepage: "https://databend.rs"
13+
license: "Apache-2.0"
14+
contents:
15+
# Binaries
16+
- src: ${path}/bin/databend-query
17+
dst: /usr/bin/databend-query
18+
- src: ${path}/bin/databend-meta
19+
dst: /usr/bin/databend-meta
20+
- src: ${path}/bin/databend-metactl
21+
dst: /usr/bin/databend-metactl
22+
- src: ${path}/bin/databend-metabench
23+
dst: /usr/bin/databend-metabench
24+
25+
# Configs
26+
- src: ${path}/configs/databend-query.toml
27+
dst: /etc/databend/databend-query.toml
28+
type: config
29+
- src: ${path}/configs/databend-meta.toml
30+
dst: /etc/databend/databend-meta.toml
31+
type: config
32+
33+
# Docs
34+
- src: ${path}/readme.txt
35+
dst: /usr/share/doc/databend/readme.txt
36+
file_info:
37+
mode: 0644

.github/workflows/databend-release.yml

Lines changed: 126 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ jobs:
128128
version=${{ needs.create_release.outputs.version }}
129129
sha256sum databend-${version}-${target}.tar.gz >> sha256-${version}-${target}.txt
130130
- name: post sha256
131-
uses: actions/upload-artifact@v2
131+
uses: actions/upload-artifact@v3
132132
with:
133133
name: sha256sums
134134
path: sha256-${{ needs.create_release.outputs.version }}-${{ steps.target.outputs.target }}.txt
@@ -202,7 +202,7 @@ jobs:
202202
version=${{ needs.create_release.outputs.version }}
203203
sha256sum databend-${version}-${target}.tar.gz >> sha256-${version}-${target}.txt
204204
- name: post sha256
205-
uses: actions/upload-artifact@v2
205+
uses: actions/upload-artifact@v3
206206
with:
207207
name: sha256sums
208208
path: sha256-${{ needs.create_release.outputs.version }}-${{ steps.target.outputs.target }}.txt
@@ -215,6 +215,73 @@ jobs:
215215
target: ${{ steps.target.outputs.target }}
216216
repo_role_arn: ${{ secrets.REPO_ROLE_ARN }}
217217

218+
publish_hive:
219+
name: hive assets
220+
runs-on: [self-hosted, X64, Linux, development]
221+
needs: [create_release]
222+
strategy:
223+
fail-fast: false
224+
matrix:
225+
arch:
226+
- x86_64
227+
platform:
228+
- gnu
229+
steps:
230+
- name: Checkout
231+
uses: actions/checkout@v3
232+
with:
233+
fetch-depth: 0
234+
- name: Get the version
235+
id: get_version
236+
run: echo "VERSION=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_OUTPUT
237+
- name: Get target
238+
id: target
239+
run: echo 'target=${{ matrix.arch }}-unknown-linux-${{ matrix.platform }}' >> $GITHUB_OUTPUT
240+
- name: Setup Build Tool
241+
uses: ./.github/actions/setup_build_tool
242+
with:
243+
image: ${{ steps.target.outputs.target }}
244+
- name: Build Binary
245+
run: |
246+
cargo build --release --target=${{ steps.target.outputs.target }} --features hive
247+
- name: Copyobj zlib for gnu binaries
248+
if: matrix.platform == 'gnu'
249+
run: |
250+
target=${{ steps.target.outputs.target }}
251+
build-tool /usr/bin/${{ matrix.arch }}-linux-gnu-objcopy --compress-debug-sections=zlib-gnu ./target/${target}/release/databend-query
252+
build-tool /usr/bin/${{ matrix.arch }}-linux-gnu-objcopy --compress-debug-sections=zlib-gnu ./target/${target}/release/databend-meta
253+
build-tool /usr/bin/${{ matrix.arch }}-linux-gnu-objcopy --compress-debug-sections=zlib-gnu ./target/${target}/release/databend-metactl
254+
- name: Pack binaries
255+
run: |
256+
target=${{ steps.target.outputs.target }}
257+
version=${{ needs.create_release.outputs.version }}
258+
mkdir -p release/${target}/{bin,configs}
259+
cp ./target/${target}/release/databend-* release/${target}/bin/
260+
rm -f release/${target}/bin/*.d
261+
cp ./scripts/ci/deploy/config/databend-query-node-1.toml release/${target}/configs/databend-query.toml
262+
cp ./scripts/ci/deploy/config/databend-meta-node-1.toml release/${target}/configs/databend-meta.toml
263+
cp ./.github/actions/publish_binary/databend-release-readme.txt release/${target}/readme.txt
264+
cp -r ./.github/actions/publish_binary/databend-scripts-for-release release/${target}/scripts
265+
tar -C ./release/${target} -czvf databend-hive-${version}-${target}.tar.gz bin configs scripts readme.txt
266+
- name: generate sha256sums
267+
run: |
268+
target=${{ steps.target.outputs.target }}
269+
version=${{ needs.create_release.outputs.version }}
270+
sha256sum databend-hive-${version}-${target}.tar.gz >> sha256-hive-${version}-${target}.txt
271+
- name: post sha256
272+
uses: actions/upload-artifact@v3
273+
with:
274+
name: sha256sums
275+
path: sha256-hive-${{ needs.create_release.outputs.version }}-${{ steps.target.outputs.target }}.txt
276+
retention-days: 1
277+
- name: Publish Binaries
278+
uses: ./.github/actions/publish_binary
279+
with:
280+
github_token: ${{ secrets.GITHUB_TOKEN }}
281+
version: hive-${{ needs.create_release.outputs.version }}
282+
target: ${{ steps.target.outputs.target }}
283+
repo_role_arn: ${{ secrets.REPO_ROLE_ARN }}
284+
218285
publish_sqllogic_testsuites:
219286
name: sqllogic testsuites
220287
runs-on: ubuntu-latest
@@ -346,8 +413,64 @@ jobs:
346413
file: ./docker/${{ matrix.distro }}/${{ matrix.service }}.Dockerfile
347414
build-args: VERSION=${{ needs.create_release.outputs.version }}
348415

416+
release_packages:
417+
name: release packages
418+
runs-on: ubuntu-latest
419+
needs: [create_release, publish_linux]
420+
strategy:
421+
matrix:
422+
arch:
423+
- x86_64
424+
platform:
425+
- musl
426+
packager:
427+
- deb
428+
steps:
429+
- name: Checkout
430+
uses: actions/checkout@v3
431+
- name: Install nfpm@latest
432+
run: curl -o /tmp/nfpm.tar.gz -sSL https://github.com/goreleaser/nfpm/releases/download/v2.22.2/nfpm_2.22.2_Linux_x86_64.tar.gz && cd /tmp && tar xf /tmp/nfpm.tar.gz && sudo mv nfpm /usr/local/bin && sudo chmod a+x /usr/local/bin/nfpm
433+
- name: Get target
434+
id: target
435+
run: echo 'target=${{ matrix.arch }}-unknown-linux-${{ matrix.platform }}' >> $GITHUB_OUTPUT
436+
- name: Download binaries for usage
437+
id: download_binaries
438+
run: |
439+
target=${{ steps.target.outputs.target }}
440+
version="${{ needs.create_release.outputs.version }}"
441+
mkdir -p ./distro/
442+
wget -P distro -qc https://repo.databend.rs/databend/${version}/databend-${version}-${target}.tar.gz
443+
tar x -C distro -f ./distro/databend-${version}-${target}.tar.gz
444+
- name: Build Packages
445+
id: build_packages
446+
run: |
447+
export name="databend"
448+
export version="${{ needs.create_release.outputs.version }}"
449+
export path="distro"
450+
nfpm pkg --packager ${{ matrix.packager }} -f <(envsubst '${name} ${version} ${path}' < .github/actions/publish_binary/nfpm.yaml)
451+
- name: generate sha256sums
452+
run: |
453+
version="${{ needs.create_release.outputs.version }}"
454+
sha256sum databend_*.${{ matrix.packager }} >> sha256-${version}-${{ matrix.packager }}.txt
455+
- name: post sha256
456+
uses: actions/upload-artifact@v3
457+
with:
458+
name: sha256sums
459+
path: sha256-${{ needs.create_release.outputs.version }}-${{ matrix.packager }}.txt
460+
retention-days: 1
461+
- name: Update release to github
462+
shell: bash
463+
# Reference: https://cli.github.com/manual/gh_release_upload
464+
run: |
465+
target=${{ steps.target.outputs.target }}
466+
version="${{ needs.create_release.outputs.version }}"
467+
# name looks like: `databend_0.8.144~nightly_amd64.deb`
468+
gh release upload ${version} databend_*.${{ matrix.packager }} --clobber
469+
env:
470+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
471+
349472
upload-sha256sums-plugin:
350-
needs: [create_release, publish_linux, publish_macos]
473+
needs: [create_release, publish_linux, publish_macos, release_packages]
351474
runs-on: ubuntu-latest
352475
name: upload-sha256sums
353476
steps:

.github/workflows/dev-linux.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,15 @@ jobs:
6464
# fetch all tags, metasrv and metaclient need tag as its version.
6565
fetch-depth: 0
6666
- uses: ./.github/actions/build_linux
67+
env:
68+
# To avoid the `undefined reference to pthread_getname_np` error during linking,
69+
# here we override set config environment var `je_cv_pthread_getname_np` to `no`,
70+
# as suggested by tikv-jemalloc-sys's maintainer @BusyJay:
71+
# https://github.com/tikv/jemallocator/issues/30#issuecomment-1183786410
72+
#
73+
# Hopefully this trick can be removed when rust upgraded to musl 1.2.3
74+
# https://github.com/rust-lang/rust/pull/102891
75+
je_cv_pthread_getname_np: no
6776
with:
6877
target: ${{ matrix.arch }}-unknown-linux-musl
6978
profile: debug

.github/workflows/production.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,15 @@ jobs:
6464
target: ${{ matrix.target }}
6565
profile: release
6666

67+
build_hive:
68+
runs-on: [self-hosted, X64, Linux, development]
69+
steps:
70+
- uses: actions/checkout@v3
71+
- uses: ./.github/actions/build_linux_hive
72+
with:
73+
target: x86_64-unknown-linux-gnu
74+
profile: release
75+
6776
test_unit:
6877
timeout-minutes: 30
6978
runs-on: [self-hosted, X64, Linux]

0 commit comments

Comments
 (0)