From 03ca8c7c161027d379b80ae109cb025c46d8cd0e Mon Sep 17 00:00:00 2001 From: Philippe Martin Date: Wed, 4 Jun 2025 15:45:54 +0200 Subject: [PATCH 1/3] v0.12.0 --- build/Containerfile | 7 +++++-- pyproject.toml | 2 +- src/podman_ai_lab_stack/run.yaml | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/build/Containerfile b/build/Containerfile index ed282ce..9323f84 100644 --- a/build/Containerfile +++ b/build/Containerfile @@ -1,7 +1,10 @@ FROM registry.access.redhat.com/ubi9/python-311:1-77.1726664316 -RUN pip install fastapi -RUN pip install --extra-index-url https://test.pypi.org/simple/ podman-ai-lab-stack==0.11.0 +WORKDIR /opt/app-root/src + +COPY dist dist + +RUN pip install ./dist/podman_ai_lab_stack-0.12.0.tar.gz RUN \ mkdir -p $HOME/.llama/providers.d/remote/inference && \ cp /opt/app-root/lib64/python3.11/site-packages/podman_ai_lab_stack/providers.d/remote/inference/podman-ai-lab.yaml \ diff --git a/pyproject.toml b/pyproject.toml index 9592b90..caea5aa 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "podman-ai-lab-stack" -version = "0.11.0" +version = "0.12.0" description = "Podman AI Lab provider for Llama Stack" requires-python = ">=3.10" dynamic = ["dependencies"] diff --git a/src/podman_ai_lab_stack/run.yaml b/src/podman_ai_lab_stack/run.yaml index 875cce9..9e6fbca 100644 --- a/src/podman_ai_lab_stack/run.yaml +++ b/src/podman_ai_lab_stack/run.yaml @@ -15,7 +15,7 @@ providers: - provider_id: podman-ai-lab provider_type: remote::podman-ai-lab config: - url: ${env.PODMAN_AI_LAB_URL:http://localhost:10434} + url: ${env.PODMAN_AI_LAB_URL:http://host.containers.internal:10434} vector_io: - provider_id: faiss provider_type: inline::faiss From 4637a0ded43d095e5458b1e8e60de068ed24b976 Mon Sep 17 00:00:00 2001 From: Philippe Martin Date: Wed, 4 Jun 2025 16:15:26 +0200 Subject: [PATCH 2/3] ci: build stack --- .github/workflows/build-stack.yaml | 64 ++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 .github/workflows/build-stack.yaml diff --git a/.github/workflows/build-stack.yaml b/.github/workflows/build-stack.yaml new file mode 100644 index 0000000..2820222 --- /dev/null +++ b/.github/workflows/build-stack.yaml @@ -0,0 +1,64 @@ +# +# Copyright (C) 2025 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-stack + +on: [pull_request] + +jobs: + publish: + name: publish + runs-on: ubuntu-24.04 + steps: + - uses: actions/checkout@v4 + + - name: Update podman + run: | + # ubuntu version from kubic repository to install podman we need (v5) + ubuntu_version='23.10' + sudo sh -c "echo 'deb https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/unstable/xUbuntu_${ubuntu_version}/ /' > /etc/apt/sources.list.d/devel:kubic:libcontainers:unstable.list" + curl -L "https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/unstable/xUbuntu_${ubuntu_version}/Release.key" | sudo apt-key add - + # install necessary dependencies for criu package which is not part of 23.10 + sudo apt-get install -qq libprotobuf32t64 python3-protobuf libnet1 + # install criu manually from static location + curl -sLO http://cz.archive.ubuntu.com/ubuntu/pool/universe/c/criu/criu_3.16.1-2_amd64.deb && sudo dpkg -i criu_3.16.1-2_amd64.deb + sudo apt-get update -qq + sudo apt-get -qq -y install podman || { echo "Start fallback steps for podman nightly installation from a static mirror" && \ + sudo sh -c "echo 'deb http://ftp.lysator.liu.se/pub/opensuse/repositories/devel:/kubic:/libcontainers:/unstable/xUbuntu_${ubuntu_version}/ /' > /etc/apt/sources.list.d/devel:kubic:libcontainers:unstable.list" && \ + curl -L "http://ftp.lysator.liu.se/pub/opensuse/repositories/devel:/kubic:/libcontainers:/unstable/xUbuntu_${ubuntu_version}/Release.key" | sudo apt-key add - && \ + sudo apt-get update && \ + sudo apt-get -y install podman; } + podman version + - name: Revert unprivileged user namespace restrictions in Ubuntu 24.04 + run: | + # allow unprivileged user namespace + sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0 + - name: Set cgroup_manager to 'cgroupfs' instead of systemd + run: | + mkdir -p ~/.config/containers + cat <> ~/.config/containers/containers.conf + [engine] + cgroup_manager="cgroupfs" + EOT + podman info + + - name: build package + run: | + pip install --upgrade build + python -m build + podman build . -f build/Containerfile -t imagename + From 735bce620a7c50bd712f1a97cefabfcd4ad32150 Mon Sep 17 00:00:00 2001 From: Philippe Martin Date: Wed, 4 Jun 2025 16:21:50 +0200 Subject: [PATCH 3/3] ci: publish image --- .github/workflows/build-stack.yaml | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-stack.yaml b/.github/workflows/build-stack.yaml index 2820222..bca1a7c 100644 --- a/.github/workflows/build-stack.yaml +++ b/.github/workflows/build-stack.yaml @@ -17,7 +17,10 @@ name: build-stack -on: [pull_request] +on: + push: + branches: + - 'main' jobs: publish: @@ -60,5 +63,17 @@ jobs: run: | pip install --upgrade build python -m build - podman build . -f build/Containerfile -t imagename + - name: Login to ghcr.io + run: podman login --username ${{ github.repository_owner }} --password ${{ secrets.GITHUB_TOKEN }} ghcr.io + + - name: Publish Image + id: publish-image + run: | + IMAGE_NAME=ghcr.io/${{ github.repository_owner }}/podman-ai-lab-stack + IMAGE_NIGHTLY=${IMAGE_NAME}:nightly + IMAGE_SHA=${IMAGE_NAME}:${GITHUB_SHA} + podman build . -f build/Containerfile -t $IMAGE_NIGHTLY + podman push $IMAGE_NIGHTLY + podman tag $IMAGE_NIGHTLY $IMAGE_SHA + podman push $IMAGE_SHA