Skip to content

Crash

Crash #332

Workflow file for this run

name: Crash
on:
push:
branches: [ "master" ]
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
backup_working_dir:
description: "Backup working dir before each Qdrant restart"
type: boolean
default: false
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
echo "qdrant_version=$qdrant_version" >> $GITHUB_OUTPUT
echo "crashing_time=$crashing_time" >> $GITHUB_OUTPUT
- name: Install minimal stable
uses: dtolnay/rust-toolchain@stable
- name: Install Protoc
uses: arduino/setup-protoc@v3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
# checkout crasher
- name: Checkout Crasher
uses: actions/checkout@v4
# checkout qdrant dev
- name: Checkout Qdrant
uses: actions/checkout@v4
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
run: cargo build --features "service_debug data-consistency-check"
- 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 }}"
backup_working_dir="${{ inputs.backup_working_dir && 'qdrant-backup' }}"
./crash-things.sh qdrant ../qdrant-src/target/debug/qdrant 0.3 "$crashing_time" ${backup_working_dir:+"$backup_working_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/
qdrant-backup/
- name: Send Notification
if: failure() || cancelled()
uses: slackapi/[email protected]
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