Skip to content

Commit 560dabe

Browse files
committed
Merge remote-tracking branch 'upstream/master'
# Conflicts: # .devops/cuda.Dockerfile # .github/workflows/build.yml # .github/workflows/check-vendor.yml # .github/workflows/docker.yml # .github/workflows/editorconfig.yml # .github/workflows/pre-tokenizer-hashes.yml # .github/workflows/python-check-requirements.yml # .github/workflows/server-webui.yml # .github/workflows/update-ops-docs.yml # .github/workflows/winget.yml
2 parents 7effc02 + 90e0f5c commit 560dabe

1,945 files changed

Lines changed: 258321 additions & 139410 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.devops/cann.Dockerfile

Lines changed: 35 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,28 @@
55
# Define the CANN base image for easier version updates later
66
ARG CHIP_TYPE=910b
77
ARG CANN_BASE_IMAGE=quay.io/ascend/cann:8.5.0-${CHIP_TYPE}-openeuler24.03-py3.11
8+
ARG BUILD_DATE=N/A
9+
ARG APP_VERSION=N/A
10+
ARG APP_REVISION=N/A
811

912
# ==============================================================================
1013
# BUILD STAGE
1114
# Compile all binary files and libraries
1215
# ==============================================================================
16+
ARG NODE_VERSION=24
17+
18+
FROM docker.io/node:$NODE_VERSION AS web
19+
20+
ARG APP_VERSION
21+
22+
WORKDIR /app/tools/ui
23+
24+
COPY tools/ui/package.json tools/ui/package-lock.json ./
25+
RUN npm ci
26+
27+
COPY tools/ui/ ./
28+
RUN LLAMA_BUILD_NUMBER="$APP_VERSION" npm run build
29+
1330
FROM ${CANN_BASE_IMAGE} AS build
1431

1532
# -- Install build dependencies --
@@ -23,6 +40,8 @@ WORKDIR /app
2340
# -- Copy project files --
2441
COPY . .
2542

43+
COPY --from=web /app/tools/ui/dist tools/ui/dist
44+
2645
# -- Set CANN environment variables (required for compilation) --
2746
# Using ENV instead of `source` allows environment variables to persist across the entire image layer
2847
ENV ASCEND_TOOLKIT_HOME=/usr/local/Ascend/ascend-toolkit/latest
@@ -55,6 +74,7 @@ RUN mkdir -p /app/lib && \
5574
RUN mkdir -p /app/full && \
5675
cp build/bin/* /app/full/ && \
5776
cp *.py /app/full/ && \
77+
cp -r conversion /app/full/ && \
5878
cp -r gguf-py /app/full/ && \
5979
cp -r requirements /app/full/ && \
6080
cp requirements.txt /app/full/
@@ -67,6 +87,19 @@ RUN mkdir -p /app/full && \
6787
# ==============================================================================
6888
FROM ${CANN_BASE_IMAGE} AS base
6989

90+
ARG BUILD_DATE=N/A
91+
ARG APP_VERSION=N/A
92+
ARG APP_REVISION=N/A
93+
ARG IMAGE_URL=https://github.com/ggml-org/llama.cpp
94+
ARG IMAGE_SOURCE=https://github.com/ggml-org/llama.cpp
95+
LABEL org.opencontainers.image.created=$BUILD_DATE \
96+
org.opencontainers.image.version=$APP_VERSION \
97+
org.opencontainers.image.revision=$APP_REVISION \
98+
org.opencontainers.image.title="llama.cpp" \
99+
org.opencontainers.image.description="LLM inference in C/C++" \
100+
org.opencontainers.image.url=$IMAGE_URL \
101+
org.opencontainers.image.source=$IMAGE_SOURCE
102+
70103
# -- Install runtime dependencies --
71104
RUN yum install -y libgomp curl && \
72105
yum clean all && \
@@ -112,7 +145,7 @@ ENTRYPOINT ["/app/tools.sh"]
112145
# ==============================================================================
113146
FROM base AS light
114147

115-
COPY --from=build /app/full/llama-cli /app/full/llama-completion /app
148+
COPY --from=build /app/full/llama /app/full/llama-cli /app/full/llama-completion /app
116149

117150
ENTRYPOINT [ "/app/llama-cli" ]
118151

@@ -123,7 +156,7 @@ FROM base AS server
123156

124157
ENV LLAMA_ARG_HOST=0.0.0.0
125158

126-
COPY --from=build /app/full/llama-server /app
159+
COPY --from=build /app/full/llama /app/full/llama-server /app
127160

128161
HEALTHCHECK --interval=5m CMD [ "curl", "-f", "http://localhost:8080/health" ]
129162

.devops/cpu.Dockerfile

Lines changed: 38 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,23 @@
11
ARG UBUNTU_VERSION=24.04
2+
ARG BUILD_DATE=N/A
3+
ARG APP_VERSION=N/A
4+
ARG APP_REVISION=N/A
25

3-
FROM ubuntu:$UBUNTU_VERSION AS build
6+
ARG NODE_VERSION=24
7+
8+
FROM docker.io/node:$NODE_VERSION AS web
9+
10+
ARG APP_VERSION
11+
12+
WORKDIR /app/tools/ui
13+
14+
COPY tools/ui/package.json tools/ui/package-lock.json ./
15+
RUN npm ci
16+
17+
COPY tools/ui/ ./
18+
RUN LLAMA_BUILD_NUMBER="$APP_VERSION" npm run build
19+
20+
FROM docker.io/ubuntu:$UBUNTU_VERSION AS build
421

522
ARG TARGETARCH
623

@@ -13,6 +30,8 @@ WORKDIR /app
1330

1431
COPY . .
1532

33+
COPY --from=web /app/tools/ui/dist tools/ui/dist
34+
1635
RUN if [ "$TARGETARCH" = "amd64" ] || [ "$TARGETARCH" = "arm64" ]; then \
1736
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DGGML_NATIVE=OFF -DLLAMA_BUILD_TESTS=OFF -DGGML_BACKEND_DL=ON -DGGML_CPU_ALL_VARIANTS=ON; \
1837
else \
@@ -27,16 +46,30 @@ RUN mkdir -p /app/lib && \
2746
RUN mkdir -p /app/full \
2847
&& cp build/bin/* /app/full \
2948
&& cp *.py /app/full \
49+
&& cp -r conversion /app/full \
3050
&& cp -r gguf-py /app/full \
3151
&& cp -r requirements /app/full \
3252
&& cp requirements.txt /app/full \
3353
&& cp .devops/tools.sh /app/full/tools.sh
3454

3555
## Base image
36-
FROM ubuntu:$UBUNTU_VERSION AS base
56+
FROM docker.io/ubuntu:$UBUNTU_VERSION AS base
57+
58+
ARG BUILD_DATE=N/A
59+
ARG APP_VERSION=N/A
60+
ARG APP_REVISION=N/A
61+
ARG IMAGE_URL=https://github.com/ggml-org/llama.cpp
62+
ARG IMAGE_SOURCE=https://github.com/ggml-org/llama.cpp
63+
LABEL org.opencontainers.image.created=$BUILD_DATE \
64+
org.opencontainers.image.version=$APP_VERSION \
65+
org.opencontainers.image.revision=$APP_REVISION \
66+
org.opencontainers.image.title="llama.cpp" \
67+
org.opencontainers.image.description="LLM inference in C/C++" \
68+
org.opencontainers.image.url=$IMAGE_URL \
69+
org.opencontainers.image.source=$IMAGE_SOURCE
3770

3871
RUN apt-get update \
39-
&& apt-get install -y libgomp1 curl \
72+
&& apt-get install -y libgomp1 curl ffmpeg \
4073
&& apt autoremove -y \
4174
&& apt clean -y \
4275
&& rm -rf /tmp/* /var/tmp/* \
@@ -71,7 +104,7 @@ ENTRYPOINT ["/app/tools.sh"]
71104
### Light, CLI only
72105
FROM base AS light
73106

74-
COPY --from=build /app/full/llama-cli /app/full/llama-completion /app
107+
COPY --from=build /app/full/llama /app/full/llama-cli /app/full/llama-completion /app
75108

76109
WORKDIR /app
77110

@@ -82,7 +115,7 @@ FROM base AS server
82115

83116
ENV LLAMA_ARG_HOST=0.0.0.0
84117

85-
COPY --from=build /app/full/llama-server /app
118+
COPY --from=build /app/full/llama /app/full/llama-server /app
86119

87120
WORKDIR /app
88121

.devops/cuda.Dockerfile

Lines changed: 42 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,48 @@
11
ARG UBUNTU_VERSION=24.04
22
# This needs to generally match the container host's environment.
33
ARG CUDA_VERSION=12.8.1
4+
ARG GCC_VERSION=14
45
# Target the CUDA build image
5-
ARG BASE_CUDA_DEV_CONTAINER=nvidia/cuda:${CUDA_VERSION}-devel-ubuntu${UBUNTU_VERSION}
6+
ARG BASE_CUDA_DEV_CONTAINER=docker.io/nvidia/cuda:${CUDA_VERSION}-devel-ubuntu${UBUNTU_VERSION}
67

7-
ARG BASE_CUDA_RUN_CONTAINER=nvidia/cuda:${CUDA_VERSION}-runtime-ubuntu${UBUNTU_VERSION}
8+
ARG BASE_CUDA_RUN_CONTAINER=docker.io/nvidia/cuda:${CUDA_VERSION}-runtime-ubuntu${UBUNTU_VERSION}
9+
10+
ARG BUILD_DATE=N/A
11+
ARG APP_VERSION=N/A
12+
ARG APP_REVISION=N/A
13+
14+
ARG NODE_VERSION=24
15+
16+
FROM docker.io/node:$NODE_VERSION AS web
17+
18+
ARG APP_VERSION
19+
20+
WORKDIR /app/tools/ui
21+
22+
COPY tools/ui/package.json tools/ui/package-lock.json ./
23+
RUN npm ci
24+
25+
COPY tools/ui/ ./
26+
RUN LLAMA_BUILD_NUMBER="$APP_VERSION" npm run build
827

928
FROM ${BASE_CUDA_DEV_CONTAINER} AS build
1029

30+
ARG GCC_VERSION
1131
# CUDA architecture to build for (defaults to all supported archs)
1232
ARG CUDA_DOCKER_ARCH=default
1333

1434
RUN apt-get update && \
1535
apt-get install -y build-essential cmake python3 python3-pip git libssl-dev libgomp1
1636

37+
# ARM64: default gcc/g++ statt gcc-14, da gcc-14 auf Ubuntu 22.04 (cuda12-Basis) nicht in den Standard-Repos liegt
1738
ENV CC=gcc CXX=g++ CUDAHOSTCXX=g++
1839

1940
WORKDIR /app
2041

2142
COPY . .
2243

44+
COPY --from=web /app/tools/ui/dist tools/ui/dist
45+
2346
RUN if [ "${CUDA_DOCKER_ARCH}" != "default" ]; then \
2447
export CMAKE_ARGS="-DCMAKE_CUDA_ARCHITECTURES=${CUDA_DOCKER_ARCH}"; \
2548
fi && \
@@ -32,6 +55,7 @@ RUN mkdir -p /app/lib && \
3255
RUN mkdir -p /app/full \
3356
&& cp build/bin/* /app/full \
3457
&& cp *.py /app/full \
58+
&& cp -r conversion /app/full \
3559
&& cp -r gguf-py /app/full \
3660
&& cp -r requirements /app/full \
3761
&& cp requirements.txt /app/full \
@@ -40,8 +64,21 @@ RUN mkdir -p /app/full \
4064
## Base image
4165
FROM ${BASE_CUDA_RUN_CONTAINER} AS base
4266

67+
ARG BUILD_DATE=N/A
68+
ARG APP_VERSION=N/A
69+
ARG APP_REVISION=N/A
70+
ARG IMAGE_URL=https://github.com/ggml-org/llama.cpp
71+
ARG IMAGE_SOURCE=https://github.com/ggml-org/llama.cpp
72+
LABEL org.opencontainers.image.created=$BUILD_DATE \
73+
org.opencontainers.image.version=$APP_VERSION \
74+
org.opencontainers.image.revision=$APP_REVISION \
75+
org.opencontainers.image.title="llama.cpp" \
76+
org.opencontainers.image.description="LLM inference in C/C++" \
77+
org.opencontainers.image.url=$IMAGE_URL \
78+
org.opencontainers.image.source=$IMAGE_SOURCE
79+
4380
RUN apt-get update \
44-
&& apt-get install -y libgomp1 curl \
81+
&& apt-get install -y libgomp1 curl ffmpeg \
4582
&& apt autoremove -y \
4683
&& apt clean -y \
4784
&& rm -rf /tmp/* /var/tmp/* \
@@ -77,7 +114,7 @@ ENTRYPOINT ["/app/tools.sh"]
77114
### Light, CLI only
78115
FROM base AS light
79116

80-
COPY --from=build /app/full/llama-cli /app/full/llama-completion /app
117+
COPY --from=build /app/full/llama /app/full/llama-cli /app/full/llama-completion /app
81118

82119
WORKDIR /app
83120

@@ -88,7 +125,7 @@ FROM base AS server
88125

89126
ENV LLAMA_ARG_HOST=0.0.0.0
90127

91-
COPY --from=build /app/full/llama-server /app
128+
COPY --from=build /app/full/llama /app/full/llama-server /app
92129

93130
WORKDIR /app
94131

0 commit comments

Comments
 (0)