From d357a4325a92049ab3f8e896f3b846ad22059261 Mon Sep 17 00:00:00 2001 From: Lorenzo Mangani Date: Mon, 10 Jun 2024 13:13:36 +0200 Subject: [PATCH] Create k6-All-multiarch.yml --- .github/workflows/k6-All-multiarch.yml | 147 +++++++++++++++++++++++++ 1 file changed, 147 insertions(+) create mode 100644 .github/workflows/k6-All-multiarch.yml diff --git a/.github/workflows/k6-All-multiarch.yml b/.github/workflows/k6-All-multiarch.yml new file mode 100644 index 0000000..e596c5a --- /dev/null +++ b/.github/workflows/k6-All-multiarch.yml @@ -0,0 +1,147 @@ +name: K6 All-In-One (MULTI-ARCH) +on: + workflow_dispatch: + inputs: + qryn_tag: + description: 'Build/Tag for qryn (latest)' + required: false + clickhouse_tag: + description: 'BuildTag for ClickHouse (latest)' + required: false + +jobs: + build: + strategy: + matrix: + os: [ubuntu-latest, ARM64] + name: Run k6 on qryn:latest + runs-on: ${{ matrix.os }} + env: + QRYN_VERSION: "clickhouse/clickhouse-server:${{ github.event.inputs.qryn_tag || 'latest' }}" + CLICKHOUSE_VERSION: "qxip/qryn:${{ github.event.inputs.clickhouse_tag || 'latest' }}" + services: + clickhouse: + image: "clickhouse/clickhouse-server:${{ github.event.inputs.clickhouse_tag || 'latest' }}" + ports: + - 8123:8123 + qryn: + image: "qxip/qryn:${{ github.event.inputs.qryn_tag || 'latest' }}" + ports: + - 3100:3100 + env: + CLICKHOUSE_SERVER: clickhouse + + steps: + - name: Checkout + uses: actions/checkout@v4.1.6 + with: + repository: metrico/qryn-bench + path: . + - uses: actions/setup-go@v5.0.1 + with: + go-version: '1.20' + - name: Download k6 x86 + if: ${{ matrix.os != 'ARM64' }} + run: | + wget https://github.com/metrico/qryn-bench/releases/download/latest/k6 -O k6 + chmod +x k6 + - name: Download k6 ARM64 + if: ${{ matrix.os != 'ubuntu-latest' }} + run: | + wget https://github.com/metrico/qryn-bench/releases/download/latest/k6-arm64 -O k6 + chmod +x k6 + - name: Download k6 for Tracing x86 + if: ${{ matrix.os != 'ARM64' }} + run: | + wget https://github.com/metrico/qryn-bench/releases/download/latest/k6-tracing -O k6-tracing + chmod +x k6-tracing + - name: Download k6 for Tracing ARM64 + if: ${{ matrix.os != 'ubuntu-latest'' }} + run: | + wget https://github.com/metrico/qryn-bench/releases/download/latest/k6-tracing-arm64 -O k6-tracing + chmod +x k6-tracing + + - name: Collect Workflow Telemetry + uses: runforesight/workflow-telemetry-action@v2.0.0 + + - name: Wait for Loki API + uses: mydea/action-wait-for-api@v1.0.0 + with: + url: "http://localhost:3100/loki/api/v1/label" + expected-response-field: "status" + expected-response-field-value: "success" + timeout: 30 + - name: Run k6 loki test + run: ./k6 run --out csv=results.csv loki/qryn-loki-loadtest.js + env: + K6_VUS: 1 + K6_ITERACTIONS: 150 + - run: mv summary.txt loki_summary.txt + if: always() + - name: Wait for Prom API + uses: mydea/action-wait-for-api@v1.0.0 + with: + url: "http://localhost:3100/api/v1/query" + expected-response-field: "status" + expected-response-field-value: "success" + timeout: 30 + - name: Run k6 prometheus test + run: ./k6 run --out csv=results.csv prometheus/qryn-loadtest.js + env: + K6_WRITE_HOSTNAME: "localhost:3100" + K6_READ_HOSTNAME: "localhost:3100" + K6_WRITE_REQUEST_RATE: 1 + K6_WRITE_SERIES_PER_REQUEST: 15 + K6_READ_REQUEST_RATE: 1 + K6_DURATION_MIN: 3 + K6_SCRAPE_INTERVAL_SECONDS: 15 + RAMP_UP_MIN: 1 + - run: mv summary.txt prom_summary.txt + if: always() + - name: Wait for Tempo API + uses: mydea/action-wait-for-api@v1.0.0 + with: + url: "http://localhost:3100/api/search/tags" + - name: Run k6 tempo test + run: ./k6-tracing run --out csv=results.csv tempo/qryn-tempo-template.js + env: + K6_TEMPO_ENDPOINT: "http://localhost:3100" + K6_VUS: 1 + K6_DURATION_MINUTES: 2 + K6_ITERATIONS: 50 + - run: mv summary.txt tempo_summary.txt + if: always() + - name: Strip Text report + if: always() + run: | + sed -i 's/[^[:print:]]/*/' *_summary.txt + sed -i 's/[\d128-\d255]//g' *_summary.txt + - uses: actions/upload-artifact@v4.3.3 + if: always() + with: + name: results + path: | + loki_summary.txt + prom_summary.txt + tempo_summary.txt + - name: Summary Report + if: always() + run: | + echo "### qryn image" >> $GITHUB_STEP_SUMMARY + echo "qxip/qryn:${{ github.event.inputs.qryn_tag || 'latest' }}" >> $GITHUB_STEP_SUMMARY + echo "" >> $GITHUB_STEP_SUMMARY + echo "### cowsdb image" >> $GITHUB_STEP_SUMMARY + echo "${{ github.event.inputs.clickhouse_image || 'clickhouse/clickhouse-server' }}:${{ github.event.inputs.clickhouse_tag || 'latest' }}" >> $GITHUB_STEP_SUMMARY + echo "" >> $GITHUB_STEP_SUMMARY + echo "### Loki Test" >> $GITHUB_STEP_SUMMARY + cat loki_summary.txt >> $GITHUB_STEP_SUMMARY + echo "" >> $GITHUB_STEP_SUMMARY + echo "### Prometheus Test" >> $GITHUB_STEP_SUMMARY + cat prom_summary.txt >> $GITHUB_STEP_SUMMARY + echo "" >> $GITHUB_STEP_SUMMARY + echo "### Tempo Test" >> $GITHUB_STEP_SUMMARY + cat tempo_summary.txt >> $GITHUB_STEP_SUMMARY + - name: Pull Docker logs + run: | + docker logs "${{ job.services.clickhouse.id }}" + docker logs "${{ job.services.qryn.id }}"