Skip to content

Commit 7e612e8

Browse files
bashofmannAnush008
andauthored
ci: Only distribute the tool as a container image (#56)
* Only distribute the tool as a container image We can not build static binaries with Chroma. * fix: Docker build with CC Signed-off-by: Anush008 <anushshetty90@gmail.com> * Fix trivy scan * Fix tests * Fix tests --------- Signed-off-by: Anush008 <anushshetty90@gmail.com> Co-authored-by: Anush008 <anushshetty90@gmail.com>
1 parent 04c5ae2 commit 7e612e8

File tree

7 files changed

+70
-103
lines changed

7 files changed

+70
-103
lines changed

.github/workflows/pr-workflow.yaml

Lines changed: 46 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,6 @@ jobs:
3030
version: v2.1.2 # Specify the golangci-lint version, so we are stable
3131
args: --timeout 10m # Increase the timeout to 10 minutes
3232

33-
- name: Run Trivy vulnerability scanner in repo mode
34-
uses: aquasecurity/trivy-action@master
35-
with:
36-
scan-type: 'fs'
37-
exit-code: '1'
38-
ignore-unfixed: true
39-
format: 'table'
40-
vuln-type: 'os,library'
41-
severity: 'CRITICAL,HIGH'
42-
4333
tests:
4434
name: Tests
4535
runs-on: ubuntu-latest
@@ -56,6 +46,52 @@ jobs:
5646
run: |
5747
make test_unit
5848
49+
- name: Set up QEMU
50+
uses: docker/setup-qemu-action@v3
51+
- name: Set up Docker Buildx
52+
uses: docker/setup-buildx-action@v3
53+
54+
- name: Extract build info
55+
id: extract_build_info
56+
run: |
57+
echo "tag=${GITHUB_REF##*/}" >> $GITHUB_OUTPUT
58+
echo "commit_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
59+
60+
- name: Set Docker metadata
61+
id: meta
62+
uses: docker/metadata-action@v5
63+
with:
64+
images: |
65+
registry.cloud.qdrant.io/library/qdrant-migration
66+
tags: |
67+
type=raw,value=dev
68+
69+
- name: Build and push container image
70+
uses: docker/build-push-action@v6
71+
id: build-and-push
72+
with:
73+
context: .
74+
push: false
75+
load: true
76+
sbom: false
77+
provenance: false
78+
platforms: linux/amd64
79+
labels: ${{ steps.meta.outputs.labels }}
80+
tags: ${{ steps.meta.outputs.tags }}
81+
build-args: |
82+
VERSION=dev
83+
BUILD=${{ steps.extract_build_info.outputs.commit_short }}
84+
85+
- name: Run Trivy vulnerability scanner
86+
uses: aquasecurity/trivy-action@master
87+
with:
88+
image-ref: registry.cloud.qdrant.io/library/qdrant-migration:dev
89+
format: 'table'
90+
exit-code: '1'
91+
ignore-unfixed: true
92+
vuln-type: 'os,library'
93+
severity: 'CRITICAL,HIGH'
94+
5995
- name: Setup BATS
6096
uses: mig4/setup-bats@v1
6197
with:

.github/workflows/release-workflow.yaml

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,6 @@ jobs:
2424
echo "tag=${GITHUB_REF##*/}" >> $GITHUB_OUTPUT
2525
echo "commit_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
2626
27-
- uses: actions/setup-go@v5
28-
with:
29-
go-version: '1.24'
30-
cache: false
31-
32-
- name: Build Binaries
33-
run: |
34-
make release VERSION="${{ steps.extract_build_info.outputs.tag }}" BUILD="${{ steps.extract_build_info.outputs.commit_short }}"
35-
3627
- name: Set up QEMU
3728
uses: docker/setup-qemu-action@v3
3829
- name: Set up Docker Buildx
@@ -95,11 +86,3 @@ jobs:
9586
publish: true
9687
env:
9788
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
98-
99-
- name: Upload Release Artifacts
100-
run: |
101-
for file in dist/*; do
102-
gh release upload --clobber ${{ steps.extract_build_info.outputs.tag }} $file
103-
done
104-
env:
105-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Dockerfile

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# syntax=docker/dockerfile:1
22
ARG BUILDKIT_SBOM_SCAN_CONTEXT=true
33
ARG BUILDKIT_SBOM_SCAN_STAGE=builder
4-
FROM --platform=${BUILDPLATFORM:-linux/amd64} registry.suse.com/bci/golang:1.24 AS builder
4+
FROM --platform=${BUILDPLATFORM:-linux/amd64} golang:1.24 AS builder
55

66
ARG TARGETPLATFORM
77
ARG BUILDPLATFORM
@@ -10,11 +10,21 @@ ARG TARGETARCH
1010
ARG VERSION
1111
ARG BUILD
1212

13+
RUN apt-get update && case "${TARGETARCH}" in \
14+
amd64) apt-get install -y gcc-x86-64-linux-gnu ;; \
15+
arm64) apt-get install -y gcc-aarch64-linux-gnu ;; \
16+
esac && rm -rf /var/lib/apt/lists/*
17+
1318
COPY . /app
1419

1520
WORKDIR /app
1621

17-
RUN GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -ldflags "-X 'main.projectVersion=${VERSION:-0.0.0}' -X 'main.projectBuild=${BUILD:-dev}'" -o bin/qdrant-migration main.go
22+
RUN case "${TARGETARCH}" in \
23+
amd64) CC=x86_64-linux-gnu-gcc ;; \
24+
arm64) CC=aarch64-linux-gnu-gcc ;; \
25+
esac && \
26+
CGO_ENABLED=1 GOOS=${TARGETOS} GOARCH=${TARGETARCH} CC=$CC \
27+
go build -ldflags "-X 'main.projectVersion=${VERSION:-0.0.0}' -X 'main.projectBuild=${BUILD:-dev}'" -o bin/qdrant-migration main.go
1828

1929
FROM --platform=${TARGETPLATFORM:-linux/amd64} registry.suse.com/bci/bci-minimal:15.6
2030

Makefile

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,3 @@ test_unit:
4848
lint:
4949
golangci-lint run
5050

51-
release: $(PLATFORMS)
52-
53-
temp = $(subst /, ,$@)
54-
os = $(word 1, $(temp))
55-
arch = $(word 2, $(temp))
56-
57-
$(PLATFORMS):
58-
BUILD_DATE=$(date +%F-%T) GOOS=$(os) GOARCH=$(arch) CGO_ENABLED=0 go build -o $(DIST_DIR)/qdrant-migrate-$(os)-$(arch) \
59-
-ldflags "-s -w -extldflags \"-static\" -X 'main.projectVersion=$(VERSION)' -X 'main.projectBuild=$(BUILD)'" main.go
60-

README.md

Lines changed: 8 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,9 @@ CLI tool for migrating data to [Qdrant](http://qdrant.tech) with support for res
1818

1919
You can run this tool on any machine with connectivity to both the source and the Qdrant database. For best performance, use a machine with a fast network and minimal latency to both endpoints.
2020

21-
#### Binaries
21+
The tool is distributed as a container image, which can be run on any system with Docker, Podman or similar container runtimes. The following examples use Docker.
2222

23-
Each release includes **precompiled binaries** for all major OS and CPU architectures. Download the latest one from the [Releases Page](https://github.com/qdrant/migration/releases).
24-
25-
#### Docker
26-
27-
To get the latest Docker image run the following command.
23+
To get the latest container image run the following command:
2824

2925
```bash
3026
docker pull registry.cloud.qdrant.io/library/qdrant-migration
@@ -43,21 +39,13 @@ Migrate data from a **Chroma** database to **Qdrant**:
4339
### 📥 Example
4440

4541
```bash
46-
migration chroma \
42+
docker run --net=host --rm -it registry.cloud.qdrant.io/library/qdrant-migration chroma \
4743
--chroma.url=http://localhost:8000
4844
--chroma.collection 'collection-name' \
4945
--qdrant.url 'https://example.cloud-region.cloud-provider.cloud.qdrant.io:6334' \
5046
--qdrant.api-key 'optional-qdrant-api-key' \
5147
--qdrant.collection 'target-collection' \
5248
--migration.batch-size 64
53-
````
54-
55-
With Docker:
56-
57-
```bash
58-
docker run --net=host --rm -it registry.cloud.qdrant.io/library/qdrant-migration chroma \
59-
--chroma.url=http://localhost:8000
60-
...
6149
```
6250

6351
### Chroma Options
@@ -102,22 +90,14 @@ Migrate data from a **Pinecone** database to **Qdrant**:
10290
### 📥 Example
10391

10492
```bash
105-
migration pinecone \
93+
docker run --net=host --rm -it registry.cloud.qdrant.io/library/qdrant-migration pinecone \
10694
--pinecone.index-host 'https://example-index.svc.region.pinecone.io' \
10795
--pinecone.index-name 'example-index' \
10896
--pinecone.api-key 'optional-pinecone-api-key' \
10997
--qdrant.url 'https://example.cloud-region.cloud-provider.cloud.qdrant.io:6334' \
11098
--qdrant.api-key 'optional-qdrant-api-key' \
11199
--qdrant.collection 'target-collection' \
112100
--migration.batch-size 64
113-
````
114-
115-
With Docker:
116-
117-
```bash
118-
docker run --net=host --rm -it registry.cloud.qdrant.io/library/qdrant-migration pinecone \
119-
--pinecone.index-host 'https://example-index.svc.region.pinecone.io' \
120-
...
121101
```
122102

123103
#### Pinecone Options
@@ -154,7 +134,7 @@ Migrate data from a **Milvus** database to **Qdrant**:
154134
### 📥 Example
155135

156136
```bash
157-
migration milvus \
137+
docker run --net=host --rm -it registry.cloud.qdrant.io/library/qdrant-migration milvus \
158138
--milvus.url 'https://example.gcp-us-west1.cloud.zilliz.com' \
159139
--milvus.enable-tls-auth \
160140
--milvus.collection 'example-collection' \
@@ -165,14 +145,6 @@ migration milvus \
165145
--migration.batch-size 64
166146
```
167147

168-
With Docker:
169-
170-
```bash
171-
docker run --net=host --rm -it registry.cloud.qdrant.io/library/qdrant-migration milvus \
172-
--milvus.url 'https://example.gcp-us-west1.cloud.zilliz.com' \
173-
...
174-
```
175-
176148
#### Milvus Options
177149

178150
| Flag | Description |
@@ -214,7 +186,7 @@ Migrate data from a **Weaviate** database to **Qdrant**:
214186
> Ensure that the **vector dimensions in Qdrant exactly match** those used in Weaviate.
215187
216188
```bash
217-
migration weaviate \
189+
docker run --net=host --rm -it registry.cloud.qdrant.io/library/qdrant-migration weaviate \
218190
--weaviate.host 'example.c0.asia-southeast1.gcp.weaviate.cloud' \
219191
--weaviate.scheme 'https' \
220192
--weaviate.auth-type 'apiKey' \
@@ -225,14 +197,6 @@ migration weaviate \
225197
--migration.batch-size 64
226198
```
227199

228-
With Docker:
229-
230-
```bash
231-
docker run --net=host --rm -it registry.cloud.qdrant.io/library/qdrant-migration weaviate \
232-
--weaviate.host 'example.c0.asia-southeast1.gcp.weaviate.cloud' \
233-
...
234-
```
235-
236200
#### Weaviate Options
237201

238202
| Flag | Description |
@@ -277,22 +241,14 @@ Migrate data from a **Redis** database to **Qdrant**:
277241
### 📥 Example
278242

279243
```bash
280-
migration redis \
244+
docker run --net=host --rm -it registry.cloud.qdrant.io/library/qdrant-migration milvus \
281245
--redis.index 'index_name' \
282246
--redis.addr 'localhost:6379' \
283247
--qdrant.url 'http://localhost:6334' \
284248
--qdrant.collection 'target-collection' \
285249
--migration.batch-size 100
286250
```
287251

288-
With Docker:
289-
290-
```bash
291-
docker run --net=host --rm -it registry.cloud.qdrant.io/library/qdrant-migration milvus \
292-
--redis.index 'index_name' \
293-
...
294-
```
295-
296252
#### Redis Options
297253

298254
| Flag | Description |
@@ -327,7 +283,7 @@ Migrate data from one **Qdrant** instance to another.
327283
### 📥 Example
328284

329285
```bash
330-
migration qdrant \
286+
docker run --net=host --rm -it registry.cloud.qdrant.io/library/qdrant-migration qdrant \
331287
--source.url 'http://localhost:6334' \
332288
--source.collection 'source-collection' \
333289
--target.url 'https://example.cloud-region.cloud-provider.cloud.qdrant.io:6334' \
@@ -336,14 +292,6 @@ migration qdrant \
336292
--migration.batch-size 64
337293
```
338294

339-
With Docker:
340-
341-
```bash
342-
docker run --net=host --rm -it registry.cloud.qdrant.io/library/qdrant-migration qdrant \
343-
--source.url 'http://localhost:6334' \
344-
...
345-
```
346-
347295
NOTE: If the target collection already exists, its vector size and dimensions must match the source. Other settings like replication, shards can differ.
348296

349297
#### Source Qdrant Options

integration_tests/milvus_to_qdrant.bats

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ teardown() {
4848
echo "Wait for a few seconds to load the vectors"
4949
sleep 5
5050

51-
run go run main.go milvus \
51+
run docker run --net=host --rm registry.cloud.qdrant.io/library/qdrant-migration:dev milvus \
5252
--milvus.url 'http://localhost:19530' \
5353
--milvus.collection 'migrate_collection' \
5454
--qdrant.url 'http://localhost:6334' \

integration_tests/qdrant_to_qdrant.bats

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747

4848
echo $source_result
4949

50-
run go run main.go qdrant --source.url http://localhost:7334 --source.collection source_collection --target.url http://localhost:8334 --target.collection target_collection --migration.batch-size 1
50+
run docker run --net=host --rm registry.cloud.qdrant.io/library/qdrant-migration:dev qdrant --source.url http://localhost:7334 --source.collection source_collection --target.url http://localhost:8334 --target.collection target_collection --migration.batch-size 1
5151
[ $status -eq 0 ]
5252

5353
run curl -s -X POST http://localhost:8333/collections/target_collection/points/scroll \
@@ -74,13 +74,13 @@
7474
[ $status -eq 0 ]
7575

7676

77-
run go run main.go qdrant --source.url http://localhost:7334 --source.collection source_collection --target.url http://localhost:7334 --target.collection source_collection --migration.batch-size 1
77+
run docker run --net=host --rm registry.cloud.qdrant.io/library/qdrant-migration:dev qdrant --source.url http://localhost:7334 --source.collection source_collection --target.url http://localhost:7334 --target.collection source_collection --migration.batch-size 1
7878
[ $status -ne 0 ]
7979
[[ "$output" =~ "source and target collections must be different" ]]
8080
}
8181

8282
@test "Migrating with invalid port should fail" {
83-
run go run main.go qdrant --source.url http://localhost:invalid --source.collection source_collection --target.url http://localhost:8334 --target.collection source_collection --migration.batch-size 1
83+
run docker run --net=host --rm registry.cloud.qdrant.io/library/qdrant-migration:dev qdrant --source.url http://localhost:invalid --source.collection source_collection --target.url http://localhost:8334 --target.collection source_collection --migration.batch-size 1
8484
[ $status -ne 0 ]
8585
[[ "$output" =~ "invalid port \":invalid\" after host" ]]
8686
}

0 commit comments

Comments
 (0)