File tree Expand file tree Collapse file tree 4 files changed +27
-8
lines changed
Expand file tree Collapse file tree 4 files changed +27
-8
lines changed Original file line number Diff line number Diff line change 2525 - name : Run tests with race detection
2626 run : go test -race ./...
2727
28+ - name : validate
29+ run : make validate
30+
2831 - name : model-distribution # TODO: Create a single Makefile for the monorepo
2932 run : make -C ./pkg/distribution/ all
Original file line number Diff line number Diff line change @@ -40,14 +40,10 @@ ARG LLAMA_SERVER_VARIANT
4040# Create non-root user
4141RUN groupadd --system modelrunner && useradd --system --gid modelrunner --create-home --home-dir /home/modelrunner modelrunner
4242
43+ COPY scripts/apt-install.sh apt-install.sh
44+
4345# Install ca-certificates for HTTPS and vulkan
44- RUN apt-get update && \
45- packages="ca-certificates" && \
46- if [ "${LLAMA_SERVER_VARIANT}" = "generic" ] || [ "${LLAMA_SERVER_VARIANT}" = "cpu" ]; then \
47- packages="$packages libvulkan1" ; \
48- fi && \
49- apt-get install -y --no-install-recommends $packages && \
50- rm -rf /var/lib/apt/lists/*
46+ RUN ./apt-install.sh
5147
5248WORKDIR /app
5349
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ MODELS_PATH := $(shell pwd)/models-store
1010LLAMA_ARGS ?=
1111
1212# Main targets
13- .PHONY : build run clean test docker-build docker-run help
13+ .PHONY : build run clean test docker-build docker-run help validate
1414
1515# Default target
1616.DEFAULT_GOAL := help
3434test :
3535 go test -v ./...
3636
37+ validate :
38+ find . -type f -name " *.sh" | xargs shellcheck
39+
3740# Build Docker image
3841docker-build :
3942 docker buildx build \
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ main () {
4+ set -eux -o pipefail
5+
6+ apt-get update
7+ local packages=(" ca-certificates" )
8+ if [ " ${LLAMA_SERVER_VARIANT} " = " generic" ] || [ " ${LLAMA_SERVER_VARIANT} " = " cpu" ]; then
9+ packages+=(" libvulkan1" )
10+ fi
11+
12+ apt-get install -y --no-install-recommends " ${packages[@]} "
13+ rm -rf /var/lib/apt/lists/*
14+ }
15+
16+ main " $@ "
17+
You can’t perform that action at this time.
0 commit comments