From 41fba6cd9ecfc87e8ad2dd0301c25ab3989fb050 Mon Sep 17 00:00:00 2001 From: WenyXu Date: Thu, 16 May 2024 17:28:34 +0000 Subject: [PATCH 01/10] chore(ci): add cfg for setup GreptimeDB cluster --- .github/workflows/develop.yml | 64 +++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) diff --git a/.github/workflows/develop.yml b/.github/workflows/develop.yml index 0e05569b4b14..853c855a6242 100644 --- a/.github/workflows/develop.yml +++ b/.github/workflows/develop.yml @@ -231,6 +231,70 @@ jobs: path: /tmp/unstable-greptime/ retention-days: 3 + e2e: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: nolar/setup-k3d-k3s@v1 + with: + version: v1.27 + k3d-name: kube + k3d-args: "--no-lb --no-rollback --k3s-arg --disable=traefik,servicelb,metrics-server@server:*" + - name: Install greptime operator + run: | + helm repo add greptime https://greptimeteam.github.io/helm-charts/ + helm repo update + helm upgrade \ + --install \ + --create-namespace \ + greptimedb-operator greptime/greptimedb-operator \ + -n greptimedb-admin + - name: Install etcd cluster + run: | + helm upgrade \ + --install etcd oci://registry-1.docker.io/bitnamicharts/etcd \ + --set replicaCount=3 \ + --set auth.rbac.create=false \ + --set auth.rbac.token.enabled=false \ + --set persistence.size=1Gi \ + --create-namespace \ + -n etcd-cluster + - name: Wait for etcd + run: | + kubectl wait \ + --for=condition=Ready \ + pod -l app.kubernetes.io/instance=etcd \ + --timeout=120s \ + -n etcd-cluster + - name: Print etcd info + run: kubectl get all --show-labels -n etcd-cluster + - name: Install GreptimeDB cluster + run: | + helm upgrade \ + --install my-greptimedb \ + --set meta.etcdEndpoints=etcd.etcd-cluster.svc.cluster.local:2379 \ + greptime/greptimedb-cluster \ + --create-namespace \ + -n my-greptimedb + - name: Wait for GreptimeDB + run: | + kubectl wait \ + --for=condition=Ready \ + pod -l app.greptime.io/component=my-greptimedb-meta \ + --timeout=120s \ + -n my-greptimedb + kubectl wait \ + --for=condition=Ready \ + pod -l app.greptime.io/component=my-greptimedb-datanode \ + --timeout=120s \ + -n my-greptimedb + kubectl wait \ + --for=condition=Ready \ + pod -l app.greptime.io/component=my-greptimedb-frontend \ + --timeout=120s \ + -n my-greptimedb + - name: Print GreptimeDB info + run: kubectl get all --show-labels -n my-greptimedb sqlness: name: Sqlness Test From bc7835812232f30a69613ddee57f3d2773e88436 Mon Sep 17 00:00:00 2001 From: WenyXu Date: Thu, 16 May 2024 18:22:06 +0000 Subject: [PATCH 02/10] chore: use kind --- .github/scripts/kind-with-registry.sh | 66 +++++++++++++++++++++++++++ .github/workflows/develop.yml | 13 ++++-- 2 files changed, 74 insertions(+), 5 deletions(-) create mode 100755 .github/scripts/kind-with-registry.sh diff --git a/.github/scripts/kind-with-registry.sh b/.github/scripts/kind-with-registry.sh new file mode 100755 index 000000000000..398e096e4139 --- /dev/null +++ b/.github/scripts/kind-with-registry.sh @@ -0,0 +1,66 @@ +#!/usr/bin/env bash + +set -e +set -o pipefail + +# 1. Create registry container unless it already exists +reg_name='kind-registry' +reg_port='5001' +if [ "$(docker inspect -f '{{.State.Running}}' "${reg_name}" 2>/dev/null || true)" != 'true' ]; then + docker run \ + -d --restart=always -p "127.0.0.1:${reg_port}:5000" --network bridge --name "${reg_name}" \ + registry:2 +fi + +# 2. Create kind cluster with containerd registry config dir enabled +# TODO: kind will eventually enable this by default and this patch will +# be unnecessary. +# +# See: +# https://github.com/kubernetes-sigs/kind/issues/2875 +# https://github.com/containerd/containerd/blob/main/docs/cri/config.md#registry-configuration +# See: https://github.com/containerd/containerd/blob/main/docs/hosts.md +cat < Date: Thu, 16 May 2024 18:43:46 +0000 Subject: [PATCH 03/10] chore: always print info --- .github/workflows/develop.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/develop.yml b/.github/workflows/develop.yml index 7a04a8932265..1a3066bf0d05 100644 --- a/.github/workflows/develop.yml +++ b/.github/workflows/develop.yml @@ -297,6 +297,7 @@ jobs: --timeout=120s \ -n my-greptimedb - name: Print GreptimeDB info + if: always() run: kubectl get all --show-labels -n my-greptimedb sqlness: From c3193a063ad5ef4c7797c5e48340f27e901c24a2 Mon Sep 17 00:00:00 2001 From: WenyXu Date: Thu, 16 May 2024 18:51:57 +0000 Subject: [PATCH 04/10] chore: add debug print --- .github/workflows/develop.yml | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/.github/workflows/develop.yml b/.github/workflows/develop.yml index 1a3066bf0d05..5d9cf99a8eb6 100644 --- a/.github/workflows/develop.yml +++ b/.github/workflows/develop.yml @@ -298,7 +298,19 @@ jobs: -n my-greptimedb - name: Print GreptimeDB info if: always() - run: kubectl get all --show-labels -n my-greptimedb + run: | + kubectl get all --show-labels -n my-greptimedb + - name: Export kind logs + if: failure() + run: | + kind export logs /tmp/kind + - name: Upload logs + if: failure() + uses: actions/upload-artifact@v4 + with: + name: kind-logs + path: /tmp/kind + retention-days: 3 sqlness: name: Sqlness Test From c95eb7c21f6b6c91d1062754fca1eeccf52fa5d5 Mon Sep 17 00:00:00 2001 From: WenyXu Date: Thu, 16 May 2024 19:27:48 +0000 Subject: [PATCH 05/10] chore: set etcd replica to 1 --- .github/workflows/develop.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/develop.yml b/.github/workflows/develop.yml index 5d9cf99a8eb6..31e7b3c1d035 100644 --- a/.github/workflows/develop.yml +++ b/.github/workflows/develop.yml @@ -256,7 +256,7 @@ jobs: run: | helm upgrade \ --install etcd oci://registry-1.docker.io/bitnamicharts/etcd \ - --set replicaCount=3 \ + --set replicaCount=1 \ --set auth.rbac.create=false \ --set auth.rbac.token.enabled=false \ --set persistence.size=1Gi \ From 2b0ffa237f8aeb3cc07ae867798e005302a14b7e Mon Sep 17 00:00:00 2001 From: WenyXu Date: Mon, 20 May 2024 12:56:02 +0000 Subject: [PATCH 06/10] ci: refactor e2e cfg --- .../build-and-push-ci-image/action.yml | 18 +++ .../setup-greptimedb-cluster/action.yml | 107 +++++++++++++++ .github/actions/setup-kind/action.yml | 16 +++ .github/workflows/develop.yml | 129 ++++++++---------- Cargo.toml | 5 + docker/ci/ubuntu/Dockerfile.ci | 16 +++ 6 files changed, 216 insertions(+), 75 deletions(-) create mode 100644 .github/actions/build-and-push-ci-image/action.yml create mode 100644 .github/actions/setup-greptimedb-cluster/action.yml create mode 100644 .github/actions/setup-kind/action.yml create mode 100644 docker/ci/ubuntu/Dockerfile.ci diff --git a/.github/actions/build-and-push-ci-image/action.yml b/.github/actions/build-and-push-ci-image/action.yml new file mode 100644 index 000000000000..5c7d0532ce02 --- /dev/null +++ b/.github/actions/build-and-push-ci-image/action.yml @@ -0,0 +1,18 @@ +name: Build and push CI Docker image +description: Build and push CI Docker image to local registry +inputs: + binary_path: + default: "./bin" + description: "Binary path" +runs: + using: composite + steps: + - name: Build and push to local registry + uses: docker/build-push-action@v5 + with: + context: . + file: ./docker/ci/ubuntu/Dockerfile.ci + push: true + tags: localhost:5001/greptime/greptimedb:latest + build-args: | + BINARY_PATH=${{ inputs.binary_path }} diff --git a/.github/actions/setup-greptimedb-cluster/action.yml b/.github/actions/setup-greptimedb-cluster/action.yml new file mode 100644 index 000000000000..65529886454f --- /dev/null +++ b/.github/actions/setup-greptimedb-cluster/action.yml @@ -0,0 +1,107 @@ +name: Setup GreptimeDB cluster +description: Deploy GreptimeDB cluster on Kubernetes +inputs: + frontend-replica-count: + default: 1 + description: "Frontend replica count" + datanode-replica-count: + default: 2 + description: "Datanode replica count" + metasrv-replica-count: + default: 1 + description: "Metasrv replica count" + etcd-replica-count: + default: 1 + description: "Etcd replica count" + image-registry: + default: "docker.io" + description: "Image registry" + image-repository: + default: "greptime/greptimedb" + description: "Image repository" + image-tag: + default: "latest" + description: 'Image tag' + +runs: + using: composite + steps: + - name: Install greptime operator + shell: bash + run: | + helm repo add greptime https://greptimeteam.github.io/helm-charts/ + helm repo update + helm upgrade \ + --install \ + --create-namespace \ + greptimedb-operator greptime/greptimedb-operator \ + -n greptimedb-admin + - name: Install etcd cluster + shell: bash + run: | + helm upgrade \ + --install etcd oci://registry-1.docker.io/bitnamicharts/etcd \ + --set replicaCount=${{ inputs.etcd-replica-count }} \ + --set auth.rbac.create=false \ + --set auth.rbac.token.enabled=false \ + --set persistence.size=1Gi \ + --create-namespace \ + -n etcd-cluster + - name: Wait for etcd + shell: bash + run: | + kubectl wait \ + --for=condition=Ready \ + pod -l app.kubernetes.io/instance=etcd \ + --timeout=120s \ + -n etcd-cluster + - name: Print etcd info + shell: bash + run: kubectl get all --show-labels -n etcd-cluster + - name: Install GreptimeDB cluster + shell: bash + run: | + helm upgrade \ + --install my-greptimedb \ + --set meta.etcdEndpoints=etcd.etcd-cluster.svc.cluster.local:2379 \ + --set image.registry=${{ inputs.image-registry }} \ + --set image.repository=${{ inputs.image-repository }} \ + --set image.tag=${{ inputs.image-tag }} \ + greptime/greptimedb-cluster \ + --create-namespace \ + -n my-greptimedb + - name: Wait for GreptimeDB + shell: bash + run: | + kubectl wait \ + --for=condition=Ready \ + pod -l app.greptime.io/component=my-greptimedb-meta \ + --timeout=120s \ + -n my-greptimedb + kubectl wait \ + --for=condition=Ready \ + pod -l app.greptime.io/component=my-greptimedb-datanode \ + --timeout=120s \ + -n my-greptimedb + kubectl wait \ + --for=condition=Ready \ + pod -l app.greptime.io/component=my-greptimedb-frontend \ + --timeout=120s \ + -n my-greptimedb + - name: Print GreptimeDB info + if: always() + shell: bash + run: | + kubectl get all --show-labels -n my-greptimedb + - name: Export kind logs + if: failure() + shell: bash + run: | + kind export logs /tmp/kind + - name: Upload logs + if: failure() + uses: actions/upload-artifact@v4 + with: + name: kind-logs + path: /tmp/kind + retention-days: 3 \ No newline at end of file diff --git a/.github/actions/setup-kind/action.yml b/.github/actions/setup-kind/action.yml new file mode 100644 index 000000000000..ae1b71ea4ad2 --- /dev/null +++ b/.github/actions/setup-kind/action.yml @@ -0,0 +1,16 @@ +name: Setup Kind +description: Deploy Kind +runs: + using: composite + steps: + - uses: actions/checkout@v4 + - name: Install Kind + shell: bash + run: | + [ $(uname -m) = x86_64 ] && curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.23.0/kind-linux-amd64 + chmod +x ./kind + sudo mv ./kind /usr/local/bin/kind + - name: Create kind cluster + shell: bash + run: | + ./.github/scripts/kind-with-registry.sh \ No newline at end of file diff --git a/.github/workflows/develop.yml b/.github/workflows/develop.yml index 31e7b3c1d035..61339087c607 100644 --- a/.github/workflows/develop.yml +++ b/.github/workflows/develop.yml @@ -231,86 +231,65 @@ jobs: path: /tmp/unstable-greptime/ retention-days: 3 + build-greptime-ci: + name: Build GreptimeDB binary (profile-CI) + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ ubuntu-20.04 ] + timeout-minutes: 60 + steps: + - uses: actions/checkout@v4 + - uses: arduino/setup-protoc@v3 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + - uses: dtolnay/rust-toolchain@master + with: + toolchain: ${{ env.RUST_TOOLCHAIN }} + - uses: Swatinem/rust-cache@v2 + with: + # Shares across multiple jobs + shared-key: "build-greptime-ci" + - name: Install cargo-gc-bin + shell: bash + run: cargo install cargo-gc-bin + - name: Build greptime bianry + shell: bash + # `cargo gc` will invoke `cargo build` with specified args + run: cargo build --bin greptime --profile ci + - name: Pack greptime binary + shell: bash + run: | + mkdir bin && \ + mv ./target/ci/greptime bin + - name: Print greptime binaries info + run: ls -lh bin + - name: Upload artifacts + uses: ./.github/actions/upload-artifacts + with: + artifacts-dir: bin + version: current + e2e: runs-on: ubuntu-latest + needs: build-greptime-ci steps: - uses: actions/checkout@v4 - - name: Install Kind - run: | - [ $(uname -m) = x86_64 ] && curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.23.0/kind-linux-amd64 - chmod +x ./kind - sudo mv ./kind /usr/local/bin/kind - - name: Create kind cluster - run: | - ./.github/scripts/kind-with-registry.sh - - name: Install greptime operator - run: | - helm repo add greptime https://greptimeteam.github.io/helm-charts/ - helm repo update - helm upgrade \ - --install \ - --create-namespace \ - greptimedb-operator greptime/greptimedb-operator \ - -n greptimedb-admin - - name: Install etcd cluster - run: | - helm upgrade \ - --install etcd oci://registry-1.docker.io/bitnamicharts/etcd \ - --set replicaCount=1 \ - --set auth.rbac.create=false \ - --set auth.rbac.token.enabled=false \ - --set persistence.size=1Gi \ - --create-namespace \ - -n etcd-cluster - - name: Wait for etcd - run: | - kubectl wait \ - --for=condition=Ready \ - pod -l app.kubernetes.io/instance=etcd \ - --timeout=120s \ - -n etcd-cluster - - name: Print etcd info - run: kubectl get all --show-labels -n etcd-cluster - - name: Install GreptimeDB cluster - run: | - helm upgrade \ - --install my-greptimedb \ - --set meta.etcdEndpoints=etcd.etcd-cluster.svc.cluster.local:2379 \ - greptime/greptimedb-cluster \ - --create-namespace \ - -n my-greptimedb - - name: Wait for GreptimeDB - run: | - kubectl wait \ - --for=condition=Ready \ - pod -l app.greptime.io/component=my-greptimedb-meta \ - --timeout=120s \ - -n my-greptimedb - kubectl wait \ - --for=condition=Ready \ - pod -l app.greptime.io/component=my-greptimedb-datanode \ - --timeout=120s \ - -n my-greptimedb - kubectl wait \ - --for=condition=Ready \ - pod -l app.greptime.io/component=my-greptimedb-frontend \ - --timeout=120s \ - -n my-greptimedb - - name: Print GreptimeDB info - if: always() - run: | - kubectl get all --show-labels -n my-greptimedb - - name: Export kind logs - if: failure() - run: | - kind export logs /tmp/kind - - name: Upload logs - if: failure() - uses: actions/upload-artifact@v4 + - name: Setup Kind + uses: ./.github/actions/setup-kind + - name: Download pre-built binariy + uses: actions/download-artifact@v4 with: - name: kind-logs - path: /tmp/kind - retention-days: 3 + name: bin + path: . + - name: Unzip binary + run: tar -xvf ./bin.tar.gz + - name: Build and push GreptimeDB image + uses: ./.github/actions/build-and-push-ci-image + - name: Setup GreptimeDB cluster + uses: ./.github/actions/setup-greptimedb-cluster + with: + image-registry: localhost:5001 sqlness: name: Sqlness Test diff --git a/Cargo.toml b/Cargo.toml index 1ece9e77fabc..e81050ddfb75 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -246,6 +246,11 @@ lto = "thin" debug = false incremental = false +[profile.ci] +inherits = "dev" +debug = false +strip = true + [profile.dev.package.sqlness-runner] debug = false strip = true diff --git a/docker/ci/ubuntu/Dockerfile.ci b/docker/ci/ubuntu/Dockerfile.ci new file mode 100644 index 000000000000..247010f5ef04 --- /dev/null +++ b/docker/ci/ubuntu/Dockerfile.ci @@ -0,0 +1,16 @@ +FROM ubuntu:22.04 + +# The binary name of GreptimeDB executable. +# Defaults to "greptime", but sometimes in other projects it might be different. +ARG TARGET_BIN=greptime + +RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \ + ca-certificates \ + curl + +ARG BINARY_PATH +ADD $BINARY_PATH/$TARGET_BIN /greptime/bin/ + +ENV PATH /greptime/bin/:$PATH + +ENTRYPOINT ["greptime"] From 7a736aa7ff9286f288f9d8bef55dbe947237915e Mon Sep 17 00:00:00 2001 From: WenyXu Date: Mon, 20 May 2024 14:46:28 +0000 Subject: [PATCH 07/10] ci: add Fuzz Test for distributed mode --- .github/actions/setup-etcd-cluster/action.yml | 23 +++++++++ .../setup-greptimedb-cluster/action.yml | 38 +++++--------- .github/workflows/develop.yml | 49 ++++++++++++++++++- 3 files changed, 83 insertions(+), 27 deletions(-) create mode 100644 .github/actions/setup-etcd-cluster/action.yml diff --git a/.github/actions/setup-etcd-cluster/action.yml b/.github/actions/setup-etcd-cluster/action.yml new file mode 100644 index 000000000000..d78448a35e64 --- /dev/null +++ b/.github/actions/setup-etcd-cluster/action.yml @@ -0,0 +1,23 @@ +name: Setup Etcd cluster +description: Deploy Etcd cluster on Kubernetes +inputs: + etcd-replica-count: + default: 1 + description: "Etcd replica count" + namespace: + default: "etcd-cluster" + +runs: + using: composite + steps: + - name: Install Etcd cluster + shell: bash + run: | + helm upgrade \ + --install etcd oci://registry-1.docker.io/bitnamicharts/etcd \ + --set replicaCount=${{ inputs.etcd-replica-count }} \ + --set auth.rbac.create=false \ + --set auth.rbac.token.enabled=false \ + --set persistence.size=1Gi \ + --create-namespace \ + -n ${{ inputs.namespace }} \ No newline at end of file diff --git a/.github/actions/setup-greptimedb-cluster/action.yml b/.github/actions/setup-greptimedb-cluster/action.yml index 65529886454f..fad01b826871 100644 --- a/.github/actions/setup-greptimedb-cluster/action.yml +++ b/.github/actions/setup-greptimedb-cluster/action.yml @@ -22,11 +22,14 @@ inputs: image-tag: default: "latest" description: 'Image tag' + etcd-endpoints: + default: "etcd.etcd-cluster.svc.cluster.local:2379" + description: "Etcd endpoints" runs: using: composite steps: - - name: Install greptime operator + - name: Install GreptimeDB operator shell: bash run: | helm repo add greptime https://greptimeteam.github.io/helm-charts/ @@ -35,44 +38,27 @@ runs: --install \ --create-namespace \ greptimedb-operator greptime/greptimedb-operator \ - -n greptimedb-admin - - name: Install etcd cluster - shell: bash - run: | - helm upgrade \ - --install etcd oci://registry-1.docker.io/bitnamicharts/etcd \ - --set replicaCount=${{ inputs.etcd-replica-count }} \ - --set auth.rbac.create=false \ - --set auth.rbac.token.enabled=false \ - --set persistence.size=1Gi \ - --create-namespace \ - -n etcd-cluster - - name: Wait for etcd - shell: bash - run: | - kubectl wait \ - --for=condition=Ready \ - pod -l app.kubernetes.io/instance=etcd \ - --timeout=120s \ - -n etcd-cluster - - name: Print etcd info - shell: bash - run: kubectl get all --show-labels -n etcd-cluster + -n greptimedb-admin \ + --wait \ + --wait-for-jobs - name: Install GreptimeDB cluster shell: bash run: | helm upgrade \ --install my-greptimedb \ - --set meta.etcdEndpoints=etcd.etcd-cluster.svc.cluster.local:2379 \ + --set meta.etcdEndpoints=${{ inputs.etcd-endpoints }} \ --set image.registry=${{ inputs.image-registry }} \ --set image.repository=${{ inputs.image-repository }} \ --set image.tag=${{ inputs.image-tag }} \ greptime/greptimedb-cluster \ --create-namespace \ - -n my-greptimedb + -n my-greptimedb \ + --wait \ + --wait-for-jobs - name: Wait for GreptimeDB shell: bash run: | + kubectl get pods -n my-greptimedb kubectl wait \ --for=condition=Ready \ pod -l app.greptime.io/component=my-greptimedb-meta \ diff --git a/.github/workflows/develop.yml b/.github/workflows/develop.yml index 61339087c607..56068fca330b 100644 --- a/.github/workflows/develop.yml +++ b/.github/workflows/develop.yml @@ -270,13 +270,38 @@ jobs: artifacts-dir: bin version: current - e2e: + distributed-fuzztest: + name: Fuzz Test (Distributed, Disk) runs-on: ubuntu-latest needs: build-greptime-ci + strategy: + matrix: + target: [ "fuzz_create_table", "fuzz_alter_table", "fuzz_create_database", "fuzz_create_logical_table", "fuzz_alter_logical_table", "fuzz_insert", "fuzz_insert_logical_table" ] steps: - uses: actions/checkout@v4 - name: Setup Kind uses: ./.github/actions/setup-kind + - name: Setup Etcd cluser + uses: ./.github/actions/setup-etcd-cluster + # Prepares for fuzz tests + - uses: arduino/setup-protoc@v3 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + - uses: dtolnay/rust-toolchain@master + with: + toolchain: ${{ env.RUST_TOOLCHAIN }} + - name: Rust Cache + uses: Swatinem/rust-cache@v2 + with: + # Shares across multiple jobs + shared-key: "fuzz-test-targets" + - name: Set Rust Fuzz + shell: bash + run: | + sudo apt-get install -y libfuzzer-14-dev + rustup install nightly + cargo +nightly install cargo-fuzz + # Downloads ci image - name: Download pre-built binariy uses: actions/download-artifact@v4 with: @@ -286,10 +311,32 @@ jobs: run: tar -xvf ./bin.tar.gz - name: Build and push GreptimeDB image uses: ./.github/actions/build-and-push-ci-image + - name: Wait for etcd + run: | + kubectl wait \ + --for=condition=Ready \ + pod -l app.kubernetes.io/instance=etcd \ + --timeout=120s \ + -n etcd-cluster + - name: Print etcd info + shell: bash + run: kubectl get all --show-labels -n etcd-cluster + # Setup cluster for test - name: Setup GreptimeDB cluster uses: ./.github/actions/setup-greptimedb-cluster with: image-registry: localhost:5001 + - name: Port forward (mysql) + run: | + kubectl port-forward service/my-greptimedb-frontend 4002:4002 -n my-greptimedb& + - name: Fuzz Test + uses: ./.github/actions/fuzz-test + env: + CUSTOM_LIBFUZZER_PATH: /usr/lib/llvm-14/lib/libFuzzer.a + GT_MYSQL_ADDR: 127.0.0.1:4002 + with: + target: ${{ matrix.target }} + max-total-time: 120 sqlness: name: Sqlness Test From 9aaed80beac76229f4aaf07d06ab104ccdc53ef9 Mon Sep 17 00:00:00 2001 From: Weny Xu Date: Tue, 21 May 2024 00:17:38 +0800 Subject: [PATCH 08/10] Apply suggestions from code review --- .github/actions/setup-etcd-cluster/action.yml | 2 +- .github/actions/setup-greptimedb-cluster/action.yml | 2 +- .github/actions/setup-kind/action.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/actions/setup-etcd-cluster/action.yml b/.github/actions/setup-etcd-cluster/action.yml index d78448a35e64..dfc9a29a2f32 100644 --- a/.github/actions/setup-etcd-cluster/action.yml +++ b/.github/actions/setup-etcd-cluster/action.yml @@ -20,4 +20,4 @@ runs: --set auth.rbac.token.enabled=false \ --set persistence.size=1Gi \ --create-namespace \ - -n ${{ inputs.namespace }} \ No newline at end of file + -n ${{ inputs.namespace }} diff --git a/.github/actions/setup-greptimedb-cluster/action.yml b/.github/actions/setup-greptimedb-cluster/action.yml index fad01b826871..bc0bb795a31c 100644 --- a/.github/actions/setup-greptimedb-cluster/action.yml +++ b/.github/actions/setup-greptimedb-cluster/action.yml @@ -90,4 +90,4 @@ runs: with: name: kind-logs path: /tmp/kind - retention-days: 3 \ No newline at end of file + retention-days: 3 diff --git a/.github/actions/setup-kind/action.yml b/.github/actions/setup-kind/action.yml index ae1b71ea4ad2..d5e8d6c50894 100644 --- a/.github/actions/setup-kind/action.yml +++ b/.github/actions/setup-kind/action.yml @@ -13,4 +13,4 @@ runs: - name: Create kind cluster shell: bash run: | - ./.github/scripts/kind-with-registry.sh \ No newline at end of file + ./.github/scripts/kind-with-registry.sh From aef9c5c02e9dbc8507aeb16ff014507a6ede80f3 Mon Sep 17 00:00:00 2001 From: WenyXu Date: Tue, 21 May 2024 03:22:59 +0000 Subject: [PATCH 09/10] chore: apply suggestions from CR --- .github/actions/build-and-push-ci-image/action.yml | 2 +- .github/actions/setup-kind/action.yml | 6 ------ docker/ci/ubuntu/{Dockerfile.ci => Dockerfile.fuzztests} | 0 3 files changed, 1 insertion(+), 7 deletions(-) rename docker/ci/ubuntu/{Dockerfile.ci => Dockerfile.fuzztests} (100%) diff --git a/.github/actions/build-and-push-ci-image/action.yml b/.github/actions/build-and-push-ci-image/action.yml index 5c7d0532ce02..4eb85fc68420 100644 --- a/.github/actions/build-and-push-ci-image/action.yml +++ b/.github/actions/build-and-push-ci-image/action.yml @@ -11,7 +11,7 @@ runs: uses: docker/build-push-action@v5 with: context: . - file: ./docker/ci/ubuntu/Dockerfile.ci + file: ./docker/ci/ubuntu/Dockerfile.fuzztests push: true tags: localhost:5001/greptime/greptimedb:latest build-args: | diff --git a/.github/actions/setup-kind/action.yml b/.github/actions/setup-kind/action.yml index d5e8d6c50894..f42731ca6db4 100644 --- a/.github/actions/setup-kind/action.yml +++ b/.github/actions/setup-kind/action.yml @@ -4,12 +4,6 @@ runs: using: composite steps: - uses: actions/checkout@v4 - - name: Install Kind - shell: bash - run: | - [ $(uname -m) = x86_64 ] && curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.23.0/kind-linux-amd64 - chmod +x ./kind - sudo mv ./kind /usr/local/bin/kind - name: Create kind cluster shell: bash run: | diff --git a/docker/ci/ubuntu/Dockerfile.ci b/docker/ci/ubuntu/Dockerfile.fuzztests similarity index 100% rename from docker/ci/ubuntu/Dockerfile.ci rename to docker/ci/ubuntu/Dockerfile.fuzztests From 66e55309806b4b8f902539b9494621347db49417 Mon Sep 17 00:00:00 2001 From: WenyXu Date: Tue, 21 May 2024 04:44:46 +0000 Subject: [PATCH 10/10] chore(ci): upload logs --- .github/actions/setup-greptimedb-cluster/action.yml | 12 ------------ .github/workflows/develop.yml | 13 +++++++++++++ 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/.github/actions/setup-greptimedb-cluster/action.yml b/.github/actions/setup-greptimedb-cluster/action.yml index bc0bb795a31c..709738b7c85c 100644 --- a/.github/actions/setup-greptimedb-cluster/action.yml +++ b/.github/actions/setup-greptimedb-cluster/action.yml @@ -79,15 +79,3 @@ runs: shell: bash run: | kubectl get all --show-labels -n my-greptimedb - - name: Export kind logs - if: failure() - shell: bash - run: | - kind export logs /tmp/kind - - name: Upload logs - if: failure() - uses: actions/upload-artifact@v4 - with: - name: kind-logs - path: /tmp/kind - retention-days: 3 diff --git a/.github/workflows/develop.yml b/.github/workflows/develop.yml index 56068fca330b..d20ec18b8b7f 100644 --- a/.github/workflows/develop.yml +++ b/.github/workflows/develop.yml @@ -337,6 +337,19 @@ jobs: with: target: ${{ matrix.target }} max-total-time: 120 + - name: Export kind logs + if: failure() + shell: bash + run: | + kind export logs /tmp/kind + - name: Upload logs + if: failure() + uses: actions/upload-artifact@v4 + with: + name: fuzz-tests-kind-logs-${{ matrix.target }} + path: /tmp/kind + retention-days: 3 + sqlness: name: Sqlness Test