Skip to content

update changelog

update changelog #33

Workflow file for this run

name: CD
on:
push:
tags:
- "*"
workflow_dispatch:
inputs:
source_ref:
description: "Existing branch, tag, or commit SHA to build from"
required: true
default: "main"
type: string
image_tag:
description: "Docker tag to publish. Defaults to source_ref (sanitized for Docker tag rules)"
required: false
default: ""
type: string
env:
DOCKERHUB_USERNAME: timothyswt
jobs:
meta:
name: Release Metadata
runs-on: ubuntu-latest
outputs:
checkout_ref: ${{ steps.meta.outputs.checkout_ref }}
version: ${{ steps.meta.outputs.version }}
docker_repo: ${{ steps.meta.outputs.docker_repo }}
llama_cpu_image: ${{ steps.meta.outputs.llama_cpu_image }}
llama_version: ${{ steps.meta.outputs.llama_version }}
llama_cuda_image: ${{ steps.meta.outputs.llama_cuda_image }}
steps:
- name: Checkout code
uses: actions/checkout@v6
with:
ref: ${{ github.event_name == 'workflow_dispatch' && inputs.source_ref || github.ref }}
- id: meta
run: |
sanitize_tag() {
local raw="$1"
raw="${raw#refs/heads/}"
raw="${raw#refs/tags/}"
raw="${raw#refs/}"
raw="${raw//\//-}"
raw="$(printf '%s' "$raw" | tr -c '[:alnum:]._-' '-')"
raw="${raw#-}"
raw="${raw%-}"
if [ -z "$raw" ]; then
raw="latest"
fi
printf '%s' "$raw"
}
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
CHECKOUT_REF="${{ inputs.source_ref }}"
if [ -n "${{ inputs.image_tag }}" ]; then
VERSION_INPUT="${{ inputs.image_tag }}"
else
VERSION_INPUT="${{ inputs.source_ref }}"
fi
else
CHECKOUT_REF="${GITHUB_REF}"
VERSION_INPUT="${GITHUB_REF_NAME}"
fi
VERSION_TAG="$(sanitize_tag "$VERSION_INPUT")"
LLAMA_VERSION="$(sed -n 's/^LLAMA_VERSION ?= //p' Makefile | head -n1)"
if [ -z "$LLAMA_VERSION" ]; then
echo "Failed to determine LLAMA_VERSION from Makefile" >&2
exit 1
fi
echo "checkout_ref=${CHECKOUT_REF}" >> "$GITHUB_OUTPUT"
echo "version=${VERSION_TAG}" >> "$GITHUB_OUTPUT"
echo "docker_repo=${DOCKERHUB_USERNAME}" >> "$GITHUB_OUTPUT"
echo "llama_cpu_image=${DOCKERHUB_USERNAME}/llama-cpu-libs:${LLAMA_VERSION}" >> "$GITHUB_OUTPUT"
echo "llama_version=${LLAMA_VERSION}" >> "$GITHUB_OUTPUT"
echo "llama_cuda_image=${DOCKERHUB_USERNAME}/llama-cuda-libs:${LLAMA_VERSION}" >> "$GITHUB_OUTPUT"
build-general-images:
name: Build and Push ${{ matrix.image_name }}
runs-on: ubuntu-latest
needs: meta
strategy:
fail-fast: false
matrix:
include:
- image_name: nornicdb-arm64-metal
dockerfile: docker/Dockerfile.arm64-metal
image_repo: nornicdb-arm64-metal
platforms: linux/arm64
build_args: ""
- image_name: nornicdb-arm64-metal-bge
dockerfile: docker/Dockerfile.arm64-metal
image_repo: nornicdb-arm64-metal-bge
platforms: linux/arm64
build_args: |
EMBED_MODEL=true
- image_name: nornicdb-arm64-metal-bge-heimdall
dockerfile: docker/Dockerfile.arm64-metal-heimdall
image_repo: nornicdb-arm64-metal-bge-heimdall
platforms: linux/arm64
build_args: ""
- image_name: nornicdb-arm64-metal-headless
dockerfile: docker/Dockerfile.arm64-metal
image_repo: nornicdb-arm64-metal-headless
platforms: linux/arm64
build_args: |
HEADLESS=true
- image_name: nornicdb-amd64-cpu
dockerfile: docker/Dockerfile.amd64-cpu
image_repo: nornicdb-amd64-cpu
platforms: linux/amd64
build_args: ""
- image_name: nornicdb-amd64-cpu-headless
dockerfile: docker/Dockerfile.amd64-cpu
image_repo: nornicdb-amd64-cpu-headless
platforms: linux/amd64
build_args: |
HEADLESS=true
- image_name: nornicdb-cpu-bge
dockerfile: docker/Dockerfile.cpu-bge
image_repo: nornicdb-cpu-bge
platforms: linux/amd64,linux/arm64
build_args: ""
- image_name: nornicdb-cpu-bge-headless
dockerfile: docker/Dockerfile.cpu-bge
image_repo: nornicdb-cpu-bge-headless
platforms: linux/amd64,linux/arm64
build_args: |
HEADLESS=true
- image_name: nornicdb-amd64-vulkan
dockerfile: docker/Dockerfile.amd64-vulkan
image_repo: nornicdb-amd64-vulkan
platforms: linux/amd64
build_args: ""
- image_name: nornicdb-amd64-vulkan-bge
dockerfile: docker/Dockerfile.amd64-vulkan
image_repo: nornicdb-amd64-vulkan-bge
platforms: linux/amd64
build_args: |
EMBED_MODEL=true
- image_name: nornicdb-amd64-vulkan-headless
dockerfile: docker/Dockerfile.amd64-vulkan
image_repo: nornicdb-amd64-vulkan-headless
platforms: linux/amd64
build_args: |
HEADLESS=true
steps:
- name: Checkout code
uses: actions/checkout@v6
with:
ref: ${{ needs.meta.outputs.checkout_ref }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
- name: Log in to Docker Hub
uses: docker/login-action@v4
with:
username: ${{ env.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKER_PAT }}
- name: Build and push image
uses: docker/build-push-action@v7
with:
context: .
file: ${{ matrix.dockerfile }}
platforms: ${{ matrix.platforms }}
push: true
provenance: false
tags: ${{ needs.meta.outputs.docker_repo }}/${{ matrix.image_repo }}:${{ needs.meta.outputs.version }}
build-args: |
LLAMA_CPU_IMAGE=${{ needs.meta.outputs.llama_cpu_image }}
${{ matrix.build_args }}
cache-from: type=gha
cache-to: type=gha,mode=max
build-cuda-images:
name: Build and Push ${{ matrix.image_name }}
runs-on: ubuntu-latest
needs:
- meta
strategy:
fail-fast: false
matrix:
include:
- image_name: nornicdb-amd64-cuda
dockerfile: docker/Dockerfile.amd64-cuda
image_repo: nornicdb-amd64-cuda
build_args: ""
- image_name: nornicdb-amd64-cuda-bge
dockerfile: docker/Dockerfile.amd64-cuda
image_repo: nornicdb-amd64-cuda-bge
build_args: |
EMBED_MODEL=true
- image_name: nornicdb-amd64-cuda-bge-heimdall
dockerfile: docker/Dockerfile.amd64-cuda-heimdall
image_repo: nornicdb-amd64-cuda-bge-heimdall
build_args: ""
- image_name: nornicdb-amd64-cuda-headless
dockerfile: docker/Dockerfile.amd64-cuda
image_repo: nornicdb-amd64-cuda-headless
build_args: |
HEADLESS=true
steps:
- name: Checkout code
uses: actions/checkout@v6
with:
ref: ${{ needs.meta.outputs.checkout_ref }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
- name: Log in to Docker Hub
uses: docker/login-action@v4
with:
username: ${{ env.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKER_PAT }}
- name: Build and push CUDA image
uses: docker/build-push-action@v7
with:
context: .
file: ${{ matrix.dockerfile }}
platforms: linux/amd64
push: true
provenance: false
tags: ${{ needs.meta.outputs.docker_repo }}/${{ matrix.image_repo }}:${{ needs.meta.outputs.version }}
build-args: |
LLAMA_CUDA_IMAGE=${{ needs.meta.outputs.llama_cuda_image }}
${{ matrix.build_args }}
cache-from: type=gha
cache-to: type=gha,mode=max