Skip to content

docker-test-finetune #67

docker-test-finetune

docker-test-finetune #67

Workflow file for this run

name: docker-test-finetune
on:
workflow_dispatch:
permissions: read-all
jobs:
test:
runs-on: self-hosted
timeout-minutes: 360
strategy:
fail-fast: false
max-parallel: 1
matrix:
targets:
- unsloth
steps:
- name: cleanup workspace
run: |
rm -rf ./* || true
rm -rf ./.??* || true
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
- run: nvidia-smi
# use default docker driver builder with containerd image store for local aikit image
# must have insecure security entitlement for finetuning
# these must be setup before running this test
- run: docker buildx use default
- name: build aikit
run: |
docker --debug build . -t aikit:test \
--load --provenance=false --progress plain
- name: build finetuned model
run: |
docker --debug build --allow security.insecure \
--file test/aikitfile-${{ matrix.targets }}.yaml --output _output \
--target ${{ matrix.targets }} --progress plain .
- name: check if finetuned model exists
run: |
ls -al _output
test -f _output/model-q4_k_m.gguf
- name: build custom model
run: |
docker --debug build _output --tag custommodel:test \
--file test/aikitfile-${{ matrix.targets }}-custom.yaml \
--load --provenance=false --progress plain
- name: list images
run: docker images
- name: run test model
run: docker run --name custommodel -d --rm -p 8080:8080 --gpus all custommodel:test
- name: run 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": "custom",
"messages": [{"role": "user", "content": "Compose a haiku about cats"}]
}')
echo $result
choices=$(echo "$result" | jq '.choices')
if [ -z "$choices" ]; then
exit 1
fi
- name: save logs
if: always()
run: docker logs custommodel > /tmp/docker.log
- run: docker stop custommodel
if: always()
- run: docker system prune -a -f --volumes || true
if: always()
- name: clean up output
if: always()
run: rm -rf _output
- name: publish test artifacts
if: always()
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
with:
name: test
path: |
/tmp/*.log