Skip to content

Commit

Permalink
Merge branch 'apache:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
WendelLana authored Sep 24, 2024
2 parents e0fa1a8 + 3247728 commit 77da9f7
Show file tree
Hide file tree
Showing 61 changed files with 3,703 additions and 441 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/go-driver.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ jobs:
working-directory: drivers/golang/age/

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Run apache/age docker image
run: docker-compose up -d
run: docker compose up -d

- name: Set up Go
uses: actions/setup-go@v3
Expand Down
18 changes: 15 additions & 3 deletions .github/workflows/installcheck.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,25 +22,37 @@ jobs:
path: ~/pg16
key: ${{ runner.os }}-v1-pg16-${{ env.PG_COMMIT_HASH }}

- name: Install PostgreSQL 16
- name: Install PostgreSQL 16 and some extensions
if: steps.pg16cache.outputs.cache-hit != 'true'
run: |
git clone --depth 1 --branch REL_16_STABLE git://git.postgresql.org/git/postgresql.git ~/pg16source
cd ~/pg16source
./configure --prefix=$HOME/pg16 CFLAGS="-std=gnu99 -ggdb -O0" --enable-cassert
make install -j$(nproc) > /dev/null
cd contrib
cd fuzzystrmatch
make PG_CONFIG=$HOME/pg16/bin/pg_config install -j$(nproc) > /dev/null
cd ../pg_trgm
make PG_CONFIG=$HOME/pg16/bin/pg_config install -j$(nproc) > /dev/null
- uses: actions/checkout@v3

- name: Build
- name: Build AGE
id: build
run: |
make PG_CONFIG=$HOME/pg16/bin/pg_config install -j$(nproc)
- name: Pull and build pgvector
id: pgvector
run: |
git clone https://github.com/pgvector/pgvector.git
cd pgvector
make PG_CONFIG=$HOME/pg16/bin/pg_config install -j$(nproc) > /dev/null
- name: Regression tests
id: regression_tests
run: |
make PG_CONFIG=$HOME/pg16/bin/pg_config installcheck
make PG_CONFIG=$HOME/pg16/bin/pg_config installcheck EXTRA_TESTS="pgvector fuzzystrmatch pg_trgm"
continue-on-error: true

- name: Dump regression test errors
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/jdbc-driver.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
working-directory: drivers/jdbc

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Set up Java
uses: actions/setup-java@v3
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/nodejs-driver.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ jobs:
working-directory: drivers/nodejs/

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Run apache/age docker image
run: docker-compose up -d
run: docker compose up -d

- name: Set up Node
uses: actions/setup-node@v3
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/python-driver.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ jobs:
working-directory: drivers/python

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Run apache/age docker image
run: docker-compose up -d
run: docker compose up -d

- name: Set up python
uses: actions/setup-python@v4
Expand Down
9 changes: 7 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,13 @@ REGRESS = scan \
name_validation \
jsonb_operators \
list_comprehension \
map_projection \
drop
map_projection

ifneq ($(EXTRA_TESTS),)
REGRESS += $(EXTRA_TESTS)
endif

REGRESS += drop

srcdir=`pwd`

Expand Down
28 changes: 28 additions & 0 deletions age--1.5.0--y.y.y.sql
Original file line number Diff line number Diff line change
Expand Up @@ -110,3 +110,31 @@ CREATE FUNCTION ag_catalog.graph_exists(graph_name name)
RETURNS agtype
LANGUAGE c
AS 'MODULE_PATHNAME', 'age_graph_exists';

CREATE FUNCTION ag_catalog.age_is_valid_label_name(agtype)
RETURNS boolean
LANGUAGE c
IMMUTABLE
PARALLEL SAFE
AS 'MODULE_PATHNAME';

CREATE OR REPLACE FUNCTION ag_catalog.create_vlabel(graph_name cstring, label_name cstring)
RETURNS void
LANGUAGE c
AS 'MODULE_PATHNAME';

CREATE OR REPLACE FUNCTION ag_catalog.create_elabel(graph_name cstring, label_name cstring)
RETURNS void
LANGUAGE c
AS 'MODULE_PATHNAME';

CREATE FUNCTION ag_catalog.agtype_to_json(agtype)
RETURNS json
LANGUAGE c
IMMUTABLE
RETURNS NULL ON NULL INPUT
PARALLEL SAFE
AS 'MODULE_PATHNAME';

CREATE CAST (agtype AS json)
WITH FUNCTION ag_catalog.agtype_to_json(agtype);
33 changes: 22 additions & 11 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,30 +16,41 @@
# limitations under the License.
#

FROM postgres:16
# Build stage: Install necessary development tools for compilation and installation
FROM postgres:16 AS build

RUN apt-get update \
&& apt-get install -y --no-install-recommends --no-install-suggests \
bison \
build-essential \
flex \
postgresql-server-dev-16 \
locales

ENV LANG=en_US.UTF-8
ENV LC_COLLATE=en_US.UTF-8
ENV LC_CTYPE=en_US.UTF-8

RUN echo "en_US.UTF-8 UTF-8" > /etc/locale.gen \
&& locale-gen \
&& update-locale LANG=en_US.UTF-8
postgresql-server-dev-16

COPY . /age

WORKDIR /age

RUN make && make install


# Final stage: Create a final image by copying the files created in the build stage
FROM postgres:16

RUN apt-get update \
&& apt-get install -y --no-install-recommends --no-install-suggests \
locales

RUN echo "en_US.UTF-8 UTF-8" > /etc/locale.gen \
&& locale-gen \
&& update-locale LANG=en_US.UTF-8

ENV LANG=en_US.UTF-8
ENV LC_COLLATE=en_US.UTF-8
ENV LC_CTYPE=en_US.UTF-8

COPY --from=build /usr/lib/postgresql/16/lib/age.so /usr/lib/postgresql/16/lib/
COPY --from=build /usr/share/postgresql/16/extension/age--1.5.0.sql /usr/share/postgresql/16/extension/
COPY --from=build /usr/share/postgresql/16/extension/age.control /usr/share/postgresql/16/extension/
COPY docker/docker-entrypoint-initdb.d/00-create-extension-age.sql /docker-entrypoint-initdb.d/00-create-extension-age.sql

CMD ["postgres", "-c", "shared_preload_libraries=age"]
Loading

0 comments on commit 77da9f7

Please sign in to comment.