-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
introduce GitHub Action for CRON execution to detect regressions #8
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
fa92f87
introduce GitHub Action for CRON execution to detect regressions
agourlay 59c6a6c
retrigger
agourlay 817e954
permissions
agourlay d78c90f
fix
agourlay 665b088
fix
agourlay 2311a88
don't give up
agourlay 37afde8
version arg abd bump number of concurrent workload
agourlay File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
name: Coach | ||
|
||
on: | ||
push: | ||
branches: [ "master", "automation" ] | ||
schedule: | ||
# every day at 12 CET | ||
- cron: "0 14 * * *" | ||
workflow_dispatch: | ||
inputs: | ||
qdrant_version: | ||
description: "Version of qdrant to pull the container for (tags/v1.6.1, <commit-id>, my-branch)" | ||
default: dev | ||
coaching_time: | ||
description: "Duration in seconds, default is 3600s (60 min) " | ||
default: 3600 | ||
|
||
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 | ||
|
||
coaching_time="${{ inputs.coaching_time }}" | ||
if [ -z "$coaching_time" ]; then | ||
coaching_time=3600 | ||
fi | ||
|
||
echo "qdrant_version=$qdrant_version" >> $GITHUB_OUTPUT | ||
echo "coaching_time=$coaching_time" >> $GITHUB_OUTPUT | ||
- name: Install minimal stable | ||
uses: dtolnay/rust-toolchain@stable | ||
# checkout coach | ||
- name: Checkout Coach | ||
uses: actions/checkout@v4 | ||
- name: Build Coach (release) | ||
run: cargo build --release | ||
- name: Coach things | ||
shell: bash | ||
run: | | ||
coaching_time="${{ steps.default_inputs.outputs.coaching_time }}" | ||
qdrant_version="${{ steps.default_inputs.outputs.qdrant_version }}" | ||
|
||
./coach-things.sh "$coaching_time" "$qdrant_version" | ||
- name: Send Notification | ||
if: failure() || cancelled() | ||
uses: slackapi/[email protected] | ||
with: | ||
payload: | | ||
{ | ||
"text": "Coach 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.COACH_CHANNEL_WEBHOOK_URL }} | ||
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
|
||
RUN_TIME=${1:-300} | ||
QDRANT_VERSION=${2:-dev} | ||
|
||
REST_PORT="6333" | ||
GRPC_PORT="6334" | ||
QDRANT_HOST=localhost:${REST_PORT} | ||
|
||
echo "Running for $RUN_TIME seconds" | ||
echo "QDRANT_HOST: $QDRANT_HOST" | ||
echo "QDRANT_VERSION: $QDRANT_VERSION" | ||
|
||
# start qdrant docker | ||
docker run -d --rm \ | ||
-p ${REST_PORT}:${REST_PORT} \ | ||
-p ${GRPC_PORT}:${GRPC_PORT} \ | ||
-e QDRANT__SERVICE__GRPC_PORT=${GRPC_PORT} \ | ||
--name qdrant_test qdrant/qdrant:"${QDRANT_VERSION}" ./qdrant --disable-telemetry | ||
|
||
trap stop_docker SIGINT | ||
trap stop_docker ERR | ||
|
||
until $(curl --output /dev/null --silent --get --fail http://$QDRANT_HOST/collections); do | ||
printf 'waiting for server to start...' | ||
sleep 5 | ||
done | ||
|
||
# start coach against qdrant | ||
COACH_CMD=( | ||
cargo run --release | ||
-- | ||
-p 2 # number of concurrent workloads | ||
--stop-at-first-error | ||
--grpc-timeout-ms 10000 | ||
--grpc-health-check-timeout-ms 1000 | ||
) | ||
|
||
echo "" | ||
echo "${COACH_CMD[*]}" | ||
"${COACH_CMD[@]}" & | ||
|
||
pid=$! | ||
|
||
echo "The coach PID is $pid" | ||
|
||
function cleanup() { | ||
if ps -p $pid >/dev/null | ||
then | ||
kill -KILL $pid | ||
stop_docker | ||
fi | ||
} | ||
|
||
function stop_docker() | ||
{ | ||
echo "stopping qdrant_test" | ||
docker stop qdrant_test | ||
} | ||
|
||
|
||
trap cleanup EXIT | ||
|
||
trap 'exit $?' ERR | ||
trap exit INT | ||
|
||
started=$(date +%s) | ||
|
||
while ps -p $pid >/dev/null && (( $(date +%s) - started < RUN_TIME )) | ||
do | ||
sleep 10 | ||
done | ||
|
||
if ps -p $pid >/dev/null | ||
then | ||
echo "The process is still running. Stopping the process..." | ||
kill $pid | ||
stop_docker | ||
echo "OK" | ||
else | ||
echo "The process has unexpectedly terminated on its own. Check the logs." | ||
stop_docker | ||
exit 1 | ||
fi |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this one needs additional setup
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I created a new webhook, ping me to get an url