From 07b50b42d50baf39b86a1c7c3d03724a28a21d7a Mon Sep 17 00:00:00 2001 From: Jeff MAURY Date: Tue, 26 Nov 2024 17:12:14 +0100 Subject: [PATCH 1/5] fix: update image to support usage info Signed-off-by: Jeff MAURY --- .github/workflows/build-publish.yaml | 5 +++++ .github/workflows/pr-check.yaml | 5 +++++ .github/workflows/release.yaml | 5 +++++ chat/base/Containerfile | 1 + chat/cuda/amd64/Containerfile | 1 + chat/requirements.txt | 2 +- chat/setup.sh | 6 ++++++ chat/vulkan/amd64/Containerfile | 1 + chat/vulkan/arm64/Containerfile | 1 + 9 files changed, 26 insertions(+), 1 deletion(-) create mode 100755 chat/setup.sh diff --git a/.github/workflows/build-publish.yaml b/.github/workflows/build-publish.yaml index 8632b92..2c05f70 100644 --- a/.github/workflows/build-publish.yaml +++ b/.github/workflows/build-publish.yaml @@ -53,6 +53,11 @@ jobs: sudo apt-get update sudo apt-get install -y qemu-user-static + - name: Clone llama-cpp-python + run: | + cd chat + ./setup.sh + - name: Build Playground Image id: build-image uses: redhat-actions/buildah-build@v2 diff --git a/.github/workflows/pr-check.yaml b/.github/workflows/pr-check.yaml index e990f45..f0357f0 100644 --- a/.github/workflows/pr-check.yaml +++ b/.github/workflows/pr-check.yaml @@ -49,6 +49,11 @@ jobs: sudo apt-get update sudo apt-get install -y qemu-user-static + - name: Clone llama-cpp-python + run: | + cd chat + ./setup.sh + - name: Build Playground Image id: build-image uses: redhat-actions/buildah-build@v2 diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 2f8d840..5cc0f63 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -89,6 +89,11 @@ jobs: sudo apt-get update sudo apt-get install -y qemu-user-static + - name: Clone llama-cpp-python + run: | + cd chat + ./setup.sh + - name: Build Playground Image id: build-image uses: redhat-actions/buildah-build@v2 diff --git a/chat/base/Containerfile b/chat/base/Containerfile index 23efe9c..a2c59c9 100644 --- a/chat/base/Containerfile +++ b/chat/base/Containerfile @@ -21,6 +21,7 @@ RUN microdnf install -y python3 python3-pip gcc g++ shadow-utils && microdnf cle RUN useradd -r -g root -m -d /home/default -s /bin/bash default WORKDIR /home/default COPY requirements.txt requirements.txt +COPY llama-cpp-python llama-cpp-python RUN pip install --no-cache-dir --upgrade -r requirements.txt USER default COPY run.sh run.sh diff --git a/chat/cuda/amd64/Containerfile b/chat/cuda/amd64/Containerfile index 86d94c3..bf14595 100644 --- a/chat/cuda/amd64/Containerfile +++ b/chat/cuda/amd64/Containerfile @@ -20,6 +20,7 @@ RUN dnf install -y gcc-toolset-13-gcc gcc-toolset-13-gcc-c++ USER 1001 WORKDIR /locallm COPY requirements.txt . +COPY --chown=1001 llama-cpp-python llama-cpp-python COPY run.sh . ENV CMAKE_ARGS="-DGGML_CUDA=on -DLLAMA_AVX2=OFF -DLLAMA_FMA=OFF -DLLAMA_F16C=OFF" ENV FORCE_CMAKE=1 diff --git a/chat/requirements.txt b/chat/requirements.txt index 8bee099..dc6afb3 100644 --- a/chat/requirements.txt +++ b/chat/requirements.txt @@ -1,2 +1,2 @@ -llama-cpp-python[server]==0.3.2 +./llama-cpp-python[server] pip==24.3.1 diff --git a/chat/setup.sh b/chat/setup.sh new file mode 100755 index 0000000..f9b2de6 --- /dev/null +++ b/chat/setup.sh @@ -0,0 +1,6 @@ +git clone https://github.com/abetlen/llama-cpp-python --no-checkout --recurse-submodules +cd llama-cpp-python +git checkout v0.3.2 +git submodule update +curl -O -L https://github.com/abetlen/llama-cpp-python/pull/1552.diff +git apply 1552.diff diff --git a/chat/vulkan/amd64/Containerfile b/chat/vulkan/amd64/Containerfile index 0dfe368..79bfeb3 100644 --- a/chat/vulkan/amd64/Containerfile +++ b/chat/vulkan/amd64/Containerfile @@ -32,6 +32,7 @@ RUN dnf install -y python3-dnf-plugin-versionlock && \ WORKDIR /locallm COPY requirements.txt ./ +COPY llama-cpp-python llama-cpp-python RUN pip install --upgrade pip ENV CMAKE_ARGS="-DGGML_VULKAN=on" ENV FORCE_CMAKE=1 diff --git a/chat/vulkan/arm64/Containerfile b/chat/vulkan/arm64/Containerfile index 48c9373..c130668 100644 --- a/chat/vulkan/arm64/Containerfile +++ b/chat/vulkan/arm64/Containerfile @@ -30,6 +30,7 @@ https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm && \ dnf install -y glslc && \ dnf clean all COPY requirements.txt ./ +COPY llama-cpp-python llama-cpp-python RUN pip install --upgrade pip ENV CMAKE_ARGS="-DGGML_VULKAN=on" ENV FORCE_CMAKE=1 From cb90220bf617c24b848a210ded3f773714a828bd Mon Sep 17 00:00:00 2001 From: Jeff MAURY Date: Wed, 27 Nov 2024 14:01:32 +0100 Subject: [PATCH 2/5] fix: use rebase instead of apply Signed-off-by: Jeff MAURY --- chat/setup.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/chat/setup.sh b/chat/setup.sh index f9b2de6..71a2969 100755 --- a/chat/setup.sh +++ b/chat/setup.sh @@ -2,5 +2,4 @@ git clone https://github.com/abetlen/llama-cpp-python --no-checkout --recurse-su cd llama-cpp-python git checkout v0.3.2 git submodule update -curl -O -L https://github.com/abetlen/llama-cpp-python/pull/1552.diff -git apply 1552.diff +git rebase ffc47e5a95cf31fe6d9d6d7953d5eb17fdcc8513 From 6a9f3bc2305488994bbf2e40170f165bceeaf1b6 Mon Sep 17 00:00:00 2001 From: Jeff MAURY Date: Wed, 27 Nov 2024 14:27:07 +0100 Subject: [PATCH 3/5] fix: fix setup file Signed-off-by: Jeff MAURY --- chat/setup.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/chat/setup.sh b/chat/setup.sh index 71a2969..19cdb12 100755 --- a/chat/setup.sh +++ b/chat/setup.sh @@ -2,4 +2,5 @@ git clone https://github.com/abetlen/llama-cpp-python --no-checkout --recurse-su cd llama-cpp-python git checkout v0.3.2 git submodule update +git fetch origin pull/1552/head git rebase ffc47e5a95cf31fe6d9d6d7953d5eb17fdcc8513 From 97e3ce71b8d7f713caf6bd420efd53e27363b6a3 Mon Sep 17 00:00:00 2001 From: Jeff MAURY Date: Wed, 27 Nov 2024 14:27:21 +0100 Subject: [PATCH 4/5] fix: add gitignore Signed-off-by: Jeff MAURY --- .gitignore | 1 + 1 file changed, 1 insertion(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..8a64383 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +llama-cpp-python From c1dbe65e041ae89389d18a054d0c3413a3f2b3ec Mon Sep 17 00:00:00 2001 From: Jeff MAURY Date: Wed, 27 Nov 2024 14:35:11 +0100 Subject: [PATCH 5/5] fix: update git info Signed-off-by: Jeff MAURY --- .github/workflows/build-publish.yaml | 2 ++ .github/workflows/pr-check.yaml | 2 ++ .github/workflows/release.yaml | 4 +++- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-publish.yaml b/.github/workflows/build-publish.yaml index 2c05f70..e755415 100644 --- a/.github/workflows/build-publish.yaml +++ b/.github/workflows/build-publish.yaml @@ -55,6 +55,8 @@ jobs: - name: Clone llama-cpp-python run: | + git config --global user.email "podman-deskop@redhat.com" + git config --global user.name "Podman Desktop team" cd chat ./setup.sh diff --git a/.github/workflows/pr-check.yaml b/.github/workflows/pr-check.yaml index f0357f0..1e658f2 100644 --- a/.github/workflows/pr-check.yaml +++ b/.github/workflows/pr-check.yaml @@ -51,6 +51,8 @@ jobs: - name: Clone llama-cpp-python run: | + git config --global user.email "podman-deskop@redhat.com" + git config --global user.name "Podman Desktop team" cd chat ./setup.sh diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 5cc0f63..d4177a5 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -91,6 +91,8 @@ jobs: - name: Clone llama-cpp-python run: | + git config --global user.email "podman-deskop@redhat.com" + git config --global user.name "Podman Desktop team" cd chat ./setup.sh @@ -135,4 +137,4 @@ jobs: with: tag: ${{ needs.tag.outputs.githubTag }} name: ${{ needs.tag.outputs.githubTag }} - \ No newline at end of file +