Skip to content

Commit

Permalink
chore(ci): setup license with mask (#16061)
Browse files Browse the repository at this point in the history
* chore(ci): mask license

* z

* z

* z

* z

* z

* z
  • Loading branch information
everpcpc authored Jul 16, 2024
1 parent 322de82 commit 3d47fcf
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 96 deletions.
33 changes: 33 additions & 0 deletions .github/actions/setup_license/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: "Setup License"
description: "Setup Databend Enterprise License"
inputs:
runner_provider:
description: "Self-hosted runner provider, aws or gcp"
required: true
default: "aws"

runs:
using: "composite"
steps:
- name: Get License from S3
if: inputs.runner_provider == 'aws'
shell: bash
run: |
aws s3 cp s3://databend-ci/misc/license.key license.key
aws s3 cp s3://databend-ci/misc/license.json license.json
- name: Get License from GCS
if: inputs.runner_provider == 'gcp'
shell: bash
run: |
gcloud storage cp gs://databend-ci/misc/license.key license.key
gcloud storage cp gs://databend-ci/misc/license.json license.json
- name: Output License
shell: bash
run: |
license=$(cat license.key)
rm license.key
echo "::add-mask::${license}"
echo "QUERY_DATABEND_ENTERPRISE_LICENSE=${license}" >> $GITHUB_ENV
cat license.json
80 changes: 20 additions & 60 deletions .github/workflows/reuse.linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,28 +31,6 @@ jobs:
with:
github_token: ${{ github.token }}

license:
runs-on: [self-hosted, X64, Linux, 4c8g, "${{ inputs.runner_provider }}"]
outputs:
license: ${{ steps.license.outputs.license }}
steps:
- uses: actions/checkout@v4
- name: Get License from S3
if: inputs.runner_provider == 'aws'
run: |
aws s3 cp s3://databend-ci/misc/license.key license.key
aws s3 cp s3://databend-ci/misc/license.json license.json
- name: Get License from GCS
if: inputs.runner_provider == 'gcp'
run: |
gcloud storage cp gs://databend-ci/misc/license.key license.key
gcloud storage cp gs://databend-ci/misc/license.json license.json
- name: Output License
id: license
run: |
echo "license=$(cat license.key | base64 -w 0)" >> $GITHUB_OUTPUT
cat license.json
build:
runs-on:
- self-hosted
Expand Down Expand Up @@ -215,16 +193,13 @@ jobs:

test_stateless_cluster:
runs-on: [self-hosted, X64, Linux, 4c8g, "${{ inputs.runner_provider }}"]
needs: [build, check, license]
needs: [build, check]
steps:
- uses: actions/checkout@v4
- name: Decode license
id: license
run: |
echo "license=$(echo '${{ needs.license.outputs.license }}' | base64 -d)" >> $GITHUB_OUTPUT
- uses: ./.github/actions/setup_license
with:
runner_provider: ${{ inputs.runner_provider }}
- uses: ./.github/actions/test_stateless_cluster_linux
env:
QUERY_DATABEND_ENTERPRISE_LICENSE: ${{ steps.license.outputs.license }}
timeout-minutes: 15

test_stateful_standalone:
Expand All @@ -242,16 +217,13 @@ jobs:

test_stateful_cluster:
runs-on: [self-hosted, X64, Linux, 4c8g, "${{ inputs.runner_provider }}"]
needs: [build, check, license]
needs: [build, check]
steps:
- uses: actions/checkout@v4
- name: Decode license
id: license
run: |
echo "license=$(echo '${{ needs.license.outputs.license }}' | base64 -d)" >> $GITHUB_OUTPUT
- uses: ./.github/actions/setup_license
with:
runner_provider: ${{ inputs.runner_provider }}
- uses: ./.github/actions/test_stateful_cluster_linux
env:
QUERY_DATABEND_ENTERPRISE_LICENSE: ${{ steps.license.outputs.license }}
timeout-minutes: 15
- name: Upload failure
if: failure()
Expand Down Expand Up @@ -291,61 +263,49 @@ jobs:
# continue-on-error: true

test_ee_standalone:
needs: [build, check, license]
needs: [build, check]
runs-on: [self-hosted, X64, Linux, 4c8g, "${{ inputs.runner_provider }}"]
if: needs.license.outputs.license
steps:
- uses: actions/checkout@v4
- name: Decode license
id: license
run: |
echo "license=$(echo '${{ needs.license.outputs.license }}' | base64 -d)" >> $GITHUB_OUTPUT
- uses: ./.github/actions/setup_license
with:
runner_provider: ${{ inputs.runner_provider }}
- uses: ./.github/actions/test_ee_standalone_linux
timeout-minutes: 10
env:
QUERY_DATABEND_ENTERPRISE_LICENSE: ${{ steps.license.outputs.license }}
- name: Upload failure
if: failure()
uses: ./.github/actions/artifact_failure
with:
name: test-stateful-standalone-linux

test_ee_standalone_background:
needs: [build, check, license]
needs: [build, check]
runs-on: [self-hosted, X64, Linux, 4c8g, "${{ inputs.runner_provider }}"]
if: needs.license.outputs.license
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup_bendsql
- name: Decode license
id: license
run: |
echo "license=$(echo '${{ needs.license.outputs.license }}' | base64 -d)" >> $GITHUB_OUTPUT
- uses: ./.github/actions/setup_license
with:
runner_provider: ${{ inputs.runner_provider }}
- uses: ./.github/actions/test_ee_standalone_background_linux
timeout-minutes: 10
env:
QUERY_DATABEND_ENTERPRISE_LICENSE: ${{ steps.license.outputs.license }}
- name: Upload failure
if: failure()
uses: ./.github/actions/artifact_failure
with:
name: test-stateful-standalone-linux

test_ee_management_mode:
needs: [build, check, license]
needs: [build, check]
runs-on: [self-hosted, X64, Linux, 4c8g, "${{ inputs.runner_provider }}"]
if: needs.license.outputs.license
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup_bendsql
- name: Decode license
id: license
run: |
echo "license=$(echo '${{ needs.license.outputs.license }}' | base64 -d)" >> $GITHUB_OUTPUT
- uses: ./.github/actions/setup_license
with:
runner_provider: ${{ inputs.runner_provider }}
- uses: ./.github/actions/test_ee_management_mode_linux
timeout-minutes: 10
env:
QUERY_DATABEND_ENTERPRISE_LICENSE: ${{ steps.license.outputs.license }}
- name: Upload failure
if: failure()
uses: ./.github/actions/artifact_failure
Expand Down
42 changes: 6 additions & 36 deletions .github/workflows/reuse.sqllogic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,28 +19,6 @@ env:
RUNNER_PROVIDER: ${{ inputs.runner_provider }}

jobs:
license:
runs-on: [self-hosted, X64, Linux, 4c8g, "${{ inputs.runner_provider }}"]
outputs:
license: ${{ steps.license.outputs.license }}
steps:
- uses: actions/checkout@v4
- name: Get License from S3
if: inputs.runner_provider == 'aws'
run: |
aws s3 cp s3://databend-ci/misc/license.key license.key
aws s3 cp s3://databend-ci/misc/license.json license.json
- name: Get License from GCS
if: inputs.runner_provider == 'gcp'
run: |
gcloud storage cp gs://databend-ci/misc/license.key license.key
gcloud storage cp gs://databend-ci/misc/license.json license.json
- name: Output License
id: license
run: |
echo "license=$(cat license.key | base64 -w 0)" >> $GITHUB_OUTPUT
cat license.json
management_mode:
runs-on: [self-hosted, X64, Linux, 4c8g, "${{ inputs.runner_provider }}"]
steps:
Expand Down Expand Up @@ -150,7 +128,6 @@ jobs:

cluster:
runs-on: [self-hosted, X64, Linux, 4c8g, "${{ inputs.runner_provider }}"]
needs: license
strategy:
fail-fast: false
matrix:
Expand All @@ -168,13 +145,10 @@ jobs:
- "http"
steps:
- uses: actions/checkout@v4
- name: Decode license
id: license
run: |
echo "license=$(echo '${{ needs.license.outputs.license }}' | base64 -d)" >> $GITHUB_OUTPUT
- uses: ./.github/actions/setup_license
with:
runner_provider: ${{ inputs.runner_provider }}
- uses: ./.github/actions/test_sqllogic_cluster_linux
env:
QUERY_DATABEND_ENTERPRISE_LICENSE: ${{ steps.license.outputs.license }}
timeout-minutes: 15
with:
dirs: ${{ matrix.dirs }}
Expand Down Expand Up @@ -233,7 +207,6 @@ jobs:

ee:
runs-on: [self-hosted, X64, Linux, 4c8g, "${{ inputs.runner_provider }}"]
needs: license
strategy:
fail-fast: false
matrix:
Expand All @@ -242,14 +215,11 @@ jobs:
- "native"
steps:
- uses: actions/checkout@v4
- name: Decode license
id: license
run: |
echo "license=$(echo '${{ needs.license.outputs.license }}' | base64 -d)" >> $GITHUB_OUTPUT
- uses: ./.github/actions/setup_license
with:
runner_provider: ${{ inputs.runner_provider }}
- uses: ./.github/actions/test_ee_sqllogic_standalone_linux
timeout-minutes: 15
env:
QUERY_DATABEND_ENTERPRISE_LICENSE: ${{ steps.license.outputs.license }}
with:
dirs: ee
handlers: mysql,http
Expand Down
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,7 @@ lto = "thin"
overflow-checks = false
incremental = false
opt-level = "s"

# codegen-units = 1 # Reduce number of codegen units to increase optimizations.

# [profile.release.package]
Expand Down

0 comments on commit 3d47fcf

Please sign in to comment.