Skip to content

Commit

Permalink
fix-actions (#1426)
Browse files Browse the repository at this point in the history
* up

* modify

* add to github path
  • Loading branch information
shreyaspimpalgaonkar authored Oct 20, 2024
1 parent dd36ad6 commit 44e6fd8
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 31 deletions.
65 changes: 43 additions & 22 deletions .github/actions/setup-postgres-ext/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,39 +32,60 @@ runs:
- name: Setup PostgreSQL on Windows
if: inputs.os == 'windows-latest'
shell: pwsh
shell: cmd
run: |
choco install postgresql15 --params '/Password:postgres' --force
$env:PATH += ";C:\Program Files\PostgreSQL\15\bin"
$env:PGPASSWORD = 'postgres'
echo Starting PostgreSQL setup and pgvector installation...
echo Installing PostgreSQL...
choco install postgresql15 --params "/Password:postgres" --force
echo Updating PATH and setting PGPASSWORD...
set PATH=%PATH%;C:\Program Files\PostgreSQL\15\bin
set PGPASSWORD=postgres
echo PATH updated and PGPASSWORD set.
echo Altering PostgreSQL user password...
psql -U postgres -c "ALTER USER postgres PASSWORD 'postgres';"
echo PostgreSQL user password altered.
# Install Visual Studio Build Tools
echo Installing Visual Studio Build Tools...
choco install visualstudio2022buildtools --package-parameters "--add Microsoft.VisualStudio.Workload.VCTools --includeRecommended --passive --norestart"
echo Visual Studio Build Tools installed.
# Set up environment for building pgvector
$vcvars64Path = "C:\Program Files\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\Build\vcvars64.bat"
cmd.exe /c "call `"$vcvars64Path`" && set > %temp%\vcvars.txt"
Get-Content "$env:temp\vcvars.txt" | Foreach-Object {
if ($_ -match "^(.*?)=(.*)$") {
Set-Content "env:\$($matches[1])" $matches[2]
}
}
# Clone and build pgvector
$env:PGROOT = "C:\Program Files\PostgreSQL\15"
Set-Location -Path $env:TEMP
echo Setting up Visual Studio environment...
call "C:\Program Files\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\Build\vcvars64.bat"
echo Visual Studio environment set up.
echo Cloning and building pgvector...
set PGROOT=C:\Program Files\PostgreSQL\15
cd /d %TEMP%
git clone --branch v0.7.4 https://github.com/pgvector/pgvector.git
Set-Location -Path "$env:TEMP\pgvector"
cd pgvector
echo pgvector cloned.
echo Creating vector extension...
psql -U postgres -c "CREATE EXTENSION vector;"
echo Vector extension created.
echo Building pgvector...
nmake /F Makefile.win
echo pgvector built.
echo Installing pgvector...
nmake /F Makefile.win install
echo pgvector installed.
psql -U postgres -c "CREATE EXTENSION vector;"
echo Setting max_connections to 1024...
echo max_connections = 1024 >> "C:\Program Files\PostgreSQL\15\data\postgresql.conf"
echo max_connections set.
# Set max_connections to 1024
Add-Content -Path "C:\Program Files\PostgreSQL\15\data\postgresql.conf" -Value "max_connections = 1024"
Restart-Service postgresql-x64-15
echo Restarting PostgreSQL service...
net stop postgresql-x64-15
net start postgresql-x64-15
echo PostgreSQL service restarted.
echo Setup complete!
- name: Setup PostgreSQL on macOS
if: inputs.os == 'macos-latest'
Expand Down
9 changes: 5 additions & 4 deletions .github/actions/setup-python-full/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,9 @@ runs:
- name: Install Poetry and dependencies on Windows
if: inputs.os == 'windows-latest'
shell: pwsh
shell: cmd
run: |
(Invoke-WebRequest -Uri https://install.python-poetry.org -UseBasicParsing).Content | python -
$env:PATH += ";$env:USERPROFILE\AppData\Roaming\Python\Scripts"
cd py; poetry install -E core -E ingestion-bundle
python -c "import urllib.request; print(urllib.request.urlopen('https://install.python-poetry.org').read().decode())" > install-poetry.py
python install-poetry.py
echo %USERPROFILE%\AppData\Roaming\Python\Scripts >> %GITHUB_PATH%
cd py && poetry install -E core -E ingestion-bundle
9 changes: 5 additions & 4 deletions .github/actions/setup-python-light/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@ runs:
- name: Install Poetry and dependencies on Windows
if: inputs.os == 'windows-latest'
shell: pwsh
shell: cmd
run: |
(Invoke-WebRequest -Uri https://install.python-poetry.org -UseBasicParsing).Content | python -
$env:PATH += ";$env:USERPROFILE\AppData\Roaming\Python\Scripts"
cd py; poetry install -E core -E ingestion-bundle
python -c "import urllib.request; print(urllib.request.urlopen('https://install.python-poetry.org').read().decode())" > install-poetry.py
python install-poetry.py
echo %USERPROFILE%\AppData\Roaming\Python\Scripts >> %GITHUB_PATH%
cd py && poetry install -E core -E ingestion-bundle
2 changes: 1 addition & 1 deletion .github/workflows/r2r-light-py-integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:

strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
os: [windows-latest]
test_category:
- cli-ingestion
- cli-retrieval
Expand Down

0 comments on commit 44e6fd8

Please sign in to comment.