Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add pgvector 0.5.0 #252

Merged
merged 1 commit into from
Jul 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions pgvector/pgvector/0.5.0/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
src
42 changes: 42 additions & 0 deletions pgvector/pgvector/0.5.0/Makefile
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
22 changes: 22 additions & 0 deletions pgvector/pgvector/0.5.0/loong64.patch
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
+
Loading