-
Notifications
You must be signed in to change notification settings - Fork 115
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Liora Milbaum <[email protected]>
- Loading branch information
Showing
4 changed files
with
44 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,9 +25,17 @@ jobs: | |
matrix: | ||
include: | ||
- image_name: llamacpp_python | ||
image_tag: latest | ||
model: mistral | ||
type: base | ||
- image_name: llamacpp_python | ||
image_tag: latest-cuda | ||
model: mistral | ||
type: cuda | ||
- image_name: whispercpp | ||
image_tag: latest | ||
model: whisper-small | ||
type: base | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
|
@@ -45,14 +53,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 | ||
tags: ${{ matrix.image_tag }} | ||
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: ${{ matrix.image_tag }} | ||
containerfiles: ./model_servers/${{ matrix.image_name }}/${{ matrix.type }}/Containerfile | ||
context: model_servers/${{ matrix.image_name }}/ | ||
|
||
- name: Download model | ||
|
@@ -68,11 +87,17 @@ jobs: | |
working-directory: ./model_servers/${{ matrix.image_name }}/ | ||
run: make install | ||
|
||
- name: Install cuda dependencies | ||
if: matrix.type == 'cuda' | ||
working-directory: ./model_servers/${{ matrix.image_name }}/ | ||
run: sudo apt-get install cuda-drivers-418 | ||
|
||
- name: Run tests | ||
working-directory: ./model_servers/${{ matrix.image_name }}/ | ||
run: make test | ||
env: | ||
IMAGE_NAME: ${{ matrix.image_name }} | ||
IMAGE_TAG: ${{ matrix.image_tag }} | ||
|
||
- name: Login to Container Registry | ||
if: github.event_name == 'push' && github.ref == 'refs/heads/main' | ||
|
@@ -82,11 +107,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 }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters