Skip to content

Commit 4480c9e

Browse files
authored
Merge pull request #182 from nextcloud/backport/179/stable34
[stable34] tests(ci): Cache llm2 models in CI workflow
2 parents d46f82d + 8b90481 commit 4480c9e

1 file changed

Lines changed: 19 additions & 2 deletions

File tree

.github/workflows/integration_test.yml

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,22 +150,31 @@ jobs:
150150
sudo apt-get update
151151
sudo apt install pipx
152152
pipx install poetry
153+
mkdir -p ../llm2-persistent_storage
153154
poetry install
154155
156+
- name: Cache llm2 models
157+
uses: actions/cache/restore@v5
158+
id: cache-llm2-models-restore
159+
env:
160+
cache-name: cache-llm2-models
161+
with:
162+
path: llm2-persistent_storage/
163+
key: ${{ runner.os }}-llm2-models-${{ env.cache-name }}-${{ hashFiles('llm2/lib/main.py') }}
164+
155165
- name: Init llm2
156166
working-directory: llm2/lib
157167
env:
158168
APP_ID: llm2
159169
APP_PORT: 9080
160170
APP_VERSION: ${{ fromJson(steps.llm2_appinfo.outputs.result).version }}
161171
run: |
162-
poetry run python3 main.py > ../logs 2>&1 &
172+
APP_PERSISTENT_STORAGE="$(pwd)/../../llm2-persistent-storage/" poetry run python3 main.py > ../logs 2>&1 &
163173
164174
- name: Register backend
165175
run: |
166176
./occ app_api:app:register llm2 manual_install --json-info "{\"appid\":\"llm2\",\"name\":\"Local large language model\",\"daemon_config_name\":\"manual_install\",\"version\":\"${{ fromJson(steps.llm2_appinfo.outputs.result).version }}\",\"secret\":\"12345\",\"port\":9080,\"scopes\":[\"AI_PROVIDERS\", \"TASK_PROCESSING\"],\"system_app\":0}" --force-scopes --wait-finish
167177
168-
169178
- name: Install context_agent app
170179
working-directory: ${{ env.APP_NAME }}
171180
run: |
@@ -244,6 +253,14 @@ jobs:
244253
[ "$STATUS" = "200" ]
245254
echo "$BODY"
246255
echo "$BODY" | grep -q 'list_calendars'
256+
257+
- name: Cache llm2 models
258+
uses: actions/cache/save@v5
259+
env:
260+
cache-name: cache-llm2-models
261+
with:
262+
path: llm2-persistent_storage/
263+
key: ${{ steps.cache-llm2-models-restore.outputs.cache-primary-key }}
247264

248265
- name: Run task
249266
env:

0 commit comments

Comments
 (0)