|
| 1 | +# .github/workflows/windows-test.yml |
| 2 | + |
| 3 | +name: Installation Test |
| 4 | + |
| 5 | +# on: |
| 6 | +# push: |
| 7 | +# branches: [ main ] |
| 8 | +# pull_request: |
| 9 | + # branches: [ main ] |
| 10 | +on: |
| 11 | + push: |
| 12 | + branches: |
| 13 | + - installation-script-2 |
| 14 | + |
| 15 | +jobs: |
| 16 | + build: |
| 17 | + uses: ./.github/workflows/build-python.yml |
| 18 | + with: |
| 19 | + python-version: "3.12" |
| 20 | + |
| 21 | + check-linux: |
| 22 | + needs: build |
| 23 | + runs-on: ubuntu-latest |
| 24 | + |
| 25 | + services: |
| 26 | + postgres: |
| 27 | + image: pgvector/pgvector:pg16 |
| 28 | + env: |
| 29 | + POSTGRES_USER: memmachine |
| 30 | + POSTGRES_PASSWORD: mammachine_password |
| 31 | + POSTGRES_DB: memmachine |
| 32 | + POSTGRES_INITDB_ARGS: "--encoding=UTF-8 --lc-collate=C --lc-ctype=C" |
| 33 | + ports: |
| 34 | + - 5432:5432 |
| 35 | + options: >- |
| 36 | + --health-cmd="pg_isready -U memmachine" |
| 37 | + --health-interval=10s |
| 38 | + --health-timeout=5s |
| 39 | + --health-retries=5 |
| 40 | +
|
| 41 | + ollama: |
| 42 | + image: ollama/ollama |
| 43 | + ports: |
| 44 | + - 11434:11434 |
| 45 | + |
| 46 | + steps: |
| 47 | + - name: Set up Python 3.12 |
| 48 | + uses: actions/setup-python@v5 |
| 49 | + with: |
| 50 | + python-version: "3.12" |
| 51 | + |
| 52 | + - name: Download built distributions |
| 53 | + uses: actions/download-artifact@v4 |
| 54 | + with: |
| 55 | + name: python-package-dist |
| 56 | + |
| 57 | + - name: Set up ollama |
| 58 | + run: | |
| 59 | + set -eo pipefail |
| 60 | + until curl -s http://localhost:11434/ > /dev/null; do |
| 61 | + echo "Ollama not up yet, sleeping..." |
| 62 | + sleep 1 |
| 63 | + done |
| 64 | +
|
| 65 | + echo "Ollama is up, loading model..." |
| 66 | + curl http://localhost:11434/api/pull -d '{ |
| 67 | + "name": "qwen3:0.6b" |
| 68 | + }' -v |
| 69 | + echo "pulled model qwen3:0.6b into ollama" |
| 70 | +
|
| 71 | + curl http://localhost:11434/api/pull -d '{ |
| 72 | + "name": "nomic-embed-text" |
| 73 | + }' -v |
| 74 | + echo "pulled model nomic-embed-text into ollama" |
| 75 | +
|
| 76 | + - name: Test install on Ubuntu |
| 77 | + run: | |
| 78 | + set -eo pipefail |
| 79 | + whl_name=$(ls *.whl) |
| 80 | + echo "Installing wheel file: $whl_name" |
| 81 | + python -m pip install $whl_name |
| 82 | + echo "configuring memmachine" |
| 83 | + memmachine-configure << EOF |
| 84 | + y |
| 85 | + CPU |
| 86 | + Ollama |
| 87 | + qwen3:0.6b |
| 88 | + nomic-embed-text |
| 89 | + localhost |
| 90 | + 5432 |
| 91 | + memmachine |
| 92 | + mammachine_password |
| 93 | + memmachine |
| 94 | + http://localhost:11434/v1 |
| 95 | + localhost |
| 96 | + 8080 |
| 97 | + EOF |
| 98 | +
|
| 99 | + memmachine-nltk-setup |
| 100 | + memmachine-sync-profile-schema |
| 101 | +
|
| 102 | + memmachine-server & |
| 103 | + server_pid=$! |
| 104 | + sleep 5 |
| 105 | +
|
| 106 | + curl -f http://127.0.0.1:8080/v1/sessions |
| 107 | +
|
| 108 | + shell: bash |
| 109 | + |
| 110 | + check-windows: |
| 111 | + needs: build |
| 112 | + runs-on: windows-latest |
| 113 | + |
| 114 | + steps: |
| 115 | + - name: Setup Miniconda |
| 116 | + uses: conda-incubator/setup-miniconda@v3 |
| 117 | + with: |
| 118 | + python-version: 3.12 |
| 119 | + auto-update-conda: true |
| 120 | + |
| 121 | + - name: Download built distributions |
| 122 | + uses: actions/download-artifact@v4 |
| 123 | + with: |
| 124 | + name: python-package-dist |
| 125 | + |
| 126 | + - name: set up dev tools |
| 127 | + uses: ilammy/msvc-dev-cmd@v1 |
| 128 | + |
| 129 | + - name: install postgresql |
| 130 | + run: | |
| 131 | + echo "Installing build dependencies..." |
| 132 | + conda install -c conda-forge postgresql c-compiler cxx-compiler git --yes |
| 133 | +
|
| 134 | + echo "Cloning pgvector..." |
| 135 | + git clone https://github.com/pgvector/pgvector.git |
| 136 | + cd pgvector |
| 137 | +
|
| 138 | + echo "Building and installing pgvector..." |
| 139 | + $env:PGROOT = "$($env:CONDA_PREFIX)\Library" |
| 140 | + echo "PGROOT set to: $env:PGROOT" |
| 141 | + |
| 142 | + $CompilerBinDir = "$($env:CONDA_PREFIX)\Library\bin\Hostx64\x64" |
| 143 | + echo "Adding $CompilerBinDir to PATH" |
| 144 | + $env:PATH = "$CompilerBinDir;$($env:PATH)" |
| 145 | +
|
| 146 | + nmake /NOLOGO /F Makefile.win |
| 147 | + if ($LastExitCode -ne 0) { throw "nmake build failed!" } |
| 148 | +
|
| 149 | + nmake /NOLOGO /F Makefile.win install |
| 150 | + if ($LastExitCode -ne 0) { throw "nmake install failed!" } |
| 151 | +
|
| 152 | + echo "Build and install complete." |
| 153 | +
|
| 154 | + echo "--- Debug: Checking for files AFTER 'nmake install' ---" |
| 155 | + $DstDir = "$($env:CONDA_PREFIX)\Library\share\extension" |
| 156 | + ls -l $DstDir |
| 157 | + echo "--------------------------------------------------------" |
| 158 | +
|
| 159 | + cd .. |
| 160 | +
|
| 161 | + initdb -D postgres_data --encoding=UTF-8 --lc-collate=C --lc-ctype=C |
| 162 | + pg_ctl -D postgres_data -o "-F" -l logfile start |
| 163 | + createuser -U runneradmin -s memmachine |
| 164 | + createdb -U runneradmin -O memmachine memmachine |
| 165 | + psql -U runneradmin -d postgres -c "ALTER USER memmachine WITH PASSWORD 'mammachine_password';" |
| 166 | + psql -d memmachine -U memmachine -c "CREATE EXTENSION IF NOT EXISTS vector;" |
| 167 | +
|
| 168 | + - name: Set up ollama |
| 169 | + shell: bash |
| 170 | + run: | |
| 171 | + set -eo pipefail |
| 172 | + winget install Ollama.Ollama --accept-source-agreements |
| 173 | +
|
| 174 | + until curl -s http://localhost:11434/ > /dev/null; do |
| 175 | + echo "Ollama not up yet, sleeping..." |
| 176 | + sleep 1 |
| 177 | + done |
| 178 | +
|
| 179 | + echo "Ollama is up, loading model..." |
| 180 | + curl http://localhost:11434/api/pull -d '{ |
| 181 | + "name": "qwen3:0.6b" |
| 182 | + }' -v |
| 183 | + echo "pulled model qwen3:0.6b into ollama" |
| 184 | +
|
| 185 | + curl http://localhost:11434/api/pull -d '{ |
| 186 | + "name": "nomic-embed-text" |
| 187 | + }' -v |
| 188 | + echo "pulled model nomic-embed-text into ollama" |
| 189 | +
|
| 190 | + - name: Test install on Windows |
| 191 | + run: | |
| 192 | + set -eo pipefail |
| 193 | + export PYTHONUTF8=1 |
| 194 | + whl_name=$(ls *.whl) |
| 195 | + echo "Installing wheel file: $whl_name" |
| 196 | + python -m pip install $whl_name |
| 197 | + echo "configuring memmachine" |
| 198 | + memmachine-configure << EOF |
| 199 | + y |
| 200 | +
|
| 201 | + CPU |
| 202 | + Ollama |
| 203 | + qwen3:0.6b |
| 204 | + nomic-embed-text |
| 205 | + localhost |
| 206 | + 5432 |
| 207 | + memmachine |
| 208 | + mammachine_password |
| 209 | + memmachine |
| 210 | + http://localhost:11434/v1 |
| 211 | + localhost |
| 212 | + 8080 |
| 213 | + EOF |
| 214 | +
|
| 215 | + python -c "import nltk; nltk.download('punkt')" |
| 216 | + memmachine-nltk-setup |
| 217 | + memmachine-sync-profile-schema |
| 218 | +
|
| 219 | + memmachine-server & |
| 220 | + server_pid=$! |
| 221 | + sleep 5 |
| 222 | +
|
| 223 | + curl -f http://127.0.0.1:8080/v1/sessions |
| 224 | +
|
| 225 | + shell: bash |
| 226 | + |
| 227 | + check-macos: |
| 228 | + needs: build |
| 229 | + runs-on: macos-latest |
| 230 | + |
| 231 | + steps: |
| 232 | + - name: Set up Python 3.12 |
| 233 | + uses: actions/setup-python@v5 |
| 234 | + with: |
| 235 | + python-version: "3.12" |
| 236 | + |
| 237 | + - name: Download built distributions |
| 238 | + uses: actions/download-artifact@v4 |
| 239 | + with: |
| 240 | + name: python-package-dist |
| 241 | + |
| 242 | + - name: Set up postgresql (pgvector) using Homebrew |
| 243 | + run: | |
| 244 | + set -eo pipefail |
| 245 | + brew update |
| 246 | + brew upgrade |
| 247 | +
|
| 248 | + brew install postgresql@18 |
| 249 | + brew install pgvector |
| 250 | + rm -rf /opt/homebrew/var/postgresql@18 |
| 251 | + "/opt/homebrew/opt/postgresql@18/bin/initdb" -D /opt/homebrew/var/postgresql@18 --encoding=UTF-8 --lc-collate=C --lc-ctype=C |
| 252 | + brew services start postgresql@18 |
| 253 | +
|
| 254 | + export PATH="/opt/homebrew/opt/postgresql@18/bin:$PATH" |
| 255 | + while ! pg_isready -q; do |
| 256 | + sleep 1 |
| 257 | + done |
| 258 | +
|
| 259 | + createuser -s memmachine |
| 260 | + createdb -O memmachine memmachine |
| 261 | + psql -d postgres -c "ALTER USER memmachine WITH PASSWORD 'mammachine_password';" |
| 262 | + psql -d memmachine -U memmachine -c "CREATE EXTENSION IF NOT EXISTS vector;" |
| 263 | +
|
| 264 | + - name: Set up ollama |
| 265 | + run: | |
| 266 | + set -eo pipefail |
| 267 | + brew install ollama |
| 268 | + brew services start ollama |
| 269 | + until curl -s http://localhost:11434/ > /dev/null; do |
| 270 | + echo "Ollama not up yet, sleeping..." |
| 271 | + sleep 1 |
| 272 | + done |
| 273 | +
|
| 274 | + echo "Ollama is up, loading model..." |
| 275 | + curl http://localhost:11434/api/pull -d '{ |
| 276 | + "name": "qwen3:0.6b" |
| 277 | + }' -v |
| 278 | + echo "pulled model qwen3:0.6b into ollama" |
| 279 | +
|
| 280 | + curl http://localhost:11434/api/pull -d '{ |
| 281 | + "name": "nomic-embed-text" |
| 282 | + }' -v |
| 283 | + echo "pulled model nomic-embed-text into ollama" |
| 284 | +
|
| 285 | + - name: Test install on macOS |
| 286 | + run: | |
| 287 | + set -eo pipefail |
| 288 | + whl_name=$(ls *.whl) |
| 289 | + echo "Installing wheel file: $whl_name" |
| 290 | + python -m pip install $whl_name |
| 291 | + echo "configuring memmachine" |
| 292 | + memmachine-configure << EOF |
| 293 | + y |
| 294 | + CPU |
| 295 | + OpenAI |
| 296 | + gpt-4o-mini |
| 297 | + text-embedding-3-small |
| 298 | + localhost |
| 299 | + 5432 |
| 300 | + memmachine |
| 301 | + mammachine_password |
| 302 | + memmachine |
| 303 | + sk-test |
| 304 | + localhost |
| 305 | + 8080 |
| 306 | + EOF |
| 307 | + memmachine-nltk-setup |
| 308 | + memmachine-sync-profile-schema |
| 309 | +
|
| 310 | + memmachine-server & |
| 311 | + server_pid=$! |
| 312 | + sleep 5 |
| 313 | + curl -f http://127.0.0.1:8080/v1/sessions |
| 314 | + shell: bash |
0 commit comments