Skip to content

Commit 8819b65

Browse files
milvus build utilities, manifests, and seed generation script WIP
Signed-off-by: greg pereira <[email protected]>
1 parent e85a64d commit 8819b65

17 files changed

+352
-0
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ models
1212
generated
1313
.idea
1414
.DS_Store
15+
milvus/seed/data/*
16+
*.venv
17+
*venv
1518

1619
# UI assets
1720
**/node_modules

milvus/build/Containerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
FROM docker.io/milvusdb/milvus:master-20240426-bed6363f
2+
ADD embedEtcd.yaml /milvus/configs/embedEtcd.yaml

milvus/build/Makefile

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
REGISTRY ?= quay.io
2+
REGISTRY_ORG ?= ai-lab
3+
COMPONENT = vector_dbs
4+
5+
IMAGE ?= $(REGISTRY)/$(REGISTRY_ORG)/$(COMPONENT)/milvus:latest
6+
7+
ARCH ?= $(shell uname -m)
8+
PLATFORM ?= linux/$(ARCH)
9+
10+
gRCP_PORT := 19530
11+
REST_PORT := 9091
12+
CLIENT_PORT := 2379
13+
14+
LIB_MILVUS_DIR_MOUNTPATH := $(shell pwd)/volumes/milvus
15+
16+
.PHONY: build
17+
build:
18+
podman build --platform $(PLATFORM) -f Containerfile -t ${IMAGE} .
19+
20+
.PHONY: run
21+
run:
22+
podman run -d \
23+
--name milvus-standalone \
24+
--security-opt seccomp:unconfined \
25+
-e ETCD_USE_EMBED=true \
26+
-e ETCD_CONFIG_PATH=/milvus/configs/embedEtcd.yaml \
27+
-e COMMON_STORAGETYPE=local \
28+
-v $(LIB_MILVUS_DIR_MOUNTPATH):/var/lib/milvus \
29+
-p $(gRCP_PORT):$(gRCP_PORT) \
30+
-p $(REST_PORT):$(REST_PORT) \
31+
-p $(CLIENT_PORT):$(CLIENT_PORT) \
32+
--health-cmd="curl -f http://localhost:$(REST_PORT)/healthz" \
33+
--health-interval=30s \
34+
--health-start-period=90s \
35+
--health-timeout=20s \
36+
--health-retries=3 \
37+
$(IMAGE) \
38+
milvus run standalone 1> /dev/null
39+
40+
.PHONY: stop
41+
stop:
42+
-podman stop milvus-standalone
43+
44+
.PHONY: delete
45+
delete:
46+
-podman rm milvus-standalone -f
47+
48+
.PHONY: podman-clean
49+
podman-clean:
50+
@container_ids=$$(podman ps -a --format "{{.ID}} {{.Image}}" | awk '$$2 == "$(IMAGE)" {print $$1}'); \
51+
echo "removing all containers with IMAGE=$(IMAGE)"; \
52+
for id in $$container_ids; do \
53+
echo "Removing container: $$id,"; \
54+
podman rm -f $$id; \
55+
done

milvus/build/embedEtcd.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
listen-client-urls: http://0.0.0.0:2379
2+
advertise-client-urls: http://0.0.0.0:2379
3+
quota-backend-bytes: 4294967296
4+
auto-compaction-mode: revision
5+
auto-compaction-retention: '1000'

milvus/build/merlinite-qq.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/bash
2+
## EXPECTED INPUT IS STRING ECAPSULATED
3+
input="$1"
4+
echo "input: $input"
5+
request_body='{"model":"ibm/merlinite-7b","logprobs":false,"messages":[{"role": "system","content": "You are an AI language model developed by IBM Research. You are a cautious assistant. You carefully follow instructions. You are helpful and harmless and you follow ethical guidelines and promote positive behavior."},{"role":"user","content": "'$input'"}],"stream":false}'
6+
echo $request_body
7+
curl -X 'POST' 'https://merlinite-7b-vllm-openai.apps.fmaas-backend.fmaas.res.ibm.com/v1/chat/completions' -H 'accept: application/json' -H 'Content-Type: application/json' -k -d $request_body

milvus/build/volumes/Containerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
FROM docker.io/milvusdb/milvus:master-20240426-bed6363f
2+
ADD embedEtcd.yaml /milvus/configs/embedEtcd.yaml

milvus/build/volumes/Makefile

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
REGISTRY ?= quay.io
2+
REGISTRY_ORG ?= ai-lab
3+
COMPONENT = vector_dbs
4+
5+
IMAGE ?= $(REGISTRY)/$(REGISTRY_ORG)/$(COMPONENT)/milvus:latest
6+
7+
ARCH ?= $(shell uname -m)
8+
PLATFORM ?= linux/$(ARCH)
9+
10+
gRCP_PORT := 19530
11+
REST_PORT := 9091
12+
CLIENT_PORT := 2379
13+
14+
LIB_MILVUS_DIR_MOUNTPATH := $(shell pwd)/volumes/milvus
15+
16+
.PHONY: build
17+
build:
18+
podman build --platform $(PLATFORM) -f Containerfile -t ${IMAGE} .
19+
20+
.PHONY: run
21+
run:
22+
podman run -it \
23+
--name milvus-standalone \
24+
--security-opt seccomp:unconfined \
25+
-e ETCD_USE_EMBED=true \
26+
-e ETCD_CONFIG_PATH=/milvus/configs/embedEtcd.yaml \
27+
-e COMMON_STORAGETYPE=local \
28+
-v $(LIB_MILVUS_DIR_MOUNTPATH):/var/lib/milvus \
29+
-p $(gRCP_PORT):$(gRCP_PORT) \
30+
-p $(REST_PORT):$(REST_PORT) \
31+
-p $(CLIENT_PORT):$(CLIENT_PORT) \
32+
--health-cmd="curl -f http://localhost:$(REST_PORT)/healthz" \
33+
--health-interval=30s \
34+
--health-start-period=90s \
35+
--health-timeout=20s \
36+
--health-retries=3 \
37+
$(IMAGE) \
38+
milvus run standalone 1> /dev/null
39+
40+
.PHONY: stop
41+
stop:
42+
-podman stop milvus-standalone
43+
44+
.PHONY: delete
45+
delete:
46+
-podman rm milvus-standalone -f
47+
48+
.PHONY: podman-clean
49+
podman-clean:
50+
@container_ids=$$(podman ps --format "{{.ID}} {{.Image}}" | awk '$$2 == "$(IMAGE)" {print $$1}'); \
51+
echo "removing all containers with IMAGE=$(IMAGE)"; \
52+
for id in $$container_ids; do \
53+
echo "Removing container: $$id,"; \
54+
podman rm -f $$id; \
55+
done

milvus/build/volumes/embedEtcd.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
listen-client-urls: http://0.0.0.0:2379
2+
advertise-client-urls: http://0.0.0.0:2379
3+
quota-backend-bytes: 4294967296
4+
auto-compaction-mode: revision
5+
auto-compaction-retention: '1000'

milvus/build/volumes/milvus/.gitkeep

Whitespace-only changes.

milvus/seed/.env.example

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
MODEL_NAME=
2+
MODEL_ENDPOINT=
3+
MODEL_TOKEN=

0 commit comments

Comments
 (0)