Skip to content
This repository was archived by the owner on Jun 5, 2025. It is now read-only.

Commit b45f8d5

Browse files
author
Luke Hinds
authored
Merge pull request #455 from stacklok/sqlite-vec-ci
Automate sqlite-vec vector DB generation for images
2 parents 0c30fb5 + f72beb8 commit b45f8d5

File tree

2 files changed

+18
-22
lines changed

2 files changed

+18
-22
lines changed

.github/workflows/image-publish.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,16 +59,14 @@ jobs:
5959
github_token: ${{ github.token }}
6060
workflow: ".github/workflows/import_packages.yml"
6161
workflow_conclusion: success
62-
name: backup_weaviate
62+
name: sqlite_vectordb_file
6363
name_is_regexp: true
6464
skip_unpack: false
6565
if_no_artifact_found: ignore
6666
- name: Fetch latest FE commit SHA
6767
id: fetch_commit_fe_sha
6868
run: |
6969
echo "LATEST_RELEASE=$(curl -s "https://api.github.com/repos/stacklok/codegate-ui/releases/latest" -H "Authorization: Bearer ${{ secrets.GH_CI_TOKEN }}" | grep '"zipball_url":' | cut -d '"' -f 4)" >> $GITHUB_ENV
70-
- name: Rename to accommodate to image
71-
run: mv ./backup_weaviate ./weaviate_backup
7270
- name: Download git lfs dependencies
7371
run: |
7472
git lfs install

.github/workflows/import_packages.yml

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -51,33 +51,31 @@ jobs:
5151
github_token: ${{ github.token }}
5252
workflow: ".github/workflows/import_packages.yml"
5353
workflow_conclusion: success
54-
name: backup_weaviate
54+
name: sqlite_vectordb_file
5555
path: /tmp/
5656
name_is_regexp: true
5757
skip_unpack: false
58-
if_no_artifact_found: ignore
58+
if_no_artifact_found: ignore
5959

60-
- name: Create folder if artifact download is not enabled
61-
if: ${{ github.event.inputs.enable_artifact_download == 'false' }}
60+
- name: Install Poetry
6261
run: |
63-
mkdir -p /tmp/backup_weaviate
64-
echo "Folder ./backup_weaviate created because artifact download is disabled."
62+
curl -sSL https://install.python-poetry.org | python3 -
6563
66-
- name: Run sync
64+
- name: Add Poetry to PATH
6765
run: |
68-
export PYTHONPATH=$PYTHONPATH:./
69-
export BACKUP_FILESYSTEM_PATH=/tmp/backup_weaviate/
70-
export BACKUP_FOLDER=backup
71-
# Conditionally export the variables only if artifact download is enabled
72-
if [ "${{ github.event.inputs.enable_artifact_download }}" == "true" ]; then
73-
python scripts/import_packages.py --jsonl-dir /tmp/jsonl-files/
74-
else
75-
python scripts/import_packages.py --restore-backup False --jsonl-dir /tmp/jsonl-files/
76-
fi
66+
echo "source $HOME/.poetry/env" >> $GITHUB_ENV
7767
78-
- name: 'Upload Backup Files'
68+
- name: Install dependencies with Poetry
69+
run: |
70+
poetry install
71+
72+
- name: 'Run import_packages.py with poetry'
73+
run: |
74+
poetry run python scripts/import_packages.py --jsonl-dir /tmp --vec-db-path /tmp/sqlite_data/vectordb.db
75+
76+
- name: 'Upload SQLite Vector DB File'
7977
uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b # v4
8078
with:
81-
name: backup_weaviate
82-
path: /tmp/backup_weaviate/backup*
79+
name: sqlite_vectordb_file
80+
path: /tmp/sqlite_data/vectordb.db
8381
retention-days: 90

0 commit comments

Comments
 (0)