Skip to content

Commit eeef0f0

Browse files
committed
Merge branch 'master' into croco_nex_0 b4385
1 parent 361bc5c commit eeef0f0

File tree

18 files changed

+1213
-68
lines changed

18 files changed

+1213
-68
lines changed

.devops/cpu.Dockerfile

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
ARG UBUNTU_VERSION=22.04
2+
3+
FROM ubuntu:$UBUNTU_VERSION AS build
4+
5+
RUN apt-get update && \
6+
apt-get install -y build-essential git cmake libcurl4-openssl-dev
7+
8+
WORKDIR /app
9+
10+
COPY . .
11+
12+
RUN cmake -S . -B build -DGGML_BACKEND_DL=ON -DGGML_NATIVE=OFF -DGGML_CPU_ALL_VARIANTS=ON -DLLAMA_CURL=ON -DCMAKE_BUILD_TYPE=Release && \
13+
cmake --build build -j $(nproc)
14+
15+
RUN mkdir -p /app/lib && \
16+
find build -name "*.so" -exec cp {} /app/lib \;
17+
18+
RUN mkdir -p /app/full \
19+
&& cp build/bin/* /app/full \
20+
&& cp *.py /app/full \
21+
&& cp -r gguf-py /app/full \
22+
&& cp -r requirements /app/full \
23+
&& cp requirements.txt /app/full \
24+
&& cp .devops/tools.sh /app/full/tools.sh
25+
26+
## Base image
27+
FROM ubuntu:$UBUNTU_VERSION AS base
28+
29+
RUN apt-get update \
30+
&& apt-get install -y libgomp1 curl\
31+
&& apt autoremove -y \
32+
&& apt clean -y \
33+
&& rm -rf /tmp/* /var/tmp/* \
34+
&& find /var/cache/apt/archives /var/lib/apt/lists -not -name lock -type f -delete \
35+
&& find /var/cache -type f -delete
36+
37+
COPY --from=build /app/lib/ /app
38+
39+
### Full
40+
FROM base AS full
41+
42+
COPY --from=build /app/full /app
43+
44+
WORKDIR /app
45+
46+
RUN apt-get update \
47+
&& apt-get install -y \
48+
git \
49+
python3 \
50+
python3-pip \
51+
&& pip install --upgrade pip setuptools wheel \
52+
&& pip install -r requirements.txt \
53+
&& apt autoremove -y \
54+
&& apt clean -y \
55+
&& rm -rf /tmp/* /var/tmp/* \
56+
&& find /var/cache/apt/archives /var/lib/apt/lists -not -name lock -type f -delete \
57+
&& find /var/cache -type f -delete
58+
59+
ENTRYPOINT ["/app/tools.sh"]
60+
61+
### Light, CLI only
62+
FROM base AS light
63+
64+
COPY --from=build /app/full/llama-cli /app
65+
66+
WORKDIR /app
67+
68+
ENTRYPOINT [ "/app/llama-cli" ]
69+
70+
### Server, Server only
71+
FROM base AS server
72+
73+
ENV LLAMA_ARG_HOST=0.0.0.0
74+
75+
COPY --from=build /app/full/llama-server /app
76+
77+
WORKDIR /app
78+
79+
HEALTHCHECK CMD [ "curl", "-f", "http://localhost:8080/health" ]
80+
81+
ENTRYPOINT [ "/app/llama-server" ]

.devops/cuda.Dockerfile

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
ARG UBUNTU_VERSION=22.04
2+
# This needs to generally match the container host's environment.
3+
ARG CUDA_VERSION=12.6.0
4+
# Target the CUDA build image
5+
ARG BASE_CUDA_DEV_CONTAINER=nvidia/cuda:${CUDA_VERSION}-devel-ubuntu${UBUNTU_VERSION}
6+
7+
ARG BASE_CUDA_RUN_CONTAINER=nvidia/cuda:${CUDA_VERSION}-runtime-ubuntu${UBUNTU_VERSION}
8+
9+
FROM ${BASE_CUDA_DEV_CONTAINER} AS build
10+
11+
# CUDA architecture to build for (defaults to all supported archs)
12+
ARG CUDA_DOCKER_ARCH=default
13+
14+
RUN apt-get update && \
15+
apt-get install -y build-essential cmake python3 python3-pip git libcurl4-openssl-dev libgomp1
16+
17+
WORKDIR /app
18+
19+
COPY . .
20+
21+
RUN if [ "${CUDA_DOCKER_ARCH}" != "default" ]; then \
22+
export CMAKE_ARGS="-DCMAKE_CUDA_ARCHITECTURES=${CUDA_DOCKER_ARCH}"; \
23+
fi && \
24+
cmake -B build -DGGML_NATIVE=OFF -DGGML_CUDA=ON -DLLAMA_CURL=ON ${CMAKE_ARGS} -DCMAKE_EXE_LINKER_FLAGS=-Wl,--allow-shlib-undefined . && \
25+
cmake --build build --config Release -j$(nproc)
26+
27+
RUN mkdir -p /app/lib && \
28+
find build -name "*.so" -exec cp {} /app/lib \;
29+
30+
RUN mkdir -p /app/full \
31+
&& cp build/bin/* /app/full \
32+
&& cp *.py /app/full \
33+
&& cp -r gguf-py /app/full \
34+
&& cp -r requirements /app/full \
35+
&& cp requirements.txt /app/full \
36+
&& cp .devops/tools.sh /app/full/tools.sh
37+
38+
## Base image
39+
FROM ${BASE_CUDA_RUN_CONTAINER} AS base
40+
41+
RUN apt-get update \
42+
&& apt-get install -y libgomp1 curl\
43+
&& apt autoremove -y \
44+
&& apt clean -y \
45+
&& rm -rf /tmp/* /var/tmp/* \
46+
&& find /var/cache/apt/archives /var/lib/apt/lists -not -name lock -type f -delete \
47+
&& find /var/cache -type f -delete
48+
49+
COPY --from=build /app/lib/ /app
50+
51+
### Full
52+
FROM base AS full
53+
54+
COPY --from=build /app/full /app
55+
56+
WORKDIR /app
57+
58+
RUN apt-get update \
59+
&& apt-get install -y \
60+
git \
61+
python3 \
62+
python3-pip \
63+
&& pip install --upgrade pip setuptools wheel \
64+
&& pip install -r requirements.txt \
65+
&& apt autoremove -y \
66+
&& apt clean -y \
67+
&& rm -rf /tmp/* /var/tmp/* \
68+
&& find /var/cache/apt/archives /var/lib/apt/lists -not -name lock -type f -delete \
69+
&& find /var/cache -type f -delete
70+
71+
72+
ENTRYPOINT ["/app/tools.sh"]
73+
74+
### Light, CLI only
75+
FROM base AS light
76+
77+
COPY --from=build /app/full/llama-cli /app
78+
79+
WORKDIR /app
80+
81+
ENTRYPOINT [ "/app/llama-cli" ]
82+
83+
### Server, Server only
84+
FROM base AS server
85+
86+
ENV LLAMA_ARG_HOST=0.0.0.0
87+
88+
COPY --from=build /app/full/llama-server /app
89+
90+
WORKDIR /app
91+
92+
HEALTHCHECK CMD [ "curl", "-f", "http://localhost:8080/health" ]
93+
94+
ENTRYPOINT [ "/app/llama-server" ]

.devops/intel.Dockerfile

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
ARG ONEAPI_VERSION=2025.0.0-0-devel-ubuntu22.04
2+
3+
## Build Image
4+
5+
FROM intel/oneapi-basekit:$ONEAPI_VERSION AS build
6+
7+
ARG GGML_SYCL_F16=OFF
8+
RUN apt-get update && \
9+
apt-get install -y git libcurl4-openssl-dev
10+
11+
WORKDIR /app
12+
13+
COPY . .
14+
15+
RUN if [ "${GGML_SYCL_F16}" = "ON" ]; then \
16+
echo "GGML_SYCL_F16 is set" \
17+
&& export OPT_SYCL_F16="-DGGML_SYCL_F16=ON"; \
18+
fi && \
19+
echo "Building with dynamic libs" && \
20+
cmake -B build -DGGML_NATIVE=OFF -DGGML_SYCL=ON -DCMAKE_C_COMPILER=icx -DCMAKE_CXX_COMPILER=icpx -DLLAMA_CURL=ON ${OPT_SYCL_F16} && \
21+
cmake --build build --config Release -j$(nproc)
22+
23+
RUN mkdir -p /app/lib && \
24+
find build -name "*.so" -exec cp {} /app/lib \;
25+
26+
RUN mkdir -p /app/full \
27+
&& cp build/bin/* /app/full \
28+
&& cp *.py /app/full \
29+
&& cp -r gguf-py /app/full \
30+
&& cp -r requirements /app/full \
31+
&& cp requirements.txt /app/full \
32+
&& cp .devops/tools.sh /app/full/tools.sh
33+
34+
FROM intel/oneapi-basekit:$ONEAPI_VERSION AS base
35+
36+
RUN apt-get update \
37+
&& apt-get install -y libgomp1 curl\
38+
&& apt autoremove -y \
39+
&& apt clean -y \
40+
&& rm -rf /tmp/* /var/tmp/* \
41+
&& find /var/cache/apt/archives /var/lib/apt/lists -not -name lock -type f -delete \
42+
&& find /var/cache -type f -delete
43+
44+
### Full
45+
FROM base AS full
46+
47+
COPY --from=build /app/lib/ /app
48+
COPY --from=build /app/full /app
49+
50+
WORKDIR /app
51+
52+
RUN apt-get update \
53+
&& apt-get install -y \
54+
git \
55+
python3 \
56+
python3-pip \
57+
&& pip install --upgrade pip setuptools wheel \
58+
&& pip install -r requirements.txt \
59+
&& apt autoremove -y \
60+
&& apt clean -y \
61+
&& rm -rf /tmp/* /var/tmp/* \
62+
&& find /var/cache/apt/archives /var/lib/apt/lists -not -name lock -type f -delete \
63+
&& find /var/cache -type f -delete
64+
65+
66+
ENTRYPOINT ["/app/tools.sh"]
67+
68+
### Light, CLI only
69+
FROM base AS light
70+
71+
COPY --from=build /app/lib/ /app
72+
COPY --from=build /app/full/llama-cli /app
73+
74+
WORKDIR /app
75+
76+
ENTRYPOINT [ "/app/llama-cli" ]
77+
78+
### Server, Server only
79+
FROM base AS server
80+
81+
ENV LLAMA_ARG_HOST=0.0.0.0
82+
83+
COPY --from=build /app/lib/ /app
84+
COPY --from=build /app/full/llama-server /app
85+
86+
WORKDIR /app
87+
88+
HEALTHCHECK CMD [ "curl", "-f", "http://localhost:8080/health" ]
89+
90+
ENTRYPOINT [ "/app/llama-server" ]
91+

.devops/musa.Dockerfile

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
ARG UBUNTU_VERSION=22.04
2+
# This needs to generally match the container host's environment.
3+
ARG MUSA_VERSION=rc3.1.0
4+
# Target the MUSA build image
5+
ARG BASE_MUSA_DEV_CONTAINER=mthreads/musa:${MUSA_VERSION}-devel-ubuntu${UBUNTU_VERSION}
6+
7+
ARG BASE_MUSA_RUN_CONTAINER=mthreads/musa:${MUSA_VERSION}-runtime-ubuntu${UBUNTU_VERSION}
8+
9+
FROM ${BASE_MUSA_DEV_CONTAINER} AS build
10+
11+
# MUSA architecture to build for (defaults to all supported archs)
12+
ARG MUSA_DOCKER_ARCH=default
13+
14+
RUN apt-get update && \
15+
apt-get install -y \
16+
build-essential \
17+
cmake \
18+
python3 \
19+
python3-pip \
20+
git \
21+
libcurl4-openssl-dev \
22+
libgomp1
23+
24+
COPY requirements.txt requirements.txt
25+
COPY requirements requirements
26+
27+
RUN pip install --upgrade pip setuptools wheel \
28+
&& pip install -r requirements.txt
29+
30+
WORKDIR /app
31+
32+
COPY . .
33+
34+
# Use the default MUSA archs if not specified
35+
RUN if [ "${MUSA_DOCKER_ARCH}" != "default" ]; then \
36+
export CMAKE_ARGS="-DMUSA_ARCHITECTURES=${MUSA_DOCKER_ARCH}"; \
37+
fi && \
38+
cmake -B build -DGGML_NATIVE=OFF -DGGML_MUSA=ON -DLLAMA_CURL=ON ${CMAKE_ARGS} -DCMAKE_EXE_LINKER_FLAGS=-Wl,--allow-shlib-undefined . && \
39+
cmake --build build --config Release -j$(nproc)
40+
41+
RUN mkdir -p /app/lib && \
42+
find build -name "*.so" -exec cp {} /app/lib \;
43+
44+
RUN mkdir -p /app/full \
45+
&& cp build/bin/* /app/full \
46+
&& cp *.py /app/full \
47+
&& cp -r gguf-py /app/full \
48+
&& cp -r requirements /app/full \
49+
&& cp requirements.txt /app/full \
50+
&& cp .devops/tools.sh /app/full/tools.sh
51+
52+
## Base image
53+
FROM ${BASE_MUSA_RUN_CONTAINER} AS base
54+
55+
RUN apt-get update \
56+
&& apt-get install -y libgomp1 curl\
57+
&& apt autoremove -y \
58+
&& apt clean -y \
59+
&& rm -rf /tmp/* /var/tmp/* \
60+
&& find /var/cache/apt/archives /var/lib/apt/lists -not -name lock -type f -delete \
61+
&& find /var/cache -type f -delete
62+
63+
COPY --from=build /app/lib/ /app
64+
65+
### Full
66+
FROM base AS full
67+
68+
COPY --from=build /app/full /app
69+
70+
WORKDIR /app
71+
72+
RUN apt-get update \
73+
&& apt-get install -y \
74+
git \
75+
python3 \
76+
python3-pip \
77+
&& pip install --upgrade pip setuptools wheel \
78+
&& pip install -r requirements.txt \
79+
&& apt autoremove -y \
80+
&& apt clean -y \
81+
&& rm -rf /tmp/* /var/tmp/* \
82+
&& find /var/cache/apt/archives /var/lib/apt/lists -not -name lock -type f -delete \
83+
&& find /var/cache -type f -delete
84+
85+
86+
ENTRYPOINT ["/app/tools.sh"]
87+
88+
### Light, CLI only
89+
FROM base AS light
90+
91+
COPY --from=build /app/full/llama-cli /app
92+
93+
WORKDIR /app
94+
95+
ENTRYPOINT [ "/app/llama-cli" ]
96+
97+
### Server, Server only
98+
FROM base AS server
99+
100+
ENV LLAMA_ARG_HOST=0.0.0.0
101+
102+
COPY --from=build /app/full/llama-server /app
103+
104+
WORKDIR /app
105+
106+
HEALTHCHECK CMD [ "curl", "-f", "http://localhost:8080/health" ]
107+
108+
ENTRYPOINT [ "/app/llama-server" ]

0 commit comments

Comments
 (0)