Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: fix podman test #435

Merged
merged 8 commits into from
Nov 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions .github/workflows/release-base.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,17 +47,17 @@ jobs:
- name: Set runtime variables for matrix
run: |
if [ ${{ matrix.runtime }} == "base" ]; then
export PLATFORMS="linux/amd64,linux/arm64"
export FILE="Dockerfile.base"
export TAG="ghcr.io/sozercan/base:latest"
export CACHE_FROM="type=gha,scope=base"
export CACHE_TO="type=gha,scope=base,mode=max"
echo PLATFORMS="linux/amd64,linux/arm64" >> $GITHUB_ENV
echo FILE="Dockerfile.base" >> $GITHUB_ENV
echo TAG="ghcr.io/sozercan/base:latest" >> $GITHUB_ENV
echo CACHE_FROM="type=gha,scope=base" >> $GITHUB_ENV
echo CACHE_TO="type=gha,scope=base,mode=max" >> $GITHUB_ENV
elif [ ${{ matrix.runtime }} == "applesilicon" ]; then
export PLATFORMS="linux/arm64"
export FILE="Dockerfile.base-applesilicon"
export TAG="ghcr.io/sozercan/applesilicon/base:latest"
export CACHE_FROM="type=gha,scope=base-applesilicon"
export CACHE_TO="type=gha,scope=base-applesilicon,mode=max"
echo PLATFORMS="linux/arm64" >> $GITHUB_ENV
echo FILE="Dockerfile.base-applesilicon" >> $GITHUB_ENV
echo TAG="ghcr.io/sozercan/applesilicon/base:latest" >> $GITHUB_ENV
echo CACHE_FROM="type=gha,scope=base-applesilicon" >> $GITHUB_ENV
echo CACHE_TO="type=gha,scope=base-applesilicon,mode=max" >> $GITHUB_ENV
fi

- name: Build and push
Expand Down
24 changes: 16 additions & 8 deletions .github/workflows/test-podman-applesilicon.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,25 +18,30 @@ jobs:

# use default docker driver builder with containerd image store for local aikit image
# these must be setup before running this test
- run: docker buildx use default
- run: docker buildx use desktop-linux

- name: build aikit
run: |
docker buildx build . -t aikit:test \
--load --provenance=false --progress plain

- name: build test model
- name: build and push test model
run: |
docker buildx build . -t testmodel:test \
docker buildx build . -t sozercan/testmodel:test \
-f test/aikitfile-llama.yaml \
--load --provenance=false --progress plain \
--build-arg="runtime=applesilicon"
--provenance=false --progress plain \
--build-arg="runtime=applesilicon" \
--push

- name: list images
run: docker images

- name: run test model
run: podman run --name testmodel -d --rm --device /dev/dri -p 8080:8080 --pull always testmodel:test
run: |
podman run --name testmodel -d --rm -p 8080:8080 \
--device /dev/dri \
--pull always \
sozercan/testmodel:test

- name: run test (gguf)
run: |
Expand All @@ -58,8 +63,11 @@ jobs:
- run: podman stop testmodel
if: always()

- run: podman system prune -a -f --volumes || true
if: always()
# - name: prune
# run: |
# docker system prune -a -f --volumes || true
# podman system prune -a -f --volumes || true
# if: always()

- name: publish test artifacts
if: always()
Expand Down
7 changes: 4 additions & 3 deletions Dockerfile.base-applesilicon
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
ARG MESA_VERSION=23.3.5-102

FROM fedora:39@sha256:d63d63fe593749a5e8dbc8152427d40bbe0ece53d884e00e5f3b44859efa5077

ARG MESA_VERSION="23.3.5-102"

USER 0

# Install the patched mesa-krunkit drivers
RUN dnf -y install dnf-plugins-core && \
dnf -y copr enable slp/mesa-krunkit && \
dnf -y install \
mesa-vulkan-drivers-${MESA_VERSION} \
mesa-vulkan-drivers-$MESA_VERSION \
vulkan-loader-devel vulkan-tools vulkan-loader && \
dnf clean all
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ If it doesn't include a specific model, you can always [create your own images](

> [!NOTE]
> AIKit supports both AMD64 and ARM64 CPUs. You can run the same command on either architecture, and Docker will automatically pull the correct image for your CPU.
>
> Depending on your CPU capabilities, AIKit will automatically select the most optimized instruction set.

| Model | Optimization | Parameters | Command | Model Name | License |
Expand All @@ -100,6 +101,7 @@ If it doesn't include a specific model, you can always [create your own images](

> [!NOTE]
> To enable GPU acceleration, please see [GPU Acceleration](https://sozercan.github.io/aikit/docs/gpu).
>
> Please note that only difference between CPU and GPU section is the `--gpus all` flag in the command to enable GPU acceleration.

| Model | Optimization | Parameters | Command | Model Name | License |
Expand All @@ -118,7 +120,9 @@ If it doesn't include a specific model, you can always [create your own images](

> [!NOTE]
> To enable GPU acceleration on Apple Silicon, please see [Podman Desktop documentation](https://podman-desktop.io/docs/podman/gpu).
>
> Apple Silicon is an _experimental_ runtime and it may change in the future. This runtime is specific to Apple Silicon only, and it will not work as expected on other architectures, including Intel Macs.
>
> Only `gguf` models are supported on Apple Silicon.

| Model | Optimization | Parameters | Command | Model Name | License |
Expand Down
Loading