From 42ad5d731123dc165b7b9343359e25b6d7b42ad1 Mon Sep 17 00:00:00 2001 From: Sertac Ozercan Date: Mon, 4 Dec 2023 01:47:44 +0000 Subject: [PATCH] use tinyllama Signed-off-by: Sertac Ozercan --- .github/workflows/pre-release.yaml | 8 ++++++++ .github/workflows/release.yaml | 8 ++++++++ .github/workflows/test-docker.yaml | 13 +++++++++++-- .github/workflows/update-models.yaml | 3 ++- test/aikitfile.yaml | 1 + test/bats/test.bats | 4 ++-- 6 files changed, 32 insertions(+), 5 deletions(-) diff --git a/.github/workflows/pre-release.yaml b/.github/workflows/pre-release.yaml index af59653b..18f6b827 100644 --- a/.github/workflows/pre-release.yaml +++ b/.github/workflows/pre-release.yaml @@ -51,3 +51,11 @@ jobs: env: DIGEST: ${{ steps.build-and-push.outputs.digest }} run: cosign sign --yes "ghcr.io/sozercan/aikit@${DIGEST}" + + - name: Verify image signature + env: + DIGEST: ${{ steps.build-and-push.outputs.digest }} + run: | + cosign verify ghcr.io/sozercan/${{ env.MODEL_NAME }}:${{ env.MODEL_SIZE }}${{ env.MODEL_RUNTIME }}@${DIGEST} \ + --certificate-identity https://github.com/sozercan/aikit/.github/workflows/pre-release.yaml@refs/heads/main \ + --certificate-oidc-issuer https://token.actions.githubusercontent.com | jq diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 8a2cb95e..13f64e1a 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -58,3 +58,11 @@ jobs: env: DIGEST: ${{ steps.build-and-push.outputs.digest }} run: cosign sign --yes "ghcr.io/sozercan/aikit@${DIGEST}" + + - name: Verify image signature + env: + DIGEST: ${{ steps.build-and-push.outputs.digest }} + run: | + cosign verify ghcr.io/sozercan/${{ env.MODEL_NAME }}:${{ env.MODEL_SIZE }}${{ env.MODEL_RUNTIME }}@${DIGEST} \ + --certificate-identity https://github.com/sozercan/aikit/.github/workflows/release.yaml@refs/heads/main \ + --certificate-oidc-issuer https://token.actions.githubusercontent.com | jq diff --git a/.github/workflows/test-docker.yaml b/.github/workflows/test-docker.yaml index 28c96856..978ea61c 100644 --- a/.github/workflows/test-docker.yaml +++ b/.github/workflows/test-docker.yaml @@ -42,10 +42,19 @@ jobs: - uses: crazy-max/ghaction-github-runtime@v3 - name: build aikit - run: docker buildx build . -t aikit:test --load --cache-from=type=gha,scope=aikit --cache-to=type=gha,scope=aikit,mode=max + run: | + docker buildx build . -t aikit:test \ + --load --progress plain \ + --cache-from=type=gha,scope=aikit \ + --cache-to=type=gha,scope=aikit,mode=max - name: build test model - run: docker buildx build . -t testmodel:test -f test/aikitfile.yaml --load --cache-from=type=gha,scope=testmodel --cache-to=type=gha,scope=testmodel,mode=max + run: | + docker buildx build . -t testmodel:test \ + -f test/aikitfile.yaml \ + --load --progress plain \ + --cache-from=type=gha,scope=testmodel \ + --cache-to=type=gha,scope=testmodel,mode=max - name: list images run: docker images diff --git a/.github/workflows/update-models.yaml b/.github/workflows/update-models.yaml index 4418dbf7..23b4a5d7 100644 --- a/.github/workflows/update-models.yaml +++ b/.github/workflows/update-models.yaml @@ -47,6 +47,7 @@ jobs: - name: Build and push uses: docker/build-push-action@v5 + id: build-and-push with: push: true tags: ghcr.io/sozercan/${{ env.MODEL_NAME }}:${{ env.MODEL_SIZE }}${{ env.MODEL_RUNTIME }} @@ -59,7 +60,7 @@ jobs: DIGEST: ${{ steps.build-and-push.outputs.digest }} run: cosign sign --yes "ghcr.io/sozercan/${{ env.MODEL_NAME }}:${{ env.MODEL_SIZE }}${{ env.MODEL_RUNTIME }}@${DIGEST}" - - name: verify image signature + - name: Verify image signature env: DIGEST: ${{ steps.build-and-push.outputs.digest }} run: | diff --git a/test/aikitfile.yaml b/test/aikitfile.yaml index 7b11030d..ada0c5ef 100644 --- a/test/aikitfile.yaml +++ b/test/aikitfile.yaml @@ -14,3 +14,4 @@ config: | top_p: 0.7 model: tinyllama-1.1b-chat-v0.3.Q4_K_M.gguf context_size: 1000 + mmap: false \ No newline at end of file diff --git a/test/bats/test.bats b/test/bats/test.bats index 90ab1631..0884d9f7 100644 --- a/test/bats/test.bats +++ b/test/bats/test.bats @@ -5,9 +5,9 @@ load helpers WAIT_TIME=120 SLEEP_TIME=1 -@test "send request to llama-2-7b-chat" { +@test "send request to tinyllama-1.1b-chat" { run curl --retry 20 --retry-all-errors http://localhost:8080/v1/chat/completions -H "Content-Type: application/json" -d '{ - "model": "llama-2-7b-chat", + "model": "tinyllama-1.1b-chat", "messages": [{"role": "user", "content": "explain kubernetes in a sentence"}], }' assert_success