Skip to content

Commit 9d0fc40

Browse files
committed
feat: Optimize CI benchmarks workflow
1 parent 2a653f7 commit 9d0fc40

File tree

5 files changed

+32
-29
lines changed

5 files changed

+32
-29
lines changed

.github/workflows/continuous-benchmark.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ jobs:
1515
- uses: webfactory/[email protected]
1616
with:
1717
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
18+
- name: Setup CI
19+
run: bash -x tools/setup_ci.sh
1820
- name: Benches
1921
run: |
2022
export HCLOUD_TOKEN=${{ secrets.HCLOUD_TOKEN }}

tools/run_ci.sh

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -7,27 +7,6 @@ set -e
77
SCRIPT=$(realpath "$0")
88
SCRIPT_PATH=$(dirname "$SCRIPT")
99

10-
# Set up dependencies
11-
12-
sudo apt update
13-
sudo apt install -y jq
14-
15-
# Download and install hcloud
16-
17-
HCVERSION=v1.36.0
18-
19-
wget https://github.com/hetznercloud/cli/releases/download/${HCVERSION}/hcloud-linux-amd64.tar.gz
20-
21-
tar xzf hcloud-linux-amd64.tar.gz
22-
23-
sudo mv hcloud /usr/local/bin
24-
25-
# Install mc
26-
27-
wget https://dl.min.io/client/mc/release/linux-amd64/mc
28-
chmod +x mc
29-
./mc alias set qdrant https://storage.googleapis.com "${GCS_KEY}" "${GCS_SECRET}"
30-
3110
bash -x "${SCRIPT_PATH}/run_remote_benchmark.sh"
3211

3312
./mc cp results/* qdrant/vector-search-engines-benchmark/results/ci/qdrant/

tools/run_experiment.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#!/bin/bash
22

3-
ENGINE_NAME=${ENGINE_NAME:-"qdrant-default"}
3+
set -e
4+
5+
ENGINE_NAME=${ENGINE_NAME:-"qdrant-continuous-benchmark"}
46

57
DATASETS=${DATASETS:-""}
68

tools/run_server_container.sh

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
set -e
44

5-
# Examples: qdrant-single-node
5+
# Examples: qdrant-continuous-benchmarks
66
CONTAINER_NAME=$1
77

88
CLOUD_NAME=${CLOUD_NAME:-"hetzner"}
@@ -20,7 +20,7 @@ IP_OF_THE_SERVER=$(bash "${SCRIPT_PATH}/${CLOUD_NAME}/get_public_ip.sh" "$BENCH_
2020

2121
bash -x "${SCRIPT_PATH}/sync_servers.sh" "root@$IP_OF_THE_SERVER"
2222

23-
# if version is dev or if starts with "docker" or "ghcr", use container
23+
# if version is starts with "docker" or "ghcr", use container
2424
if [[ ${QDRANT_VERSION} == docker/* ]] || [[ ${QDRANT_VERSION} == ghcr/* ]]; then
2525

2626
if [[ ${QDRANT_VERSION} == docker/* ]]; then
@@ -33,11 +33,9 @@ if [[ ${QDRANT_VERSION} == docker/* ]] || [[ ${QDRANT_VERSION} == ghcr/* ]]; the
3333
CONTAINER_REGISTRY='ghcr.io'
3434
fi
3535

36-
DOCKER_COMPOSE="export QDRANT_VERSION=${QDRANT_VERSION}; export CONTAINER_REGISTRY=${CONTAINER_REGISTRY}; docker compose down ; pkill qdrant ; docker rmi ${CONTAINER_REGISTRY}/qdrant/qdrant:${QDRANT_VERSION} || true ; docker compose up -d"
36+
DOCKER_COMPOSE="export QDRANT_VERSION=${QDRANT_VERSION}; export CONTAINER_REGISTRY=${CONTAINER_REGISTRY}; docker compose down; pkill qdrant ; docker rmi ${CONTAINER_REGISTRY}/qdrant/qdrant:${QDRANT_VERSION} || true ; docker compose up -d; docker container ls"
3737
ssh -t "${SERVER_USERNAME}@${IP_OF_THE_SERVER}" "cd ./projects/vector-db-benchmark/engine/servers/${CONTAINER_NAME} ; $DOCKER_COMPOSE"
3838
else
39-
# else run natively in the server
40-
DOCKER_QDRANT_STOP="docker stop qdrant-continuous || true"
41-
QDRANT_BUILD="source ~/.cargo/env; git fetch --tags; git checkout ${QDRANT_VERSION}; git pull; mold -run cargo run --bin qdrant --release"
42-
ssh -t "${SERVER_USERNAME}@${IP_OF_THE_SERVER}" "cd ./projects/qdrant; ${DOCKER_QDRANT_STOP}; $QDRANT_BUILD"
39+
echo "Error: unknown version ${QDRANT_VERSION}. Version name should start with 'docker/' or 'ghcr/'"
40+
exit 1
4341
fi

tools/setup_ci.sh

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/bin/bash
2+
3+
# Set up dependencies
4+
5+
sudo apt update
6+
sudo apt install -y jq
7+
8+
# Download and install hcloud
9+
10+
HCVERSION=v1.36.0
11+
12+
wget https://github.com/hetznercloud/cli/releases/download/${HCVERSION}/hcloud-linux-amd64.tar.gz
13+
14+
tar xzf hcloud-linux-amd64.tar.gz
15+
16+
sudo mv hcloud /usr/local/bin
17+
18+
# Install mc
19+
20+
wget https://dl.min.io/client/mc/release/linux-amd64/mc
21+
chmod +x mc
22+
./mc alias set qdrant https://storage.googleapis.com "${GCS_KEY}" "${GCS_SECRET}"

0 commit comments

Comments
 (0)