Skip to content

chore(deps): Bump golang from 1479eb3 to ef30001 (#454) #1101

chore(deps): Bump golang from 1479eb3 to ef30001 (#454)

chore(deps): Bump golang from 1479eb3 to ef30001 (#454) #1101

Workflow file for this run

name: docker-test
on:
push:
branches:
- main
paths-ignore:
- '**.md'
- 'website/**'
pull_request:
branches:
- main
paths-ignore:
- '**.md'
- 'website/**'
permissions: read-all
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
test:
runs-on: ubuntu-latest
timeout-minutes: 240
strategy:
fail-fast: false
matrix:
backend:
- llama
- stablediffusion
arch:
- amd64
- arm64
exclude:
- backend: stablediffusion
arch: arm64
steps:
- uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # v1.3.1
with:
tool-cache: true
android: true
dotnet: true
haskell: true
large-packages: true
docker-images: true
swap-storage: true
- name: Harden Runner
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
with:
egress-policy: block
allowed-endpoints: >
auth.docker.io:443
huggingface.co:443
*.huggingface.co:443
*.hf.co:443
cdn.dl.k8s.io:443
dl.k8s.io:443
download.docker.com:443
gcr.io:443
github.com:443
*.githubusercontent.com:443
production.cloudflare.docker.com:443
proxy.golang.org:443
registry-1.docker.io:443
storage.googleapis.com:443
*.blob.core.windows.net:443
*.azureedge.net:443
developer.download.nvidia.com:443
dl-cdn.alpinelinux.org:443
*.ubuntu.com:80
ghcr.io:443
sum.golang.org:443
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
# need containerd image store for testing local images
- uses: crazy-max/ghaction-setup-docker@635d07c09dc2b52072362e9bb37e7e789767106d # v3.5.0
with:
daemon-config: |
{
"debug": true,
"features": {
"containerd-snapshotter": true
}
}
- uses: crazy-max/ghaction-github-runtime@b3a9207c0e1ef41f4cf215303c976869d0c2c1c4 # v3.0.0
- uses: docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf # v3.2.0
if: ${{ matrix.arch == 'arm64' }}
- name: build aikit
run: |
docker buildx build . -t aikit:test \
--load --provenance=false --progress plain \
--cache-from=type=gha,scope=aikit-${{ matrix.arch }} \
--cache-to=type=gha,scope=aikit-${{ matrix.arch }},mode=max \
--platform linux/${{ matrix.arch }}
- name: build test model
run: |
docker buildx build . -t testmodel:test \
-f test/aikitfile-${{ matrix.backend }}.yaml \
--load --provenance=false --progress plain \
--cache-from=type=gha,scope=testmodel-${{ matrix.arch }} \
--cache-to=type=gha,scope=testmodel-${{ matrix.arch }},mode=max \
--platform linux/${{ matrix.arch }}
- name: list images
run: docker images
- name: run test model
run: docker run --name testmodel -d -p 8080:8080 --platform "linux/${{ matrix.arch }}" testmodel:test
- name: run llama test
if: matrix.backend == 'llama'
run: |
result=$(curl --fail --retry 10 --retry-all-errors http://127.0.0.1:8080/v1/chat/completions -H "Content-Type: application/json" -d '{
"model": "llama-3.2-1b-instruct",
"messages": [{"role": "user", "content": "explain kubernetes in a sentence"}]
}')
echo $result
choices=$(echo "$result" | jq '.choices')
if [ -z "$choices" ]; then
exit 1
fi
- name: run stablediffusion test
if: matrix.backend == 'stablediffusion'
run: |
result=$(curl --fail --retry 10 --retry-all-errors http://127.0.0.1:8080/v1/images/generations -H "Content-Type: application/json" -d '{
"prompt": "A cute baby llama",
"size": "256x256"
}')
echo $result
url=$(echo "$result" | jq '.data[0].url')
if [ -z "$url" ]; then
exit 1
fi
- name: save logs
if: always()
run: docker logs testmodel > /tmp/docker-${{ matrix.backend }}.log
- name: save generated image
if: matrix.backend == 'stablediffusion'
run: docker cp testmodel:/tmp/generated/images /tmp
- name: publish test artifacts
if: always()
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
with:
name: test-${{ matrix.arch }}-${{ matrix.backend }}
path: |
/tmp/*.log
/tmp/images/*.png
test-protocol:
runs-on: ubuntu-latest
timeout-minutes: 240
strategy:
fail-fast: false
matrix:
protocol:
- oci
- hf
steps:
- uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # v1.3.1
with:
tool-cache: true
android: true
dotnet: true
haskell: true
large-packages: true
docker-images: true
swap-storage: true
- name: Harden Runner
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
with:
egress-policy: block
allowed-endpoints: >
auth.docker.io:443
huggingface.co:443
*.huggingface.co:443
*.hf.co:443
cdn.dl.k8s.io:443
dl.k8s.io:443
download.docker.com:443
gcr.io:443
github.com:443
*.githubusercontent.com:443
production.cloudflare.docker.com:443
proxy.golang.org:443
registry-1.docker.io:443
storage.googleapis.com:443
*.blob.core.windows.net:443
*.azureedge.net:443
*.ubuntu.com:80
developer.download.nvidia.com:443
dl-cdn.alpinelinux.org:443
registry.ollama.ai:443
*.cloudflarestorage.com:443
ghcr.io:443
sum.golang.org:443
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
# need containerd image store for testing local images
- uses: crazy-max/ghaction-setup-docker@635d07c09dc2b52072362e9bb37e7e789767106d # v3.5.0
with:
daemon-config: |
{
"debug": true,
"features": {
"containerd-snapshotter": true
}
}
- uses: crazy-max/ghaction-github-runtime@b3a9207c0e1ef41f4cf215303c976869d0c2c1c4 # v3.0.0
- name: build aikit
run: |
docker buildx build . -t aikit:test \
--load --provenance=false --progress plain \
--cache-from=type=gha,scope=aikit-amd64 \
--cache-to=type=gha,scope=aikit-amd64,mode=max
- name: build test model
run: |
docker buildx build . -t testmodel:test \
-f test/aikitfile-${{ matrix.protocol }}.yaml \
--load --provenance=false --progress plain \
--cache-from=type=gha,scope=testmodel-${{ matrix.protocol }} \
--cache-to=type=gha,scope=testmodel-${{ matrix.protocol }},mode=max
- name: list images
run: docker images
- name: run test model
run: docker run --name testmodel -d -p 8080:8080 testmodel:test
- name: run llama test
run: |
result=$(curl --fail --retry 10 --retry-all-errors http://127.0.0.1:8080/v1/chat/completions -H "Content-Type: application/json" -d '{
"model": "llama-3.2-1b-instruct",
"messages": [{"role": "user", "content": "explain kubernetes in a sentence"}]
}')
echo $result
choices=$(echo "$result" | jq '.choices')
if [ -z "$choices" ]; then
exit 1
fi
- name: save logs
if: always()
run: docker logs testmodel > /tmp/docker-${{ matrix.protocol }}.log
- name: publish test artifacts
if: always()
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
with:
name: test-${{ matrix.protocol }}
path: |
/tmp/*.log