Skip to content

Commit 5ffb45a

Browse files
committed
feature: clone qdrant from offset script
1 parent 7bbc0be commit 5ffb45a

5 files changed

Lines changed: 433 additions & 1 deletion

File tree

.github/workflows/push-server.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1032,3 +1032,53 @@ jobs:
10321032
push: true
10331033
tags: ${{ steps.meta.outputs.tags }}
10341034
labels: ${{ steps.meta.outputs.labels }}
1035+
1036+
clone-qdrant-from-offset:
1037+
name: Push Clone From Offset
1038+
runs-on: ${{ matrix.runner }}
1039+
strategy:
1040+
matrix:
1041+
include:
1042+
- runner: blacksmith-8vcpu-ubuntu-2204
1043+
platform: linux/amd64
1044+
tag: latest
1045+
# - runner: blacksmith-8vcpu-ubuntu-2204
1046+
# platform: linux/arm64
1047+
# tag: latest-arm
1048+
# suffix: -arm
1049+
steps:
1050+
- name: Checkout the repo
1051+
uses: actions/checkout@v4
1052+
1053+
# - name: Set up QEMU
1054+
# uses: docker/setup-qemu-action@v3
1055+
1056+
- name: Setup buildx
1057+
uses: docker/setup-buildx-action@v3
1058+
1059+
- name: Login to Docker Hub
1060+
uses: docker/login-action@v3
1061+
with:
1062+
username: ${{ secrets.DOCKER_USERNAME }}
1063+
password: ${{ secrets.DOCKER_PASSWORD }}
1064+
1065+
- name: Docker meta
1066+
id: meta
1067+
uses: docker/metadata-action@v5
1068+
with:
1069+
# list of Docker images to use as base name for tags
1070+
images: |
1071+
trieve/clone-qdrant-from-offset
1072+
tags: |
1073+
type=raw,${{matrix.tag}}
1074+
type=sha,suffix=${{matrix.suffix}}
1075+
1076+
- name: Build and push Docker image
1077+
uses: useblacksmith/build-push-action@v1.0.0-beta
1078+
with:
1079+
platforms: ${{ matrix.platform }}
1080+
context: server/
1081+
file: ./server/Dockerfile.clone-qdrant-from-offset
1082+
push: true
1083+
tags: ${{ steps.meta.outputs.tags }}
1084+
labels: ${{ steps.meta.outputs.labels }}

server/Cargo.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,10 @@ path = "src/bin/backfill-qdrant-from-pg.rs"
8989
name = "send-stripe-billing"
9090
path = "src/bin/send-stripe-billing.rs"
9191

92+
[[bin]]
93+
name = "clone-qdrant-from-offset"
94+
path = "src/bin/clone-qdrant-from-offset.rs"
95+
9296
[dependencies]
9397
actix-identity = { version = "0.7.1" }
9498
actix-session = { version = "0.9.0", features = [

server/Dockerfile.backfill-qdrant-from-pg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ FROM rust:1.81-slim-bookworm AS chef
33
# it will be cached from the second build onwards
44
RUN apt-get update -y && apt-get -y install pkg-config libssl-dev libpq-dev g++ curl
55
RUN cargo install cargo-chef
6-
WORKDIR app
6+
WORKDIR /app
77

88
FROM chef AS planner
99
COPY . .
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
FROM rust:1.81-slim-bookworm AS chef
2+
# We only pay the installation cost once,
3+
# it will be cached from the second build onwards
4+
RUN apt-get update -y && apt-get -y install pkg-config libssl-dev libpq-dev g++ curl
5+
RUN cargo install cargo-chef
6+
WORKDIR /app
7+
8+
FROM chef AS planner
9+
COPY . .
10+
RUN cargo chef prepare --recipe-path recipe.json
11+
12+
FROM chef AS builder
13+
COPY --from=planner /app/recipe.json recipe.json
14+
# Build dependencies - this is the caching Docker layer!
15+
RUN cargo chef cook --release --recipe-path recipe.json --bin "clone-qdrant-from-offset"
16+
# Build application
17+
COPY . .
18+
RUN cargo build --release --features "runtime-env" --bin "clone-qdrant-from-offset"
19+
20+
FROM debian:bookworm-slim as runtime
21+
RUN apt-get update -y && apt-get -y install pkg-config libssl-dev libpq-dev ca-certificates
22+
WORKDIR /app
23+
COPY ./migrations/ /app/migrations
24+
COPY --from=builder /app/target/release/backfill-qdrant-from-offset /app/backfill-qdrant-from-offset
25+
26+
27+
EXPOSE 8090
28+
ENTRYPOINT ["/app/clone-qdrant-from-offset"]

0 commit comments

Comments
 (0)