Skip to content

Commit b0e96be

Browse files
authored
Merge pull request #1 from feloy/chore/ci-1
ci: build stack
2 parents 424adee + 735bce6 commit b0e96be

File tree

4 files changed

+86
-4
lines changed

4 files changed

+86
-4
lines changed

.github/workflows/build-stack.yaml

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
#
2+
# Copyright (C) 2025 Red Hat, Inc.
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#
16+
# SPDX-License-Identifier: Apache-2.0
17+
18+
name: build-stack
19+
20+
on:
21+
push:
22+
branches:
23+
- 'main'
24+
25+
jobs:
26+
publish:
27+
name: publish
28+
runs-on: ubuntu-24.04
29+
steps:
30+
- uses: actions/checkout@v4
31+
32+
- name: Update podman
33+
run: |
34+
# ubuntu version from kubic repository to install podman we need (v5)
35+
ubuntu_version='23.10'
36+
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"
37+
curl -L "https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/unstable/xUbuntu_${ubuntu_version}/Release.key" | sudo apt-key add -
38+
# install necessary dependencies for criu package which is not part of 23.10
39+
sudo apt-get install -qq libprotobuf32t64 python3-protobuf libnet1
40+
# install criu manually from static location
41+
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
42+
sudo apt-get update -qq
43+
sudo apt-get -qq -y install podman || { echo "Start fallback steps for podman nightly installation from a static mirror" && \
44+
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" && \
45+
curl -L "http://ftp.lysator.liu.se/pub/opensuse/repositories/devel:/kubic:/libcontainers:/unstable/xUbuntu_${ubuntu_version}/Release.key" | sudo apt-key add - && \
46+
sudo apt-get update && \
47+
sudo apt-get -y install podman; }
48+
podman version
49+
- name: Revert unprivileged user namespace restrictions in Ubuntu 24.04
50+
run: |
51+
# allow unprivileged user namespace
52+
sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0
53+
- name: Set cgroup_manager to 'cgroupfs' instead of systemd
54+
run: |
55+
mkdir -p ~/.config/containers
56+
cat <<EOT >> ~/.config/containers/containers.conf
57+
[engine]
58+
cgroup_manager="cgroupfs"
59+
EOT
60+
podman info
61+
62+
- name: build package
63+
run: |
64+
pip install --upgrade build
65+
python -m build
66+
67+
- name: Login to ghcr.io
68+
run: podman login --username ${{ github.repository_owner }} --password ${{ secrets.GITHUB_TOKEN }} ghcr.io
69+
70+
- name: Publish Image
71+
id: publish-image
72+
run: |
73+
IMAGE_NAME=ghcr.io/${{ github.repository_owner }}/podman-ai-lab-stack
74+
IMAGE_NIGHTLY=${IMAGE_NAME}:nightly
75+
IMAGE_SHA=${IMAGE_NAME}:${GITHUB_SHA}
76+
podman build . -f build/Containerfile -t $IMAGE_NIGHTLY
77+
podman push $IMAGE_NIGHTLY
78+
podman tag $IMAGE_NIGHTLY $IMAGE_SHA
79+
podman push $IMAGE_SHA

build/Containerfile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
FROM registry.access.redhat.com/ubi9/python-311:1-77.1726664316
22

3-
RUN pip install fastapi
4-
RUN pip install --extra-index-url https://test.pypi.org/simple/ podman-ai-lab-stack==0.11.0
3+
WORKDIR /opt/app-root/src
4+
5+
COPY dist dist
6+
7+
RUN pip install ./dist/podman_ai_lab_stack-0.12.0.tar.gz
58
RUN \
69
mkdir -p $HOME/.llama/providers.d/remote/inference && \
710
cp /opt/app-root/lib64/python3.11/site-packages/podman_ai_lab_stack/providers.d/remote/inference/podman-ai-lab.yaml \

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "podman-ai-lab-stack"
7-
version = "0.11.0"
7+
version = "0.12.0"
88
description = "Podman AI Lab provider for Llama Stack"
99
requires-python = ">=3.10"
1010
dynamic = ["dependencies"]

src/podman_ai_lab_stack/run.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ providers:
1515
- provider_id: podman-ai-lab
1616
provider_type: remote::podman-ai-lab
1717
config:
18-
url: ${env.PODMAN_AI_LAB_URL:http://localhost:10434}
18+
url: ${env.PODMAN_AI_LAB_URL:http://host.containers.internal:10434}
1919
vector_io:
2020
- provider_id: faiss
2121
provider_type: inline::faiss

0 commit comments

Comments
 (0)