55 types : [opened, synchronize, reopened, ready_for_review]
66 paths : ["engine/**", ".github/workflows/cortex-cpp-quality-gate.yml"]
77 workflow_dispatch :
8+ schedule :
9+ - cron : ' 0 22 * * *'
810
911env :
1012 LLM_MODEL_URL : https://delta.jan.ai/tinyllama-1.1b-chat-v0.3.Q2_K.gguf
@@ -102,7 +104,7 @@ jobs:
102104 cd engine
103105 echo "huggingFaceToken: ${{ secrets.HUGGINGFACE_TOKEN_READ }}" > ~/.cortexrc
104106 echo "gitHubToken: ${{ secrets.PAT_SERVICE_ACCOUNT }}" >> ~/.cortexrc
105- ./build/cortex
107+ # ./build/cortex
106108 cat ~/.cortexrc
107109
108110 - name : Run unit tests
@@ -115,10 +117,10 @@ jobs:
115117 - name : Run setup config
116118 run : |
117119 cd engine
118- echo "huggingFaceToken: ${{ secrets.HUGGINGFACE_TOKEN_READ }}" > ~/.cortexrc
120+ echo "apiServerPort: 3928" > ~/.cortexrc
121+ echo "huggingFaceToken: ${{ secrets.HUGGINGFACE_TOKEN_READ }}" >> ~/.cortexrc
119122 echo "gitHubToken: ${{ secrets.PAT_SERVICE_ACCOUNT }}" >> ~/.cortexrc
120- echo "apiServerPort: 3928" >> ~/.cortexrc
121- ./build/cortex
123+ # ./build/cortex
122124 cat ~/.cortexrc
123125
124126 - name : Run e2e tests
@@ -149,6 +151,34 @@ jobs:
149151 env :
150152 GITHUB_TOKEN : ${{ secrets.PAT_SERVICE_ACCOUNT }}
151153
154+ - name : Run e2e tests
155+ if : github.event_name == 'schedule' && runner.os != 'Windows' && github.event.pull_request.draft == false
156+ run : |
157+ cd engine
158+ cp build/cortex build/cortex-nightly
159+ cp build/cortex build/cortex-beta
160+ python -m pip install --upgrade pip
161+ python -m pip install -r e2e-test/requirements.txt
162+ python e2e-test/cortex-llamacpp-e2e-nightly.py
163+ rm build/cortex-nightly
164+ rm build/cortex-beta
165+ env :
166+ GITHUB_TOKEN : ${{ secrets.PAT_SERVICE_ACCOUNT }}
167+
168+ - name : Run e2e tests
169+ if : github.event_name == 'schedule' && runner.os == 'Windows' && github.event.pull_request.draft == false
170+ run : |
171+ cd engine
172+ cp build/cortex.exe build/cortex-nightly.exe
173+ cp build/cortex.exe build/cortex-beta.exe
174+ python -m pip install --upgrade pip
175+ python -m pip install -r e2e-test/requirements.txt
176+ python e2e-test/cortex-llamacpp-e2e-nightly.py
177+ rm build/cortex-nightly.exe
178+ rm build/cortex-beta.exe
179+ env :
180+ GITHUB_TOKEN : ${{ secrets.PAT_SERVICE_ACCOUNT }}
181+
152182 - name : Pre-package
153183 run : |
154184 cd engine
@@ -188,40 +218,58 @@ jobs:
188218 AWS_SECRET_ACCESS_KEY : " ${{ secrets.MINIO_SECRET_ACCESS_KEY }}"
189219 AWS_DEFAULT_REGION : " ${{ secrets.MINIO_REGION }}"
190220
191- # build-docker-and-test:
192- # runs-on: ubuntu-latest
193- # steps:
194- # - name: Getting the repo
195- # uses: actions/checkout@v3
196- # with:
197- # submodules: 'recursive'
221+ build-docker-and-test :
222+ runs-on : ubuntu-24-04-docker
223+ steps :
224+ - name : Getting the repo
225+ uses : actions/checkout@v3
226+ with :
227+ submodules : ' recursive'
228+
229+ - name : Run Docker
230+ if : github.event_name != 'schedule'
231+ run : |
232+ docker build \
233+ --build-arg REMOTE_CACHE_URL="${{ secrets.MINIO_ENDPOINT }}/vcpkg-cache" \
234+ --build-arg MINIO_ENDPOINT_URL="${{ secrets.MINIO_ENDPOINT }}" \
235+ --build-arg MINIO_ACCESS_KEY="${{ secrets.MINIO_ACCESS_KEY_ID }}" \
236+ --build-arg MINIO_SECRET_KEY="${{ secrets.MINIO_SECRET_ACCESS_KEY }}" \
237+ -t menloltd/cortex:test -f docker/Dockerfile.cache .
238+ docker run -it -d -p 3928:39281 --name cortex menloltd/cortex:test
239+ sleep 20
198240
199- # - name: Set up QEMU
200- # uses: docker/setup-qemu-action@v3
241+ - name : Run Docker
242+ if : github.event_name == 'schedule'
243+ run : |
244+ latest_prerelease=$(curl -s https://api.github.com/repos/cortexcpp/cortex.cpp/releases | jq -r '.[] | select(.prerelease == true) | .tag_name' | head -n 1)
245+ echo "cortex.llamacpp latest release: $latest_prerelease"
246+ docker build \
247+ --build-arg REMOTE_CACHE_URL="${{ secrets.MINIO_ENDPOINT }}/vcpkg-cache" \
248+ --build-arg MINIO_ENDPOINT_URL="${{ secrets.MINIO_ENDPOINT }}" \
249+ --build-arg MINIO_ACCESS_KEY="${{ secrets.MINIO_ACCESS_KEY_ID }}" \
250+ --build-arg MINIO_SECRET_KEY="${{ secrets.MINIO_SECRET_ACCESS_KEY }}" \
251+ --build-arg CORTEX_CPP_VERSION="${latest_prerelease}" \
252+ -t menloltd/cortex:test -f docker/Dockerfile.cache .
253+ docker run -it -d -p 3928:39281 --name cortex menloltd/cortex:test
254+ sleep 20
201255
202- # - name: Set up Docker Buildx
203- # uses: docker/setup-buildx-action@v3
204-
205- # - name: Run Docker
206- # run: |
207- # docker build -t menloltd/cortex:test -f docker/Dockerfile .
208- # docker run -it -d -p 3928:39281 --name cortex menloltd/cortex:test
209-
210- # - name: use python
211- # uses: actions/setup-python@v5
212- # with:
213- # python-version: "3.10"
214-
215- # - name: Run e2e tests
216- # run: |
217- # cd engine
218- # python -m pip install --upgrade pip
219- # python -m pip install -r e2e-test/requirements.txt
220- # pytest e2e-test/test_api_docker.py
221-
222- # - name: Run Docker
223- # continue-on-error: true
224- # if: always()
225- # run: |
226- # docker stop cortex
227- # docker rm cortex
256+ - name : use python
257+ uses : actions/setup-python@v5
258+ with :
259+ python-version : " 3.10"
260+
261+ - name : Run e2e tests
262+ run : |
263+ cd engine
264+ python -m pip install --upgrade pip
265+ python -m pip install -r e2e-test/requirements.txt
266+ pytest e2e-test/test_api_docker.py
267+
268+ - name : Run Docker
269+ continue-on-error : true
270+ if : always()
271+ run : |
272+ docker logs cortex
273+ docker stop cortex
274+ docker rm cortex
275+ echo "y\n" | docker system prune -af
0 commit comments