kbcli:v0.6.1 gke:1.25:amd64 #4
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: KBCLI Test on K8S | |
on: | |
workflow_call: | |
inputs: | |
CLOUD_PROVIDER: | |
description: 'cloud k8s cluster provider (e.g. eks/gke)' | |
type: string | |
required: false | |
default: 'eks' | |
KB_VERSION: | |
description: 'kubeblocks release version' | |
type: string | |
required: false | |
default: 'latest' | |
KB_PRE_VERSION: | |
description: 'kubeblocks previous version of upgrade' | |
type: string | |
required: false | |
default: '' | |
TEST_TYPE: | |
description: 'test type (e.g. mysql|postgres|redis|mongo|kafka|pulsar|weaviate|qdrant|smarte|scale)' | |
type: string | |
required: false | |
default: '' | |
CLUSTER_VERSION: | |
description: 'k8s cluster version (e.g. 1.25)' | |
type: string | |
required: false | |
default: '1.25' | |
REGION: | |
description: 'k8s region name' | |
type: string | |
required: false | |
default: 'cn-northwest-1' | |
INSTANCE_TYPE: | |
description: 'node instance types (e.g. amd64/arm64)' | |
type: string | |
required: false | |
default: 'amd64' | |
BRANCH_NAME: | |
description: 'testinfra branch name' | |
type: string | |
required: false | |
default: 'main' | |
APECD_REF: | |
description: "The branch name of apecloud-cd" | |
type: string | |
required: false | |
default: 'main' | |
ARGS: | |
description: "Test args" | |
type: string | |
required: false | |
default: '' | |
workflow_dispatch: | |
inputs: | |
CLOUD_PROVIDER: | |
description: 'cloud k8s cluster provider (e.g. eks/gke)' | |
required: false | |
default: 'eks' | |
KB_VERSION: | |
description: 'kubeblocks release version' | |
required: false | |
default: 'latest' | |
KB_PRE_VERSION: | |
description: 'kubeblocks previous version of upgrade' | |
type: string | |
required: false | |
default: '' | |
TEST_TYPE: | |
description: 'test type (e.g. mysql|postgres|redis|mongo|kafka|pulsar|weaviate|qdrant|smarte|scale)' | |
type: string | |
required: false | |
default: '' | |
CLUSTER_VERSION: | |
description: 'k8s cluster version (e.g. 1.25)' | |
required: false | |
default: '1.25' | |
REGION: | |
description: 'k8s region name' | |
required: false | |
default: 'cn-northwest-1' | |
INSTANCE_TYPE: | |
description: 'node instance types (e.g. amd64/arm64)' | |
required: false | |
default: 'amd64' | |
BRANCH_NAME: | |
description: 'testinfra branch name' | |
required: false | |
default: 'main' | |
APECD_REF: | |
description: "The branch name of apecloud-cd" | |
required: false | |
default: 'main' | |
ARGS: | |
description: "Test args" | |
required: false | |
default: '' | |
run-name: kbcli:${{ inputs.KB_VERSION }} ${{ inputs.CLOUD_PROVIDER }}:${{ inputs.CLUSTER_VERSION }}:${{ inputs.INSTANCE_TYPE }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }} | |
permissions: | |
id-token: write | |
contents: read | |
jobs: | |
terraform-init-k8s: | |
uses: ./.github/workflows/terraform-init.yml | |
with: | |
test-type: ${{ inputs.TEST_TYPE }} | |
cloud-provider: ${{ inputs.CLOUD_PROVIDER }} | |
cluster-version: ${{ inputs.CLUSTER_VERSION }} | |
instance-type: ${{ inputs.INSTANCE_TYPE }} | |
artifact-name: cicd-${{ inputs.CLOUD_PROVIDER }}-${{ github.sha }} | |
region: ${{ inputs.REGION }} | |
secrets: inherit | |
install-kubeblocks: | |
if: ${{ needs.terraform-init-k8s.result == 'success' }} | |
needs: terraform-init-k8s | |
uses: ./.github/workflows/test-kbcli.yml | |
with: | |
cloud-provider: ${{ inputs.CLOUD_PROVIDER }} | |
region: ${{ inputs.REGION }} | |
release-version: "${{ inputs.KB_VERSION }}" | |
previous-version: "${{ inputs.KB_PRE_VERSION }}" | |
test-type: "0" | |
test-type-name: "install" | |
test-args: "--config-s3 true --upgrade true ${{ inputs.ARGS }}" | |
k8s-cluster-name: ${{ needs.terraform-init-k8s.outputs.k8s-cluster-name }} | |
branch-name: ${{ inputs.BRANCH_NAME }} | |
secrets: inherit | |
test-mysql: | |
if: ${{ needs.terraform-init-k8s.result == 'success' && always() && (inputs.TEST_TYPE == '' || contains(inputs.TEST_TYPE, 'mysql')) }} | |
needs: [ terraform-init-k8s, install-kubeblocks ] | |
uses: ./.github/workflows/test-kbcli.yml | |
with: | |
cloud-provider: ${{ inputs.CLOUD_PROVIDER }} | |
region: ${{ inputs.REGION }} | |
release-version: "${{ inputs.KB_VERSION }}" | |
previous-version: "${{ inputs.KB_PRE_VERSION }}" | |
test-type: "1" | |
test-type-name: "mysql" | |
test-args: "${{ inputs.ARGS }}" | |
k8s-cluster-name: ${{ needs.terraform-init-k8s.outputs.k8s-cluster-name }} | |
branch-name: ${{ inputs.BRANCH_NAME }} | |
random-suffix: ${{ needs.install-kubeblocks.outputs.random-suffix }} | |
secrets: inherit | |
test-postgresql: | |
if: ${{ needs.terraform-init-k8s.result == 'success' && always() && (inputs.TEST_TYPE == '' || contains(inputs.TEST_TYPE, 'postgres')) }} | |
needs: [ terraform-init-k8s, install-kubeblocks ] | |
uses: ./.github/workflows/test-kbcli.yml | |
with: | |
cloud-provider: ${{ inputs.CLOUD_PROVIDER }} | |
region: ${{ inputs.REGION }} | |
release-version: "${{ inputs.KB_VERSION }}" | |
previous-version: "${{ inputs.KB_PRE_VERSION }}" | |
test-type: "2" | |
test-type-name: "postgresql" | |
test-args: "${{ inputs.ARGS }}" | |
k8s-cluster-name: ${{ needs.terraform-init-k8s.outputs.k8s-cluster-name }} | |
branch-name: ${{ inputs.BRANCH_NAME }} | |
random-suffix: ${{ needs.install-kubeblocks.outputs.random-suffix }} | |
secrets: inherit | |
test-redis: | |
if: ${{ needs.terraform-init-k8s.result == 'success' && always() && (inputs.TEST_TYPE == '' || contains(inputs.TEST_TYPE, 'redis')) }} | |
needs: [ terraform-init-k8s, install-kubeblocks ] | |
uses: ./.github/workflows/test-kbcli.yml | |
with: | |
cloud-provider: ${{ inputs.CLOUD_PROVIDER }} | |
region: ${{ inputs.REGION }} | |
release-version: "${{ inputs.KB_VERSION }}" | |
previous-version: "${{ inputs.KB_PRE_VERSION }}" | |
test-type: "5" | |
test-type-name: "redis" | |
test-args: "${{ inputs.ARGS }}" | |
k8s-cluster-name: ${{ needs.terraform-init-k8s.outputs.k8s-cluster-name }} | |
branch-name: ${{ inputs.BRANCH_NAME }} | |
random-suffix: ${{ needs.install-kubeblocks.outputs.random-suffix }} | |
secrets: inherit | |
test-mongodb: | |
if: ${{ needs.terraform-init-k8s.result == 'success' && always() && (inputs.TEST_TYPE == '' || contains(inputs.TEST_TYPE, 'mongo')) }} | |
needs: [ terraform-init-k8s, install-kubeblocks ] | |
uses: ./.github/workflows/test-kbcli.yml | |
with: | |
cloud-provider: ${{ inputs.CLOUD_PROVIDER }} | |
region: ${{ inputs.REGION }} | |
release-version: "${{ inputs.KB_VERSION }}" | |
previous-version: "${{ inputs.KB_PRE_VERSION }}" | |
test-type: "6" | |
test-type-name: "mongodb" | |
test-args: "${{ inputs.ARGS }}" | |
k8s-cluster-name: ${{ needs.terraform-init-k8s.outputs.k8s-cluster-name }} | |
branch-name: ${{ inputs.BRANCH_NAME }} | |
random-suffix: ${{ needs.install-kubeblocks.outputs.random-suffix }} | |
secrets: inherit | |
test-kafka: | |
if: ${{ needs.terraform-init-k8s.result == 'success' && always() && (inputs.TEST_TYPE == '' || contains(inputs.TEST_TYPE, 'kafka')) }} | |
needs: [ terraform-init-k8s, install-kubeblocks ] | |
uses: ./.github/workflows/test-kbcli.yml | |
with: | |
cloud-provider: ${{ inputs.CLOUD_PROVIDER }} | |
region: ${{ inputs.REGION }} | |
release-version: "${{ inputs.KB_VERSION }}" | |
previous-version: "${{ inputs.KB_PRE_VERSION }}" | |
test-type: "7" | |
test-type-name: "kafka" | |
test-args: "${{ inputs.ARGS }}" | |
k8s-cluster-name: ${{ needs.terraform-init-k8s.outputs.k8s-cluster-name }} | |
branch-name: ${{ inputs.BRANCH_NAME }} | |
random-suffix: ${{ needs.install-kubeblocks.outputs.random-suffix }} | |
secrets: inherit | |
test-pulsar: | |
if: ${{ needs.terraform-init-k8s.result == 'success' && always() && (inputs.TEST_TYPE == '' || contains(inputs.TEST_TYPE, 'pulsar')) }} | |
needs: [ terraform-init-k8s, install-kubeblocks ] | |
uses: ./.github/workflows/test-kbcli.yml | |
with: | |
cloud-provider: ${{ inputs.CLOUD_PROVIDER }} | |
region: ${{ inputs.REGION }} | |
release-version: "${{ inputs.KB_VERSION }}" | |
previous-version: "${{ inputs.KB_PRE_VERSION }}" | |
test-type: "8" | |
test-type-name: "pulsar" | |
test-args: "${{ inputs.ARGS }}" | |
k8s-cluster-name: ${{ needs.terraform-init-k8s.outputs.k8s-cluster-name }} | |
branch-name: ${{ inputs.BRANCH_NAME }} | |
random-suffix: ${{ needs.install-kubeblocks.outputs.random-suffix }} | |
secrets: inherit | |
test-mysqlscale: | |
if: ${{ needs.terraform-init-k8s.result == 'success' && always() && (inputs.TEST_TYPE == '' || contains(inputs.TEST_TYPE, 'scale')) }} | |
needs: [ terraform-init-k8s, install-kubeblocks ] | |
uses: ./.github/workflows/test-kbcli.yml | |
with: | |
cloud-provider: ${{ inputs.CLOUD_PROVIDER }} | |
region: ${{ inputs.REGION }} | |
release-version: "${{ inputs.KB_VERSION }}" | |
previous-version: "${{ inputs.KB_PRE_VERSION }}" | |
test-type: "1" | |
test-type-name: "mysqlscale" | |
test-args: "--enable-proxy true ${{ inputs.ARGS }}" | |
k8s-cluster-name: ${{ needs.terraform-init-k8s.outputs.k8s-cluster-name }} | |
branch-name: ${{ inputs.BRANCH_NAME }} | |
random-suffix: ${{ needs.install-kubeblocks.outputs.random-suffix }} | |
secrets: inherit | |
test-weaviate: | |
if: ${{ needs.terraform-init-k8s.result == 'success' && always() && (inputs.TEST_TYPE == '' || contains(inputs.TEST_TYPE, 'weaviate')) }} | |
needs: [ terraform-init-k8s, install-kubeblocks ] | |
uses: ./.github/workflows/test-kbcli.yml | |
with: | |
cloud-provider: ${{ inputs.CLOUD_PROVIDER }} | |
region: ${{ inputs.REGION }} | |
release-version: "${{ inputs.KB_VERSION }}" | |
previous-version: "${{ inputs.KB_PRE_VERSION }}" | |
test-type: "9" | |
test-type-name: "weaviate" | |
test-args: "${{ inputs.ARGS }}" | |
k8s-cluster-name: ${{ needs.terraform-init-k8s.outputs.k8s-cluster-name }} | |
branch-name: ${{ inputs.BRANCH_NAME }} | |
random-suffix: ${{ needs.install-kubeblocks.outputs.random-suffix }} | |
secrets: inherit | |
test-qdrant: | |
if: ${{ needs.terraform-init-k8s.result == 'success' && always() && (inputs.TEST_TYPE == '' || contains(inputs.TEST_TYPE, 'qdrant')) }} | |
needs: [ terraform-init-k8s, install-kubeblocks ] | |
uses: ./.github/workflows/test-kbcli.yml | |
with: | |
cloud-provider: ${{ inputs.CLOUD_PROVIDER }} | |
region: ${{ inputs.REGION }} | |
release-version: "${{ inputs.KB_VERSION }}" | |
previous-version: "${{ inputs.KB_PRE_VERSION }}" | |
test-type: "10" | |
test-type-name: "qdrant" | |
test-args: "${{ inputs.ARGS }}" | |
k8s-cluster-name: ${{ needs.terraform-init-k8s.outputs.k8s-cluster-name }} | |
branch-name: ${{ inputs.BRANCH_NAME }} | |
random-suffix: ${{ needs.install-kubeblocks.outputs.random-suffix }} | |
secrets: inherit | |
test-smartengine: | |
if: ${{ needs.terraform-init-k8s.result == 'success' && always() && (inputs.TEST_TYPE == '' || contains(inputs.TEST_TYPE, 'smarte')) }} | |
needs: [ terraform-init-k8s, install-kubeblocks ] | |
uses: ./.github/workflows/test-kbcli.yml | |
with: | |
cloud-provider: ${{ inputs.CLOUD_PROVIDER }} | |
region: ${{ inputs.REGION }} | |
release-version: "${{ inputs.KB_VERSION }}" | |
previous-version: "${{ inputs.KB_PRE_VERSION }}" | |
test-type: "1" | |
test-type-name: "smartengine" | |
test-args: "--smartengine true ${{ inputs.ARGS }}" | |
k8s-cluster-name: ${{ needs.terraform-init-k8s.outputs.k8s-cluster-name }} | |
branch-name: ${{ inputs.BRANCH_NAME }} | |
random-suffix: ${{ needs.install-kubeblocks.outputs.random-suffix }} | |
secrets: inherit | |
send-message: | |
if: ${{ always() }} | |
runs-on: ubuntu-latest | |
needs: [ install-kubeblocks, test-mysql, test-postgresql, test-redis, test-mongodb, test-kafka, test-pulsar, test-mysqlscale, test-weaviate, test-qdrant, test-smartengine ] | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
repository: apecloud/apecloud-cd | |
path: ./ | |
ref: ${{ inputs.APECD_REF }} | |
- name: send message | |
id: get_trigger_mode | |
run: | | |
TEST_RESULT="install|${{ needs.install-kubeblocks.outputs.test-result }}" | |
TEST_RESULT="${TEST_RESULT}##mysql|${{ needs.test-mysql.outputs.test-result }}" | |
TEST_RESULT="${TEST_RESULT}##postgresql|${{ needs.test-postgresql.outputs.test-result }}" | |
TEST_RESULT="${TEST_RESULT}##redis|${{ needs.test-redis.outputs.test-result }}" | |
TEST_RESULT="${TEST_RESULT}##mongodb|${{ needs.test-mongodb.outputs.test-result }}" | |
TEST_RESULT="${TEST_RESULT}##kafka|${{ needs.test-kafka.outputs.test-result }}" | |
TEST_RESULT="${TEST_RESULT}##pulsar|${{ needs.test-pulsar.outputs.test-result }}" | |
TEST_RESULT="${TEST_RESULT}##mysqlscale|${{ needs.test-mysqlscale.outputs.test-result }}" | |
TEST_RESULT="${TEST_RESULT}##weaviate|${{ needs.test-weaviate.outputs.test-result }}" | |
TEST_RESULT="${TEST_RESULT}##qdrant|${{ needs.test-qdrant.outputs.test-result }}" | |
TEST_RESULT="${TEST_RESULT}##smartengine|${{ needs.test-smartengine.outputs.test-result }}" | |
TEST_RESULT=$( bash .github/utils/utils.sh --type 12 \ | |
--test-result "${TEST_RESULT}" \ | |
--run-id "$GITHUB_RUN_ID" ) | |
date_ret=$(date +%Y-%m-%d-%T) | |
test_title="[${{ inputs.KB_VERSION }}] Test KBCLI on ${{ inputs.CLOUD_PROVIDER }}:${{ inputs.CLUSTER_VERSION }}:${{ inputs.INSTANCE_TYPE }} [${date_ret}]" | |
if [[ -n "${{ inputs.KB_PRE_VERSION }}" ]]; then | |
test_title="[${{ inputs.KB_PRE_VERSION }}] upgrade to "$test_title | |
fi | |
python3 .github/utils/send_mesage.py \ | |
--url ${{ vars.TEST_BOT_WEBHOOK }} \ | |
--title "$test_title" \ | |
--result "$TEST_RESULT" | |
terraform-destroy-k8s: | |
if: ${{ always() }} | |
needs: [ terraform-init-k8s, send-message ] | |
uses: ./.github/workflows/terraform-destroy.yml | |
with: | |
cloud-provider: ${{ inputs.CLOUD_PROVIDER }} | |
artifact-name: cicd-${{ inputs.CLOUD_PROVIDER }}-${{ github.sha }} | |
region: ${{ inputs.REGION }} | |
secrets: inherit |