Crash #972
This file contains hidden or 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: Crash | |
| on: | |
| push: | |
| branches: [ "*" ] | |
| schedule: | |
| # every day at 12 CET | |
| - cron: "0 14 * * *" | |
| workflow_dispatch: | |
| inputs: | |
| qdrant_version: | |
| description: "Version of qdrant to checkout (tags/v1.6.1, <commit-id>, my-branch)" | |
| default: dev | |
| crashing_time: | |
| description: "Duration in seconds, default is 3600s (1h)" | |
| default: 3600 | |
| crash_probability: | |
| description: "Probability to crash, default is 0.3 (30%)" | |
| default: 0.3 | |
| points_count: | |
| description: "Number of points to insert" | |
| default: 5000 | |
| env: | |
| CARGO_TERM_COLOR: always | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Process inputs | |
| id: default_inputs | |
| run: | | |
| qdrant_version="${{ inputs.qdrant_version }}" | |
| if [ -z "$qdrant_version" ]; then | |
| qdrant_version=dev | |
| fi | |
| crashing_time="${{ inputs.crashing_time }}" | |
| if [ -z "$crashing_time" ]; then | |
| crashing_time=3600 | |
| fi | |
| crash_probability="${{ inputs.crash_probability }}" | |
| if [ -z "$crash_probability" ]; then | |
| crash_probability=0.3 | |
| fi | |
| points_count="${{ inputs.points_count }}" | |
| if [ -z "$points_count" ]; then | |
| points_count=5000 | |
| fi | |
| echo "qdrant_version=$qdrant_version" >> $GITHUB_OUTPUT | |
| echo "crashing_time=$crashing_time" >> $GITHUB_OUTPUT | |
| echo "crash_probability=$crash_probability" >> $GITHUB_OUTPUT | |
| echo "points_count=$points_count" >> $GITHUB_OUTPUT | |
| - name: Install minimal stable | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Install mold | |
| uses: rui314/setup-mold@v1 | |
| - name: Enable mold on Linux | |
| run: | | |
| if [[ "${{ matrix.os }}" == "ubuntu-latest" ]]; then | |
| mkdir .cargo | |
| echo "[target.x86_64-unknown-linux-gnu]" >> .cargo/config.toml | |
| echo "linker = \"clang\"" >> .cargo/config.toml | |
| echo "rustflags = [\"-C\", \"link-arg=-fuse-ld=/usr/local/bin/mold\"]" >> .cargo/config.toml | |
| fi | |
| shell: bash | |
| - name: Install Protoc | |
| uses: arduino/setup-protoc@v3 | |
| with: | |
| repo-token: ${{ secrets.GITHUB_TOKEN }} | |
| # checkout crasher | |
| - name: Checkout Crasher | |
| uses: actions/checkout@v5 | |
| # checkout qdrant dev | |
| - name: Checkout Qdrant | |
| uses: actions/checkout@v5 | |
| with: | |
| repository: qdrant/qdrant | |
| ref: ${{ steps.default_inputs.outputs.qdrant_version }} | |
| path: ./qdrant-src | |
| - name: Cache deps | |
| uses: Swatinem/rust-cache@v2 | |
| with: | |
| workspaces: | | |
| /home/runner/work/crasher/crasher | |
| /home/runner/work/crasher/crasher/qdrant-src | |
| - name: Build Crasher (release) | |
| run: cargo build --release | |
| - name: Build Qdrant (debug) | |
| working-directory: /home/runner/work/crasher/crasher/qdrant-src | |
| # disable deadlock detector until we sort out https://github.com/Amanieu/parking_lot/issues/489 | |
| # run: cargo build --features "service_debug" | |
| run: cargo build | |
| - name: Crash things | |
| working-directory: /home/runner/work/crasher/crasher | |
| shell: bash | |
| run: | | |
| mkdir qdrant | |
| cp -r qdrant-src/config qdrant | |
| crashing_time="${{ steps.default_inputs.outputs.crashing_time }}" | |
| crash_probability="${{ steps.default_inputs.outputs.crash_probability }}" | |
| points_count="${{ steps.default_inputs.outputs.points_count }}" | |
| backup_storage_dir="${{ format('{0}/qdrant/storage-backup', github.workspace) }}" | |
| ./crash-things.sh qdrant ../qdrant-src/target/debug/qdrant "$crash_probability" "$crashing_time" "$points_count" "$backup_storage_dir" | |
| - name: Upload logs on failure | |
| uses: actions/upload-artifact@v4 | |
| if: failure() || cancelled() | |
| with: | |
| name: logs | |
| retention-days: 90 # default max value | |
| path: | | |
| crasher.log | |
| qdrant.log | |
| - name: Upload Qdrant workdir on failure | |
| uses: actions/upload-artifact@v4 | |
| if: failure() || cancelled() | |
| with: | |
| name: qdrant-workdir | |
| retention-days: 10 | |
| path: | | |
| qdrant/ | |
| - name: Send Notification | |
| if: failure() || cancelled() | |
| uses: slackapi/slack-github-action@v1.26.0 | |
| with: | |
| payload: | | |
| { | |
| "text": "Crasher run status: ${{ job.status }}", | |
| "blocks": [ | |
| { | |
| "type": "section", | |
| "text": { | |
| "type": "mrkdwn", | |
| "text": "Something is wrong.\nView the results <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|here>" | |
| } | |
| } | |
| ] | |
| } | |
| env: | |
| SLACK_WEBHOOK_URL: ${{ secrets.CRASHER_CHANNEL_WEBHOOK_URL }} | |
| SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK |