Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
16 changes: 16 additions & 0 deletions .devops/cann.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,20 @@ ARG APP_REVISION=N/A
# BUILD STAGE
# Compile all binary files and libraries
# ==============================================================================
ARG NODE_VERSION=24

FROM docker.io/node:$NODE_VERSION AS web

ARG BUILD_NUMBER

WORKDIR /app/tools/ui

COPY tools/ui/package.json tools/ui/package-lock.json ./
RUN npm ci

COPY tools/ui/ ./
RUN LLAMA_BUILD_NUMBER="$BUILD_NUMBER" npm run build

FROM ${CANN_BASE_IMAGE} AS build

# -- Install build dependencies --
Expand All @@ -26,6 +40,8 @@ WORKDIR /app
# -- Copy project files --
COPY . .

COPY --from=web /app/tools/ui/dist tools/ui/dist

# -- Set CANN environment variables (required for compilation) --
# Using ENV instead of `source` allows environment variables to persist across the entire image layer
ENV ASCEND_TOOLKIT_HOME=/usr/local/Ascend/ascend-toolkit/latest
Expand Down
16 changes: 16 additions & 0 deletions .devops/cpu.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,20 @@ ARG BUILD_DATE=N/A
ARG APP_VERSION=N/A
ARG APP_REVISION=N/A

ARG NODE_VERSION=24

FROM docker.io/node:$NODE_VERSION AS web

ARG BUILD_NUMBER

WORKDIR /app/tools/ui

COPY tools/ui/package.json tools/ui/package-lock.json ./
RUN npm ci

COPY tools/ui/ ./
RUN LLAMA_BUILD_NUMBER="$BUILD_NUMBER" npm run build

FROM docker.io/ubuntu:$UBUNTU_VERSION AS build

ARG TARGETARCH
Expand All @@ -16,6 +30,8 @@ WORKDIR /app

COPY . .

COPY --from=web /app/tools/ui/dist tools/ui/dist

RUN if [ "$TARGETARCH" = "amd64" ] || [ "$TARGETARCH" = "arm64" ]; then \
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DGGML_NATIVE=OFF -DLLAMA_BUILD_TESTS=OFF -DGGML_BACKEND_DL=ON -DGGML_CPU_ALL_VARIANTS=ON; \
else \
Expand Down
16 changes: 16 additions & 0 deletions .devops/cuda.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,20 @@ ARG BUILD_DATE=N/A
ARG APP_VERSION=N/A
ARG APP_REVISION=N/A

ARG NODE_VERSION=24

FROM docker.io/node:$NODE_VERSION AS web

ARG BUILD_NUMBER

WORKDIR /app/tools/ui

COPY tools/ui/package.json tools/ui/package-lock.json ./
RUN npm ci

COPY tools/ui/ ./
RUN LLAMA_BUILD_NUMBER="$BUILD_NUMBER" npm run build

FROM ${BASE_CUDA_DEV_CONTAINER} AS build

ARG GCC_VERSION
Expand All @@ -26,6 +40,8 @@ WORKDIR /app

COPY . .

COPY --from=web /app/tools/ui/dist tools/ui/dist

RUN if [ "${CUDA_DOCKER_ARCH}" != "default" ]; then \
export CMAKE_ARGS="-DCMAKE_CUDA_ARCHITECTURES=${CUDA_DOCKER_ARCH}"; \
fi && \
Expand Down
16 changes: 16 additions & 0 deletions .devops/intel.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,20 @@ ARG APP_REVISION=N/A

## Build Image

ARG NODE_VERSION=24

FROM docker.io/node:$NODE_VERSION AS web

ARG BUILD_NUMBER

WORKDIR /app/tools/ui

COPY tools/ui/package.json tools/ui/package-lock.json ./
RUN npm ci

COPY tools/ui/ ./
RUN LLAMA_BUILD_NUMBER="$BUILD_NUMBER" npm run build

FROM docker.io/intel/deep-learning-essentials:$ONEAPI_VERSION AS build

ARG GGML_SYCL_F16=ON
Expand All @@ -22,6 +36,8 @@ WORKDIR /app

COPY . .

COPY --from=web /app/tools/ui/dist tools/ui/dist

RUN if [ "${GGML_SYCL_F16}" = "ON" ]; then \
echo "GGML_SYCL_F16 is set" \
&& export OPT_SYCL_F16="-DGGML_SYCL_F16=ON" \
Expand Down
16 changes: 16 additions & 0 deletions .devops/musa.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,20 @@ ARG BUILD_DATE=N/A
ARG APP_VERSION=N/A
ARG APP_REVISION=N/A

ARG NODE_VERSION=24

FROM docker.io/node:$NODE_VERSION AS web

ARG BUILD_NUMBER

WORKDIR /app/tools/ui

COPY tools/ui/package.json tools/ui/package-lock.json ./
RUN npm ci

COPY tools/ui/ ./
RUN LLAMA_BUILD_NUMBER="$BUILD_NUMBER" npm run build

FROM ${BASE_MUSA_DEV_CONTAINER} AS build

# MUSA architecture to build for (defaults to all supported archs)
Expand All @@ -29,6 +43,8 @@ WORKDIR /app

COPY . .

COPY --from=web /app/tools/ui/dist tools/ui/dist

RUN if [ "${MUSA_DOCKER_ARCH}" != "default" ]; then \
export CMAKE_ARGS="-DMUSA_ARCHITECTURES=${MUSA_DOCKER_ARCH}"; \
fi && \
Expand Down
16 changes: 16 additions & 0 deletions .devops/openvino.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,20 @@ ARG BUILD_DATE=N/A
ARG APP_VERSION=N/A
ARG APP_REVISION=N/A

ARG NODE_VERSION=24

FROM docker.io/node:$NODE_VERSION AS web

ARG BUILD_NUMBER

WORKDIR /app/tools/ui

COPY tools/ui/package.json tools/ui/package-lock.json ./
RUN npm ci

COPY tools/ui/ ./
RUN LLAMA_BUILD_NUMBER="$BUILD_NUMBER" npm run build

## Build Image
FROM docker.io/ubuntu:${UBUNTU_VERSION} AS build

Expand Down Expand Up @@ -69,6 +83,8 @@ WORKDIR /app

COPY . .

COPY --from=web /app/tools/ui/dist tools/ui/dist

# Build Stage
RUN bash -c "source ${OpenVINO_DIR}/setupvars.sh && \
cmake -B build/ReleaseOV -G Ninja \
Expand Down
16 changes: 16 additions & 0 deletions .devops/rocm.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,20 @@ ARG BUILD_DATE=N/A
ARG APP_VERSION=N/A
ARG APP_REVISION=N/A

ARG NODE_VERSION=24

FROM docker.io/node:$NODE_VERSION AS web

ARG BUILD_NUMBER

WORKDIR /app/tools/ui

COPY tools/ui/package.json tools/ui/package-lock.json ./
RUN npm ci

COPY tools/ui/ ./
RUN LLAMA_BUILD_NUMBER="$BUILD_NUMBER" npm run build

### Build image
FROM ${BASE_ROCM_DEV_CONTAINER} AS build

Expand Down Expand Up @@ -38,6 +52,8 @@ WORKDIR /app

COPY . .

COPY --from=web /app/tools/ui/dist tools/ui/dist

RUN HIPCXX="$(hipconfig -l)/clang" HIP_PATH="$(hipconfig -R)" \
cmake -S . -B build \
-DGGML_HIP=ON \
Expand Down
16 changes: 16 additions & 0 deletions .devops/s390x.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,20 @@ ARG BUILD_DATE=N/A
ARG APP_VERSION=N/A
ARG APP_REVISION=N/A

ARG NODE_VERSION=24

FROM docker.io/node:$NODE_VERSION AS web

ARG BUILD_NUMBER

WORKDIR /app/tools/ui

COPY tools/ui/package.json tools/ui/package-lock.json ./
RUN npm ci

COPY tools/ui/ ./
RUN LLAMA_BUILD_NUMBER="$BUILD_NUMBER" npm run build

### Build Llama.cpp stage
FROM docker.io/gcc:${GCC_VERSION} AS build

Expand All @@ -20,6 +34,8 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
WORKDIR /app
COPY . .

COPY --from=web /app/tools/ui/dist tools/ui/dist

RUN --mount=type=cache,target=/root/.ccache \
--mount=type=cache,target=/app/build \
cmake -S . -B build -G Ninja \
Expand Down
16 changes: 16 additions & 0 deletions .devops/vulkan.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,20 @@ ARG BUILD_DATE=N/A
ARG APP_VERSION=N/A
ARG APP_REVISION=N/A

ARG NODE_VERSION=24

FROM docker.io/node:$NODE_VERSION AS web

ARG BUILD_NUMBER

WORKDIR /app/tools/ui

COPY tools/ui/package.json tools/ui/package-lock.json ./
RUN npm ci

COPY tools/ui/ ./
RUN LLAMA_BUILD_NUMBER="$BUILD_NUMBER" npm run build

FROM docker.io/ubuntu:$UBUNTU_VERSION AS build

# Install build tools
Expand All @@ -17,6 +31,8 @@ WORKDIR /app

COPY . .

COPY --from=web /app/tools/ui/dist tools/ui/dist

RUN cmake -B build -DGGML_NATIVE=OFF -DGGML_VULKAN=ON -DLLAMA_BUILD_TESTS=OFF -DGGML_BACKEND_DL=ON -DGGML_CPU_ALL_VARIANTS=ON && \
cmake --build build --config Release -j$(nproc)

Expand Down
16 changes: 16 additions & 0 deletions .devops/zendnn.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,20 @@ ARG BUILD_DATE=N/A
ARG APP_VERSION=N/A
ARG APP_REVISION=N/A

ARG NODE_VERSION=24

FROM docker.io/node:$NODE_VERSION AS web

ARG BUILD_NUMBER

WORKDIR /app/tools/ui

COPY tools/ui/package.json tools/ui/package-lock.json ./
RUN npm ci

COPY tools/ui/ ./
RUN LLAMA_BUILD_NUMBER="$BUILD_NUMBER" npm run build

FROM docker.io/ubuntu:$UBUNTU_VERSION AS build

RUN apt-get update && \
Expand All @@ -14,6 +28,8 @@ WORKDIR /app

COPY . .

COPY --from=web /app/tools/ui/dist tools/ui/dist

RUN cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DGGML_NATIVE=OFF -DLLAMA_BUILD_TESTS=OFF -DGGML_BACKEND_DL=ON -DGGML_CPU_ALL_VARIANTS=ON -DGGML_ZENDNN=ON && \
cmake --build build -j $(nproc)

Expand Down
3 changes: 3 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@

build*/

tools/ui/node_modules/
tools/ui/dist/

models/*

/llama-cli
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,10 @@ jobs:
id: build_date
run: echo "date=$(date -u +"%Y-%m-%dT%H:%M:%SZ")" >> $GITHUB_OUTPUT

- name: Get build number
id: build_number
run: echo "value=b$(git rev-list --count HEAD)" >> "$GITHUB_OUTPUT"
Comment thread
aldehir marked this conversation as resolved.
Outdated

- name: Free Disk Space (Ubuntu)
if: ${{ matrix.config.free_disk_space == true }}
uses: ggml-org/free-disk-space@v1.3.1
Expand Down Expand Up @@ -234,6 +238,7 @@ jobs:
provenance: false
build-args: |
BUILD_DATE=${{ steps.build_date.outputs.date }}
BUILD_NUMBER=${{ steps.build_number.outputs.value }}
APP_VERSION=${{ needs.create_tag.outputs.source_tag }}
APP_REVISION=${{ steps.checkout.outputs.commit }}
IMAGE_URL=${{ github.server_url }}/${{ github.repository }}
Expand Down Expand Up @@ -271,6 +276,7 @@ jobs:
provenance: false
build-args: |
BUILD_DATE=${{ steps.build_date.outputs.date }}
BUILD_NUMBER=${{ steps.build_number.outputs.value }}
APP_VERSION=${{ needs.create_tag.outputs.source_tag }}
APP_REVISION=${{ steps.checkout.outputs.commit }}
IMAGE_URL=${{ github.server_url }}/${{ github.repository }}
Expand Down Expand Up @@ -308,6 +314,7 @@ jobs:
provenance: false
build-args: |
BUILD_DATE=${{ steps.build_date.outputs.date }}
BUILD_NUMBER=${{ steps.build_number.outputs.value }}
APP_VERSION=${{ needs.create_tag.outputs.source_tag }}
APP_REVISION=${{ steps.checkout.outputs.commit }}
IMAGE_URL=${{ github.server_url }}/${{ github.repository }}
Expand Down