-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #252 from qiangxuhui/main
add pgvector 0.5.0
- Loading branch information
Showing
3 changed files
with
65 additions
and
0 deletions.
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 @@ | ||
src |
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,42 @@ | ||
# This file is generated by the template. | ||
|
||
REGISTRY?=cr.loongnix.cn | ||
ORGANIZATION?=pgvector | ||
REPOSITORY?=pgvector | ||
TAG?=v0.5.0 | ||
LATEST?=true | ||
|
||
IMAGE=$(REGISTRY)/$(ORGANIZATION)/$(REPOSITORY):$(TAG) | ||
LATEST_IMAGE=$(REGISTRY)/$(ORGANIZATION)/$(REPOSITORY):latest | ||
|
||
# SOURCE_URL is a url to download source, such as https://github.com/merore/merore.git. | ||
# SOURCE is project sources, its located at src/$(SORUCE). | ||
# PATCH is a patch that supports loong64 to $(SOURCE). | ||
# Be sure to fill in the follows!!! | ||
SOURCE_URL=https://github.com/pgvector/pgvector.git | ||
SOURCE=$(shell echo $(SOURCE_URL) | awk -F '/' '{print $$NF}' | awk -F '.' '{print $$1}') | ||
PATCH=loong64.patch | ||
|
||
default: image | ||
|
||
image: src/$(SOURCE) | ||
# Commands for building. | ||
cd src/$(SOURCE) && \ | ||
docker build -f Dockerfile.loongarch64 -t cr.loongnix.cn/pgvector/pgvector:0.5.0 . && \ | ||
cd ../.. | ||
|
||
src/$(SOURCE): | ||
git clone -q -b $(TAG) --depth=1 $(SOURCE_URL) $@ | ||
cd $@ && \ | ||
git apply ../../$(PATCH) | ||
|
||
push: | ||
docker push $(IMAGE) | ||
@if [ $(LATEST) = "true" ]; \ | ||
then\ | ||
docker tag $(IMAGE) $(LATEST_IMAGE); \ | ||
docker push $(LATEST_IMAGE); \ | ||
fi | ||
|
||
clean: | ||
rm -rf src |
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,22 @@ | ||
diff --git a/Dockerfile.loongarch64 b/Dockerfile.loongarch64 | ||
new file mode 100644 | ||
index 0000000..29309ed | ||
--- /dev/null | ||
+++ b/Dockerfile.loongarch64 | ||
@@ -0,0 +1,16 @@ | ||
+ARG PG_MAJOR=15 | ||
+FROM cr.loongnix.cn/library/postgres:15-alpine | ||
+ARG PG_MAJOR | ||
+ | ||
+COPY . /tmp/pgvector | ||
+ | ||
+RUN cd /tmp/pgvector && \ | ||
+ apk add --no-cache --virtual .build-postgres-cache build-base && \ | ||
+ make clean && \ | ||
+ make OPTFLAGS="" && \ | ||
+ make install && \ | ||
+ mkdir -p /usr/share/doc/pgvector && \ | ||
+ cp LICENSE README.md /usr/share/doc/pgvector && \ | ||
+ rm -r /tmp/pgvector && \ | ||
+ apk del --no-network .build-postgres-cache | ||
+ |