Skip to content
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
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,8 @@ jobs:
- name: Run tests with race detection
run: go test -race ./...

- name: validate
run: make validate

- name: model-distribution # TODO: Create a single Makefile for the monorepo
run: make -C ./pkg/distribution/ all
10 changes: 3 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,10 @@ ARG LLAMA_SERVER_VARIANT
# Create non-root user
RUN groupadd --system modelrunner && useradd --system --gid modelrunner --create-home --home-dir /home/modelrunner modelrunner

COPY scripts/apt-install.sh apt-install.sh

# Install ca-certificates for HTTPS and vulkan
RUN apt-get update && \
packages="ca-certificates" && \
if [ "${LLAMA_SERVER_VARIANT}" = "generic" ] || [ "${LLAMA_SERVER_VARIANT}" = "cpu" ]; then \
packages="$packages libvulkan1"; \
fi && \
apt-get install -y --no-install-recommends $packages && \
rm -rf /var/lib/apt/lists/*
RUN ./apt-install.sh

WORKDIR /app

Expand Down
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ MODELS_PATH := $(shell pwd)/models-store
LLAMA_ARGS ?=

# Main targets
.PHONY: build run clean test docker-build docker-run help
.PHONY: build run clean test docker-build docker-run help validate

# Default target
.DEFAULT_GOAL := help
Expand All @@ -34,6 +34,9 @@ clean:
test:
go test -v ./...

validate:
find . -type f -name "*.sh" | xargs shellcheck

# Build Docker image
docker-build:
docker buildx build \
Expand Down
17 changes: 17 additions & 0 deletions scripts/apt-install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash

main() {
set -eux -o pipefail

apt-get update
local packages=("ca-certificates")
if [ "${LLAMA_SERVER_VARIANT}" = "generic" ] || [ "${LLAMA_SERVER_VARIANT}" = "cpu" ]; then
packages+=("libvulkan1")
fi

apt-get install -y --no-install-recommends "${packages[@]}"
rm -rf /var/lib/apt/lists/*
}

main "$@"

Loading