This commit is contained in:
Sébastien Han 2025-06-20 10:17:23 +02:00
parent b6ebbe1bc0
commit 2a8b3e05f1
No known key found for this signature in database
3 changed files with 235 additions and 169 deletions

View file

@ -42,11 +42,11 @@ jobs:
build:
needs: generate-matrix
runs-on: ubuntu-latest
strategy:
matrix:
template: ${{ fromJson(needs.generate-matrix.outputs.templates) }}
image-type: [venv, container]
fail-fast: false # We want to run all jobs even if some fail
# strategy:
# matrix:
# template: ${{ fromJson(needs.generate-matrix.outputs.templates) }}
# image-type: [venv, container]
# fail-fast: false # We want to run all jobs even if some fail
steps:
- name: Checkout repository
@ -57,44 +57,53 @@ jobs:
with:
install-ollama: false
- name: Print dependencies in the image
if: matrix.image-type == 'venv'
# - name: Print dependencies in the image
# if: matrix.image-type == 'venv'
# run: |
# uv pip list
# - name: Run Llama Stack Build - VENV
# if: matrix.image-type == 'venv'
# run: |
# uv sync --no-default-groups --extra ${{ matrix.template }}
- name: Run Llama Stack Build - VENV - meta-reference-gpu-distro
# if: matrix.image-type == 'venv'
run: |
uv pip list
uv sync --no-default-groups --extra meta-reference-gpu-distro
- name: Run Llama Stack Build - VENV
if: matrix.image-type == 'venv'
run: |
uv sync --no-default-groups --extra ${{ matrix.template }}
- name: Setup tmate session
if: ${{ failure() }}
uses: mxschmitt/action-tmate@v3
# TODO
- name: Run Llama Stack Build - CONTAINER
if: matrix.image-type == 'container'
run: |
# TODO: use llama_stack/templates/Containerfile when we have a new release!
cat << 'EOF' > Containerfile
FROM registry.access.redhat.com/ubi9
WORKDIR /app
ARG TEMPLATE
# # TODO
# - name: Run Llama Stack Build - CONTAINER
# if: matrix.image-type == 'container'
# run: |
# # TODO: use llama_stack/templates/Containerfile when we have a new release!
# cat << 'EOF' > Containerfile
# FROM registry.access.redhat.com/ubi9
# WORKDIR /app
# ARG TEMPLATE
RUN dnf -y update \
&& dnf install -y python3.11 python3.11-pip python3.11-wheel python3.11-setuptools python3.11-devel gcc make \
&& ln -s /bin/pip3.11 /bin/pip \
&& ln -s /bin/python3.11 /bin/python \
&& dnf clean all
# RUN dnf -y update \
# && dnf install -y python3.11 python3.11-pip python3.11-wheel python3.11-setuptools python3.11-devel gcc make \
# && ln -s /bin/pip3.11 /bin/pip \
# && ln -s /bin/python3.11 /bin/python \
# && dnf clean all
RUN mkdir -p /.llama/providers.d /.cache
COPY . /app/llama-stack
RUN cd llama-stack && pip install --no-cache .[${TEMPLATE}]
RUN chmod -R g+rw /app /.llama /.cache
ENTRYPOINT ["python", "-m", "llama_stack.distribution.server.server", "--config", "/app/llama-stack/templates/${TEMPLATE}/run.yaml"]
EOF
docker build --build-arg TEMPLATE=${{ matrix.template }} -f Containerfile -t ${{ matrix.template }} .
# RUN mkdir -p /.llama/providers.d /.cache
# COPY . /app/llama-stack
# RUN cd llama-stack && pip install --no-cache .[${TEMPLATE}]
# RUN chmod -R g+rw /app /.llama /.cache
# ENTRYPOINT ["python", "-m", "llama_stack.distribution.server.server", "--config", "/app/llama-stack/templates/${TEMPLATE}/run.yaml"]
# EOF
# docker build --build-arg TEMPLATE=${{ matrix.template }} -f Containerfile -t ${{ matrix.template }} .
- name: Print dependencies in the image
if: matrix.image-type == 'venv'
run: |
uv pip list
# - name: Print dependencies in the image
# if: matrix.image-type == 'venv'
# run: |
# uv pip list
build-single-provider:
runs-on: ubuntu-latest