This repository has been archived by the owner on Jul 16, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Previsously we did not have test for embedding indexing. This patch installs [pgvector](https://github.com/pgvector/pgvector) from the PostgreSQL's apt repo so that we can test the embedding-related features on CI. To keep it simple, instead of modifying a container at runtime, this patch adds a new `tox` env, called `test-container`, which builds the docker image of database server with all dependencies before running the tests. The `test` env is still available for running tests with an existing server. To make tests more effective, this patch also adds an option called `server_use_pickler` to `pytest`, indicating that whether to use the pickler `dill` to deserialize UDFs on server. As a result, we can have test cases for the pickler, which will fail when the pickler is not applicable. Such test cases are currently missing and we have encountered several issues because of that.
- Loading branch information
Showing
21 changed files
with
227 additions
and
149 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
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
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 |
---|---|---|
@@ -1,2 +1 @@ | ||
include versioneer.py | ||
include greenplumpython/_version.py | ||
include greenplumpython/VERSION |
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
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
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
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
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 |
---|---|---|
@@ -1,6 +1,5 @@ | ||
black==22.3.0 | ||
isort==5.10.1 | ||
pytest==7.0.1 | ||
pglast==3.10 | ||
pyright==1.1.250 | ||
pandas |
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 |
---|---|---|
@@ -1,4 +1,3 @@ | ||
-r requirements.txt | ||
sphinx==5.1.1 | ||
sphinx_rtd_theme==1.0.0 | ||
nbsphinx | ||
|
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,21 @@ | ||
#!/bin/bash | ||
|
||
set -o nounset -o xtrace -o errexit -o pipefail | ||
|
||
PG_MAJOR_VERSION=$(pg_config --version | grep --only-matching --extended-regexp '[0-9]+' | head -n 1) | ||
export DEBIAN_FRONTEND=nointeractive | ||
apt-get update | ||
apt-get install --no-install-recommends -y \ | ||
postgresql-plpython3-"$PG_MAJOR_VERSION" \ | ||
postgresql-"$PG_MAJOR_VERSION"-pgvector \ | ||
python3-pip \ | ||
python3-venv | ||
apt-get autoclean | ||
|
||
POSTGRES_USER_SITE=$(su --login postgres --session-command "python3 -m site --user-site") | ||
POSTGRES_USER_BASE=$(su --login postgres --session-command "python3 -m site --user-base") | ||
mkdir --parents "$POSTGRES_USER_SITE" | ||
chown --recursive postgres "$POSTGRES_USER_BASE" | ||
|
||
cp /tmp/initdb.sh /docker-entrypoint-initdb.d | ||
chown postgres /docker-entrypoint-initdb.d/* |
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,12 @@ | ||
#!/bin/bash | ||
|
||
set -o nounset -o xtrace -o errexit -o pipefail | ||
|
||
{ | ||
echo "logging_collector = ON" | ||
echo "log_statement = 'all'" | ||
echo "log_destination = 'csvlog'" | ||
} >>"$PGDATA"/postgresql.conf | ||
|
||
python3 -m venv "$HOME"/venv | ||
source "$HOME"/venv/bin/activate |
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,11 @@ | ||
FROM postgres:12-bookworm | ||
|
||
COPY build.sh initdb.sh /tmp/ | ||
RUN bash /tmp/build.sh | ||
|
||
HEALTHCHECK --interval=1s --timeout=1s --start-period=1s --retries=30 CMD psql \ | ||
--single-transaction \ | ||
--user=$POSTGRES_USER \ | ||
--dbname=$POSTGRES_DB \ | ||
--host=localhost \ | ||
--command="SELECT version();" |
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,11 @@ | ||
FROM postgres:12-bullseye | ||
|
||
COPY build.sh initdb.sh /tmp/ | ||
RUN bash /tmp/build.sh | ||
|
||
HEALTHCHECK --interval=1s --timeout=1s --start-period=1s --retries=30 CMD psql \ | ||
--single-transaction \ | ||
--user=$POSTGRES_USER \ | ||
--dbname=$POSTGRES_DB \ | ||
--host=localhost \ | ||
--command="SELECT version();" |
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
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,16 @@ | ||
import pytest | ||
|
||
|
||
def pytest_addoption(parser: pytest.Parser): | ||
parser.addini( | ||
"server_use_pickler", | ||
type="bool", | ||
default=True, | ||
help="Use pickler to deserialize UDFs on server.", | ||
) | ||
|
||
|
||
@pytest.fixture(scope="session") | ||
def server_use_pickler(pytestconfig: pytest.Config) -> bool: | ||
val: bool = pytestconfig.getini("server_use_pickler") | ||
return val |
Oops, something went wrong.