Compare commits

...

46 Commits
v0.5.0 ... main

Author SHA1 Message Date
Jeff MAURY 99bbc94348
chore: reset content as those images are not used anymore (#122) 2025-05-19 09:26:43 +02:00
renovate[bot] e85acc66a1
chore(deps): update registry.access.redhat.com/ubi9/python-311 docker tag to v9.5-1747058512 (#118)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-05-12 23:40:53 +02:00
renovate[bot] bb893d5b78
chore(deps): update registry.access.redhat.com/ubi9/python-311 docker tag to v9.5-1746539270 (#117)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-05-07 08:15:51 +02:00
renovate[bot] e396602c2f
chore(deps): update dependency pip to v25.1.1 (#116)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-05-02 21:35:35 +02:00
renovate[bot] 943227cfd1
chore(deps): update registry.access.redhat.com/ubi9/python-311 docker tag to v9.5-1745945598 (#115)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-04-30 07:08:24 +02:00
renovate[bot] 3b5a11ebf0
chore(deps): update registry.access.redhat.com/ubi9-minimal docker tag to v9.5-1745855087 (#114)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-04-28 21:52:13 +02:00
renovate[bot] 6c8eeeb731
chore(deps): update dependency pip to v25.1 (#113)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-04-28 08:10:56 +02:00
renovate[bot] 1c362731e7
chore(deps): update registry.access.redhat.com/ubi9/python-311 docker tag to v9.5-1745330958 (#112)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-04-23 09:13:32 +02:00
renovate[bot] 477c9bed82
chore(deps): update registry.access.redhat.com/ubi9/python-311 docker tag to v9.5-1744097391 (#111)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-04-08 19:16:49 +02:00
renovate[bot] 4b6652c24b
chore(deps): update registry.access.redhat.com/ubi9/python-311 docker tag to v9.5-1743582312 (#110)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-04-03 08:54:19 +02:00
renovate[bot] 1e9c385485
chore(deps): update registry.access.redhat.com/ubi9/python-311 docker tag to v9.5-1743079393 (#109)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-03-29 17:02:08 +01:00
renovate[bot] bbc031fdb5
chore(deps): update registry.access.redhat.com/ubi9/python-311 docker tag to v9.5-1742996850 (#108)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-03-27 09:19:58 +01:00
renovate[bot] 68d06a0d82
chore(deps): update registry.access.redhat.com/ubi9/python-311 docker tag to v9.5-1742890420 (#106)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-03-26 10:08:02 +01:00
renovate[bot] 5e388b6699
chore(deps): update registry.access.redhat.com/ubi9-minimal docker tag to v9.5-1742914212 (#107)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-03-26 10:05:46 +01:00
renovate[bot] d062690d6f
chore(deps): update registry.access.redhat.com/ubi9/python-311 docker tag to v9.5-1742198934 (#105)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-03-17 14:54:01 +01:00
renovate[bot] d1dae62ea2
chore(deps): update registry.access.redhat.com/ubi9-minimal docker tag to v9.5-1741850109 (#104)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-03-13 15:39:01 +01:00
renovate[bot] f1ad3e7936
chore(deps): update registry.access.redhat.com/ubi9/python-311 docker tag to v9.5-1741671866 (#103)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-03-11 14:29:13 +01:00
renovate[bot] 274ff0845b
chore(deps): update registry.access.redhat.com/ubi9-minimal docker tag to v9.5-1741599792 (#102)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-03-10 12:18:46 +00:00
renovate[bot] 8f4a9ccbd3
chore(deps): update registry.access.redhat.com/ubi9/python-311 docker tag to v9.5-1741020859 (#101)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-03-05 09:54:46 +01:00
renovate[bot] 3c9ad15235
chore(deps): update registry.access.redhat.com/ubi9/python-311 docker tag to v9.5-1741002173 (#100)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-03-04 11:35:44 +01:00
renovate[bot] d2ce3fde6e chore(deps): update registry.access.redhat.com/ubi9-minimal docker tag to v9.5-1739420147 2025-02-13 07:42:24 +01:00
renovate[bot] 210fc3a954 chore(deps): update registry.access.redhat.com/ubi9-minimal docker tag to v9.5-1738816775 2025-02-09 20:09:14 +01:00
renovate[bot] da3eaa659c chore(deps): update dependency pip to v25.0.1 2025-02-09 20:08:59 +01:00
renovate[bot] baf7d715b1
chore(deps): update registry.access.redhat.com/ubi9-minimal docker tag to v9.5-1738643652 (#93)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-02-05 08:55:05 +01:00
renovate[bot] 5c57cf1190 chore(deps): update registry.access.redhat.com/ubi9/python-311 docker tag to v9.5-1737537151 2025-01-26 18:07:28 +01:00
renovate[bot] caf5c24803 chore(deps): update dependency pip to v25 2025-01-26 18:07:06 +01:00
renovate[bot] 2526949467
chore(deps): update registry.access.redhat.com/ubi9-minimal docker tag to v9.5-1736404155 (#90)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-01-09 10:02:43 +00:00
renovate[bot] a103cd302a
chore(deps): update registry.access.redhat.com/ubi9/python-311 docker tag to v9.5-1736353526 (#89)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-01-09 10:44:33 +01:00
renovate[bot] 416a402b82
chore(deps): update registry.access.redhat.com/ubi9/python-311 docker tag to v9.5-1734610704 (#88)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-12-20 15:08:25 +01:00
renovate[bot] 520ea22cb1
chore(deps): update registry.access.redhat.com/ubi9/python-311 docker tag to v9.5-1734553278 (#86)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-12-19 08:49:23 +01:00
renovate[bot] 8dc551eef0 chore(deps): update registry.access.redhat.com/ubi9-minimal docker tag to v9.5-1734497536 2024-12-19 07:50:54 +01:00
renovate[bot] cb27373e11
chore(deps): update registry.access.redhat.com/ubi9-minimal docker tag to v9.5-1733767867 (#85)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-12-10 09:03:14 +01:00
Jeff MAURY ad0b3ec9e5
fix: update image to support usage info (#81)
* fix: update image to support usage info

Signed-off-by: Jeff MAURY <jmaury@redhat.com>

* fix: use rebase instead of apply

Signed-off-by: Jeff MAURY <jmaury@redhat.com>

* fix: fix setup file

Signed-off-by: Jeff MAURY <jmaury@redhat.com>

* fix: add gitignore

Signed-off-by: Jeff MAURY <jmaury@redhat.com>

* fix: update git info

Signed-off-by: Jeff MAURY <jmaury@redhat.com>

---------

Signed-off-by: Jeff MAURY <jmaury@redhat.com>
2024-12-06 13:27:22 +01:00
renovate[bot] 5b637db4e8
chore(deps): update registry.access.redhat.com/ubi9/python-311 docker tag to v9.5-1733172699 (#84)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-12-04 16:09:56 +01:00
Jeff MAURY bd7faa1033 fix: fix renovate/registry.access.redhat.com-ubi9-python-311-9.x (#82)
Signed-off-by: Jeff MAURY <jmaury@redhat.com>
2024-11-29 16:07:59 +01:00
renovate[bot] 908751f1ee chore(deps): update registry.access.redhat.com/ubi9/python-311 docker tag to v9 2024-11-29 16:07:59 +01:00
dependabot[bot] 4143020fdf build(deps): Bump llama-cpp-python[server] from 0.3.1 to 0.3.2
Bumps [llama-cpp-python[server]](https://github.com/abetlen/llama-cpp-python) from 0.3.1 to 0.3.2.
- [Release notes](https://github.com/abetlen/llama-cpp-python/releases)
- [Changelog](https://github.com/abetlen/llama-cpp-python/blob/main/CHANGELOG.md)
- [Commits](https://github.com/abetlen/llama-cpp-python/compare/v0.3.1...v0.3.2)

---
updated-dependencies:
- dependency-name: llama-cpp-python[server]
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-11-18 11:47:18 +01:00
renovate[bot] d51dbef760 chore(deps): update registry.access.redhat.com/ubi9-minimal docker tag to v9.5-1731604394 2024-11-18 09:59:48 +01:00
Jeff MAURY 03df1e1d0c
fix: AMD Vulkan build is failing (#80)
Fixes #79

Signed-off-by: Jeff MAURY <jmaury@redhat.com>
2024-11-18 08:10:12 +00:00
renovate[bot] 20dc744c6e chore(deps): update registry.access.redhat.com/ubi9/python-311 docker tag to v1-77.1729776556 2024-11-06 19:01:58 +01:00
renovate[bot] 3fae2edd7a
chore(deps): update registry.access.redhat.com/ubi9/python-311 docker tag to v1-77.1729767833 (#72)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-10-29 21:51:36 +01:00
dependabot[bot] 765690a014
build(deps): Bump pip from 24.2 to 24.3.1 (#69)
Bumps [pip](https://github.com/pypa/pip) from 24.2 to 24.3.1.
- [Changelog](https://github.com/pypa/pip/blob/main/NEWS.rst)
- [Commits](https://github.com/pypa/pip/commits)

---
updated-dependencies:
- dependency-name: pip
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-28 13:56:34 +00:00
Jeff MAURY d86e3941a0
fix: ARM Vulkan build is failing (#71)
Fixes #70

Signed-off-by: Jeff MAURY <jmaury@redhat.com>
2024-10-28 13:32:50 +00:00
renovate[bot] 1278ddd373
chore(deps): update registry.access.redhat.com/ubi9/python-311 docker tag to v1-77.1726696860 (#66)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-10-17 09:39:28 +02:00
Jeff MAURY 8b24f9da20
fix: release workflow is broken since several images (#63)
Fixes #62

Signed-off-by: Jeff MAURY <jmaury@redhat.com>
2024-10-14 13:51:51 +02:00
Jeff MAURY a4abefab3b
fix: Vulkan ARM64 build broken (#65)
Fixes #64

Signed-off-by: Jeff MAURY <jmaury@redhat.com>
2024-10-14 08:10:17 +02:00
10 changed files with 1 additions and 473 deletions

View File

@ -1,87 +0,0 @@
---
#
# Copyright (C) 2024 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
name: Build and publish the playground image
on:
push:
branches:
- main
workflow_dispatch:
jobs:
build:
name: Build image
runs-on: ubuntu-24.04
strategy:
matrix:
include:
- containerfile: "./chat/base/Containerfile"
build-image-name: "ai-lab-playground-chat"
archs: amd64, arm64
- containerfile: "./chat/vulkan/amd64/Containerfile"
build-image-name: "ai-lab-playground-chat-vulkan"
archs: amd64
- containerfile: "./chat/vulkan/arm64/Containerfile"
build-image-name: "ai-lab-playground-chat-vulkan"
archs: arm64
- containerfile: "./chat/cuda/amd64/Containerfile"
build-image-name: "ai-lab-playground-chat-cuda"
archs: amd64
fail-fast: false
steps:
- uses: actions/checkout@v4
- name: Install qemu dependency
run: |
sudo apt-get update
sudo apt-get install -y qemu-user-static
- name: Build Playground Image
id: build-image
uses: redhat-actions/buildah-build@v2
with:
image: ${{ matrix.build-image-name }}
tags: nightly ${{ github.sha }}
containerfiles: |
${{ matrix.containerfile }}
context: ./chat
oci: true
archs: ${{ matrix.archs }}
- name: Echo Outputs
run: |
echo "Image: ${{ steps.build-image.outputs.image }}"
echo "Tags: ${{ steps.build-image.outputs.tags }}"
echo "Tagged Image: ${{ steps.build-image.outputs.image-with-tag }}"
- name: Login to ghcr.io
uses: redhat-actions/podman-login@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Push To ghcr.io
id: push-to-ghcr
uses: redhat-actions/push-to-registry@v2
with:
image: ${{ steps.build-image.outputs.image }}
tags: ${{ steps.build-image.outputs.tags }}
registry: ghcr.io/${{ github.repository_owner }}/podman-desktop-extension-ai-lab-playground-images

View File

@ -1,68 +0,0 @@
---
#
# Copyright (C) 2024 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
name: Build the playground image
on: [pull_request]
jobs:
build:
name: Build image
runs-on: ubuntu-24.04
strategy:
matrix:
include:
- containerfile: "./chat/base/Containerfile"
build-image-name: "ai-lab-playground-chat"
archs: amd64, arm64
- containerfile: "./chat/vulkan/amd64/Containerfile"
build-image-name: "ai-lab-playground-chat-vulkan"
archs: amd64
- containerfile: "./chat/vulkan/arm64/Containerfile"
build-image-name: "ai-lab-playground-chat-vulkan"
archs: arm64
- containerfile: "./chat/cuda/amd64/Containerfile"
build-image-name: "ai-lab-playground-chat-cuda"
archs: amd64
fail-fast: false
steps:
- uses: actions/checkout@v4
- name: Install qemu dependency
run: |
sudo apt-get update
sudo apt-get install -y qemu-user-static
- name: Build Playground Image
id: build-image
uses: redhat-actions/buildah-build@v2
with:
image: ${{ matrix.build-image-name }}
tags: ${{ github.sha }}
containerfiles: |
${{ matrix.containerfile }}
context: ./chat
oci: true
archs: ${{ matrix.archs }}
- name: Echo Outputs
run: |
echo "Image: ${{ steps.build-image.outputs.image }}"
echo "Tags: ${{ steps.build-image.outputs.tags }}"
echo "Tagged Image: ${{ steps.build-image.outputs.image-with-tag }}"

View File

@ -1,127 +0,0 @@
#
# Copyright (C) 2024 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
name: release
on:
workflow_dispatch:
inputs:
version:
description: 'Version to release'
required: true
branch:
description: 'Branch to use for the release'
required: true
default: main
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
jobs:
build_and_release:
name: Build and Release ${{ matrix.build-image-name }}
runs-on: ubuntu-24.04
strategy:
matrix:
include:
- containerfile: "./chat/base/Containerfile"
build-image-name: "ai-lab-playground-chat"
archs: amd64, arm64
- containerfile: "./chat/vulkan/amd64/Containerfile"
build-image-name: "ai-lab-playground-chat-vulkan"
archs: amd64
- containerfile: "./chat/vulkan/arm64/Containerfile"
build-image-name: "ai-lab-playground-chat-vulkan"
archs: arm64
- containerfile: "./chat/cuda/amd64/Containerfile"
build-image-name: "ai-lab-playground-chat-cuda"
archs: amd64
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.branch }}
- name: Generate tag utilities
id: TAG_UTIL
run: |
TAG_PATTERN=${{ github.event.inputs.version }}
echo "githubTag=v$TAG_PATTERN" >> ${GITHUB_OUTPUT}
echo "imageVersion=$TAG_PATTERN" >> ${GITHUB_OUTPUT}
echo "imageVersionShort=${TAG_PATTERN%.*}" >> ${GITHUB_OUTPUT}
- name: tag
run: |
git config --local user.name ${{ github.actor }}
echo "Tagging with ${{ steps.TAG_UTIL.outputs.githubTag }}"
git tag ${{ steps.TAG_UTIL.outputs.githubTag }}
git push origin ${{ steps.TAG_UTIL.outputs.githubTag }}
- name: Create Release
id: create_release
uses: ncipollo/release-action@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag: ${{ steps.TAG_UTIL.outputs.githubTag }}
name: ${{ steps.TAG_UTIL.outputs.githubTag }}
draft: true
prerelease: false
- name: Install qemu dependency
run: |
sudo apt-get update
sudo apt-get install -y qemu-user-static
- name: Build Playground Image
id: build-image
uses: redhat-actions/buildah-build@v2
with:
image: ${{ matrix.build-image-name }}
tags: latest ${{ steps.TAG_UTIL.outputs.imageVersion }} ${{ steps.TAG_UTIL.outputs.imageVersionShort }}
labels: io.podman.ai-lab.version=${{ steps.TAG_UTIL.outputs.imageVersion }}
containerfiles: |
${{ matrix.containerfile }}
context: ./chat
oci: true
archs: ${{ matrix.archs }}
- name: Login to ghcr.io
uses: redhat-actions/podman-login@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Push To ghcr.io
id: push-to-ghcr
uses: redhat-actions/push-to-registry@v2
with:
image: ${{ steps.build-image.outputs.image }}
tags: ${{ steps.build-image.outputs.tags }}
registry: ghcr.io/${{ github.repository_owner }}/podman-desktop-extension-ai-lab-playground-images
- name: id
run: echo the release id is ${{ steps.create_release.outputs.id}}
- name: Publish release
uses: StuYarrow/publish-release@v1.1.2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
id: ${{ steps.create_release.outputs.id}}

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
llama-cpp-python

View File

@ -1,28 +0,0 @@
#
# Copyright (C) 2024 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
FROM registry.access.redhat.com/ubi9-minimal:9.4-1227.1726694542
RUN microdnf install -y python3 python3-pip gcc g++ shadow-utils && microdnf clean all
RUN useradd -r -g root -m -d /home/default -s /bin/bash default
WORKDIR /home/default
COPY requirements.txt requirements.txt
RUN pip install --no-cache-dir --upgrade -r requirements.txt
USER default
COPY run.sh run.sh
EXPOSE 8000
ENTRYPOINT [ "sh", "run.sh" ]

View File

@ -1,27 +0,0 @@
#
# Copyright (C) 2024 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
FROM quay.io/opendatahub/workbench-images:cuda-ubi9-python-3.9-20231206
USER root
RUN dnf install -y gcc-toolset-13-gcc gcc-toolset-13-gcc-c++
USER 1001
WORKDIR /locallm
COPY requirements.txt .
COPY run.sh .
ENV CMAKE_ARGS="-DGGML_CUDA=on -DLLAMA_AVX2=OFF -DLLAMA_FMA=OFF -DLLAMA_F16C=OFF"
ENV FORCE_CMAKE=1
RUN CC="/opt/rh/gcc-toolset-13/root/usr/bin/gcc" CXX="/opt/rh/gcc-toolset-13/root/usr/bin/g++" pip install --no-cache-dir -r ./requirements.txt
ENTRYPOINT [ "sh", "run.sh" ]

View File

@ -1,2 +0,0 @@
llama-cpp-python[server]==0.3.1
pip==24.2

View File

@ -1,24 +0,0 @@
#!/bin/bash
#
# Copyright (C) 2024 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
if [ ${MODEL_PATH} ]; then
python -m llama_cpp.server --model ${MODEL_PATH} --host ${HOST:=0.0.0.0} --port ${PORT:=8001} --n_gpu_layers ${GPU_LAYERS:=0} --clip_model_path ${CLIP_MODEL_PATH:=None} --chat_format ${MODEL_CHAT_FORMAT:="llama-2"}
exit 0
fi
echo "This image should not be used outside of Podman Desktop AI Lab extension. Missing required MODEL_PATH environment variable."
exit 1

View File

@ -1,54 +0,0 @@
#
# Copyright (C) 2024 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
# Stage 1: Build dependencies
FROM registry.access.redhat.com/ubi9/python-311:1-77.1726664316 AS builder
USER 0
RUN dnf install -y python3-dnf-plugin-versionlock && \
dnf install -y mesa-vulkan-drivers-23.3.3-1.el9.x86_64 && \
dnf versionlock mesa-vulkan-drivers-23.3.3-1.el9.x86_64 && \
dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm && \
dnf install -y git cmake ninja-build gcc gcc-c++ && \
dnf copr enable -y ligenix/enterprise-sandbox epel-9-x86_64 && \
dnf install -y vulkan-headers vulkan-tools vulkan-loader-devel && \
dnf copr enable -y ligenix/enterprise-buildtools epel-9-x86_64 && \
dnf copr enable -y jeffmaury/shaderc epel-9-x86_64 && \
dnf install -y glslc && \
dnf clean all
WORKDIR /locallm
COPY requirements.txt ./
RUN pip install --upgrade pip
ENV CMAKE_ARGS="-DGGML_VULKAN=on"
ENV FORCE_CMAKE=1
RUN pip install --target=/locallm --no-cache-dir --upgrade -r requirements.txt
# Stage 2: Create final image with minimal content
FROM registry.access.redhat.com/ubi9/python-311:1-77.1726664316
COPY --from=builder /locallm/ /locallm
COPY --from=builder /usr/bin/vkcube* /usr/bin/
COPY --from=builder /usr/bin/vulkaninfo /usr/bin/vulkaninfo
COPY --from=builder /usr/lib/ /usr/lib/
COPY --from=builder /usr/lib64/ /usr/lib64/
COPY --from=builder /usr/share/vulkan /usr/share/vulkan
COPY --from=builder /usr/include/vulkan /usr/include/vulkan
COPY --from=builder /etc/ /etc/
USER 1001
WORKDIR /locallm
COPY requirements.txt ./
COPY run.sh ./
ENTRYPOINT [ "sh", "run.sh" ]

View File

@ -1,56 +0,0 @@
#
# Copyright (C) 2024 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
# Stage 1: Build dependencies
FROM registry.access.redhat.com/ubi9/python-311:1-77.1726664316 AS builder
USER 0
WORKDIR /locallm
RUN dnf install -y python3-dnf-plugin-versionlock && \
dnf install -y \
https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm && \
dnf copr enable -y slp/mesa-krunkit epel-9-aarch64 && \
dnf install -y mesa-vulkan-drivers-23.3.3-101.el9.aarch64 && \
dnf versionlock mesa-vulkan-drivers-23.3.3-101.el9.aarch64 && \
dnf install -y git cmake ninja-build gcc gcc-c++ vulkan-loader-devel vulkan-tools && \
dnf copr enable -y jeffmaury/shaderc epel-9-aarch64 && \
dnf install -y glslc && \
dnf clean all
COPY requirements.txt ./
RUN pip install --upgrade pip
ENV CMAKE_ARGS="-DGGML_VULKAN=on"
ENV FORCE_CMAKE=1
RUN pip install --target=/locallm --no-cache-dir --upgrade -r requirements.txt
# Stage 2: Create final image with minimal content
FROM registry.access.redhat.com/ubi9/python-311:1-77.1726664316
COPY --from=builder /locallm/ /locallm
COPY --from=builder /usr/bin/vkcube* /usr/bin/
COPY --from=builder /usr/bin/vulkaninfo /usr/bin/vulkaninfo
COPY --from=builder /usr/lib/ /usr/lib/
COPY --from=builder /usr/lib64/libdrm* /usr/lib64/
COPY --from=builder /usr/lib64/libvulkan* /usr/lib64/
COPY --from=builder /usr/lib64/libVkLayer* /usr/lib64/
COPY --from=builder /usr/lib64/libxshmfence* /usr/lib64/
COPY --from=builder /usr/lib64/libwayland* /usr/lib64/
COPY --from=builder /usr/lib64/llvm16 /usr/lib64/llvm16
COPY --from=builder /usr/share/vulkan /usr/share/vulkan
COPY --from=builder /usr/include/vulkan /usr/include/vulkan
COPY --from=builder /etc/ /etc/
USER 1001
WORKDIR /locallm
COPY run.sh ./
ENTRYPOINT [ "sh", "run.sh" ]