Skip to content

Commit

Permalink
add pgvector
Browse files Browse the repository at this point in the history
  • Loading branch information
emrgnt-cmplxty committed Oct 4, 2024
1 parent 54380c1 commit 494f03c
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 20 deletions.
37 changes: 22 additions & 15 deletions .github/workflows/integration-test-workflow-debian.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ name: R2R CLI Integration and Regression Test

on:
push:
branches: ['**']
workflow_dispatch:
branches:
- '**' # Trigger on all branches
workflow_dispatch: # Allow manual trigger

jobs:
build-and-test:
Expand All @@ -21,7 +22,21 @@ jobs:
POSTGRES_PASSWORD: postgres
POSTGRES_USER: postgres
R2R_PROJECT_NAME: r2r_default

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Python environment
uses: actions/setup-python@v4
with:
python-version: '3.x'

- name: Install Poetry and dependencies
run: |
curl -sSL https://install.python-poetry.org | python3 -
cd py && poetry install -E core -E ingestion-bundle
- name: Install and configure PostgreSQL
run: |
sudo apt-get update
Expand All @@ -32,24 +47,16 @@ jobs:
- name: Install pgvector
run: |
sudo apt-get install -y build-essential
sudo apt-get install -y postgresql-server-dev-all
sudo apt-get install -y build-essential postgresql-server-dev-all
git clone https://github.com/pgvector/pgvector.git
cd pgvector
make
sudo make install
cd ..
sudo -u postgres psql -c "CREATE EXTENSION vector;"
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install Poetry and dependencies
run: |
curl -sSL https://install.python-poetry.org | python3 -
cd py && poetry install -E core -E ingestion-bundle
- name: Start PostgreSQL
run: sudo systemctl start postgresql.service

- name: Start R2R server
working-directory: ./py
Expand All @@ -58,12 +65,12 @@ jobs:
echo "Waiting for services to start..."
sleep 30
- name: Run integration tests
- name: Run integration tests - Ingestion
working-directory: ./py
run: |
python tests/integration/runner.py test_ingest_sample_files_cli
python tests/integration/runner.py test_document_ingestion_cli
- name: Stop R2R server
if: always()
run: pkill -f "r2r serve"
run: pkill -f "r2r serve"
12 changes: 7 additions & 5 deletions py/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,12 @@ def generate_random_vector_entry(

@pytest.fixture(scope="session")
def app_config():
return AppConfig()
collection_id = uuid.uuid4()

random_project_name = f"_{collection_id.hex}_test_project"
print("random_project_name", random_project_name)

return AppConfig(project_name=random_project_name)

# Crypto
@pytest.fixture(scope="session")
Expand All @@ -78,11 +83,8 @@ def crypto_provider(crypto_config, app_config):
# Postgres
@pytest.fixture(scope="session")
def db_config(app_config):
collection_id = uuid.uuid4()

random_project_name = f"test_collection_{collection_id.hex}"
return DatabaseConfig.create(
provider="postgres", project_name=random_project_name, app=app_config
provider="postgres", app=app_config
)


Expand Down

0 comments on commit 494f03c

Please sign in to comment.