|
| 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: install postgresql |
| 127 | + run: | |
| 128 | + conda install -c conda-forge postgresql |
| 129 | + conda install -c conda-forge pgvector |
| 130 | +
|
| 131 | + echo "--- Debug: Manually copying pgvector files ---" |
| 132 | + |
| 133 | + $SrcDir = "$($env:CONDA_PREFIX)\Library\share\postgresql\extension" |
| 134 | + $DstDir = "$($env:CONDA_PREFIX)\Library\share\extension" |
| 135 | + |
| 136 | + echo "Source dir: $SrcDir" |
| 137 | + echo "Destination dir: $DstDir" |
| 138 | +
|
| 139 | + Copy-Item -Path "$SrcDir\vector.control" -Destination $DstDir -Force |
| 140 | + Copy-Item -Path "$SrcDir\vector--*.sql" -Destination $DstDir -Force |
| 141 | +
|
| 142 | + ls -l C:/Miniconda/envs/test/Library/share/extension/ |
| 143 | + initdb -D postgres_data --encoding=UTF-8 --lc-collate=C --lc-ctype=C |
| 144 | + pg_ctl -D postgres_data -o "-F" -l logfile start |
| 145 | + createuser -U runneradmin -s memmachine |
| 146 | + createdb -U runneradmin -O memmachine memmachine |
| 147 | + psql -U runneradmin -d postgres -c "ALTER USER memmachine WITH PASSWORD 'mammachine_password';" |
| 148 | + psql -d memmachine -U memmachine -c "CREATE EXTENSION IF NOT EXISTS vector;" |
| 149 | +
|
| 150 | + - name: Set up ollama |
| 151 | + shell: bash |
| 152 | + run: | |
| 153 | + set -eo pipefail |
| 154 | + winget install Ollama.Ollama --accept-source-agreements |
| 155 | +
|
| 156 | + until curl -s http://localhost:11434/ > /dev/null; do |
| 157 | + echo "Ollama not up yet, sleeping..." |
| 158 | + sleep 1 |
| 159 | + done |
| 160 | +
|
| 161 | + echo "Ollama is up, loading model..." |
| 162 | + curl http://localhost:11434/api/pull -d '{ |
| 163 | + "name": "qwen3:0.6b" |
| 164 | + }' -v |
| 165 | + echo "pulled model qwen3:0.6b into ollama" |
| 166 | +
|
| 167 | + curl http://localhost:11434/api/pull -d '{ |
| 168 | + "name": "nomic-embed-text" |
| 169 | + }' -v |
| 170 | + echo "pulled model nomic-embed-text into ollama" |
| 171 | +
|
| 172 | + - name: Test install on Windows |
| 173 | + run: | |
| 174 | + set -eo pipefail |
| 175 | + export PYTHONUTF8=1 |
| 176 | + whl_name=$(ls *.whl) |
| 177 | + echo "Installing wheel file: $whl_name" |
| 178 | + python -m pip install $whl_name |
| 179 | + echo "configuring memmachine" |
| 180 | + memmachine-configure << EOF |
| 181 | + y |
| 182 | +
|
| 183 | + CPU |
| 184 | + Ollama |
| 185 | + qwen3:0.6b |
| 186 | + nomic-embed-text |
| 187 | + localhost |
| 188 | + 5432 |
| 189 | + memmachine |
| 190 | + mammachine_password |
| 191 | + memmachine |
| 192 | + http://localhost:11434/v1 |
| 193 | + localhost |
| 194 | + 8080 |
| 195 | + EOF |
| 196 | +
|
| 197 | + python -c "import nltk; nltk.download('punkt')" |
| 198 | + memmachine-nltk-setup |
| 199 | + memmachine-sync-profile-schema |
| 200 | +
|
| 201 | + memmachine-server & |
| 202 | + server_pid=$! |
| 203 | + sleep 5 |
| 204 | +
|
| 205 | + curl -f http://127.0.0.1:8080/v1/sessions |
| 206 | +
|
| 207 | + shell: bash |
| 208 | + |
| 209 | + check-macos: |
| 210 | + needs: build |
| 211 | + runs-on: macos-latest |
| 212 | + |
| 213 | + steps: |
| 214 | + - name: Set up Python 3.12 |
| 215 | + uses: actions/setup-python@v5 |
| 216 | + with: |
| 217 | + python-version: "3.12" |
| 218 | + |
| 219 | + - name: Download built distributions |
| 220 | + uses: actions/download-artifact@v4 |
| 221 | + with: |
| 222 | + name: python-package-dist |
| 223 | + |
| 224 | + - name: Set up postgresql (pgvector) using Homebrew |
| 225 | + run: | |
| 226 | + set -eo pipefail |
| 227 | + brew update |
| 228 | + brew upgrade |
| 229 | +
|
| 230 | + brew install postgresql@18 |
| 231 | + brew install pgvector |
| 232 | + rm -rf /opt/homebrew/var/postgresql@18 |
| 233 | + "/opt/homebrew/opt/postgresql@18/bin/initdb" -D /opt/homebrew/var/postgresql@18 --encoding=UTF-8 --lc-collate=C --lc-ctype=C |
| 234 | + brew services start postgresql@18 |
| 235 | +
|
| 236 | + export PATH="/opt/homebrew/opt/postgresql@18/bin:$PATH" |
| 237 | + while ! pg_isready -q; do |
| 238 | + sleep 1 |
| 239 | + done |
| 240 | +
|
| 241 | + createuser -s memmachine |
| 242 | + createdb -O memmachine memmachine |
| 243 | + psql -d postgres -c "ALTER USER memmachine WITH PASSWORD 'mammachine_password';" |
| 244 | + psql -d memmachine -U memmachine -c "CREATE EXTENSION IF NOT EXISTS vector;" |
| 245 | +
|
| 246 | + - name: Set up ollama |
| 247 | + run: | |
| 248 | + set -eo pipefail |
| 249 | + brew install ollama |
| 250 | + brew services start ollama |
| 251 | + until curl -s http://localhost:11434/ > /dev/null; do |
| 252 | + echo "Ollama not up yet, sleeping..." |
| 253 | + sleep 1 |
| 254 | + done |
| 255 | +
|
| 256 | + echo "Ollama is up, loading model..." |
| 257 | + curl http://localhost:11434/api/pull -d '{ |
| 258 | + "name": "qwen3:0.6b" |
| 259 | + }' -v |
| 260 | + echo "pulled model qwen3:0.6b into ollama" |
| 261 | +
|
| 262 | + curl http://localhost:11434/api/pull -d '{ |
| 263 | + "name": "nomic-embed-text" |
| 264 | + }' -v |
| 265 | + echo "pulled model nomic-embed-text into ollama" |
| 266 | +
|
| 267 | + - name: Test install on macOS |
| 268 | + run: | |
| 269 | + set -eo pipefail |
| 270 | + whl_name=$(ls *.whl) |
| 271 | + echo "Installing wheel file: $whl_name" |
| 272 | + python -m pip install $whl_name |
| 273 | + echo "configuring memmachine" |
| 274 | + memmachine-configure << EOF |
| 275 | + y |
| 276 | + CPU |
| 277 | + OpenAI |
| 278 | + gpt-4o-mini |
| 279 | + text-embedding-3-small |
| 280 | + localhost |
| 281 | + 5432 |
| 282 | + memmachine |
| 283 | + mammachine_password |
| 284 | + memmachine |
| 285 | + sk-test |
| 286 | + localhost |
| 287 | + 8080 |
| 288 | + EOF |
| 289 | + memmachine-nltk-setup |
| 290 | + memmachine-sync-profile-schema |
| 291 | +
|
| 292 | + memmachine-server & |
| 293 | + server_pid=$! |
| 294 | + sleep 5 |
| 295 | + curl -f http://127.0.0.1:8080/v1/sessions |
| 296 | + shell: bash |
0 commit comments