Skip to content

Commit

Permalink
Build cuda image
Browse files Browse the repository at this point in the history
Signed-off-by: Liora Milbaum <[email protected]>
  • Loading branch information
lmilbaum committed Apr 11, 2024
1 parent 96555a1 commit 9c8ae16
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 11 deletions.
39 changes: 31 additions & 8 deletions .github/workflows/model_servers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,13 @@ jobs:
include:
- image_name: llamacpp_python
model: mistral
type: base
- image_name: llamacpp_python_cuda
model: mistral
type: cuda
- image_name: whispercpp
model: whisper-small
type: base
runs-on: ubuntu-latest
permissions:
contents: read
Expand All @@ -45,14 +50,25 @@ jobs:
sudo apt-get update
sudo apt-get install -y qemu-user-static
- name: Build Image
id: build_image
- name: Build Image (base)
id: build_image_base
if: matrix.type == 'base'
uses: redhat-actions/[email protected]
with:
image: ${{ env.REGISTRY }}/${{ github.repository_owner}}/${{ matrix.image_name }}
platforms: linux/amd64, linux/arm64
tags: latest
containerfiles: ./model_servers/${{ matrix.image_name }}/base/Containerfile
containerfiles: ./model_servers/${{ matrix.image_name }}/${{ matrix.type }}/Containerfile
context: model_servers/${{ matrix.image_name }}/

- name: Build Image (cuda)
id: build_image_cuda
if: matrix.type == 'cuda'
uses: redhat-actions/[email protected]
with:
image: ${{ env.REGISTRY }}/${{ github.repository_owner}}/${{ matrix.image_name }}
tags: latest
containerfiles: ./model_servers/${{ matrix.image_name }}/${{ matrix.type }}/Containerfile
context: model_servers/${{ matrix.image_name }}/

- name: Download model
Expand Down Expand Up @@ -82,11 +98,18 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Push image
id: push_image
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
- name: Push image (base)
if: github.event_name == 'push' && github.ref == 'refs/heads/main' && matrix.type == 'base'
uses: redhat-actions/[email protected]
with:
image: ${{ steps.build_image_base.outputs.image }}
tags: ${{ steps.build_image_base.outputs.tags }}
registry: ${{ env.REGISTRY }}

- name: Push image (cuda)
if: github.event_name == 'push' && github.ref == 'refs/heads/main' && matrix.type == 'cuda'
uses: redhat-actions/[email protected]
with:
image: ${{ steps.build_image.outputs.image }}
tags: ${{ steps.build_image.outputs.tags }}
image: ${{ steps.build_image_cuda.outputs.image }}
tags: ${{ steps.build_image_cuda.outputs.tags }}
registry: ${{ env.REGISTRY }}
5 changes: 2 additions & 3 deletions model_servers/llamacpp_python/cuda/Containerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
FROM quay.io/opendatahub/workbench-images:cuda-ubi9-python-3.9-20231206
WORKDIR /locallm
COPY src .
RUN pip install --upgrade pip
ENV CMAKE_ARGS="-DLLAMA_CUBLAS=on"
ENV FORCE_CMAKE=1
RUN pip install --no-cache-dir --upgrade -r /locallm/requirements.txt
ENTRYPOINT [ "sh", "run.sh" ]
RUN pip install --no-cache-dir -r ./requirements.txt
ENTRYPOINT [ "sh", "run.sh" ]

0 comments on commit 9c8ae16

Please sign in to comment.