Spaces:
Runtime error
Runtime error
Update Dockerfile
Browse files- Dockerfile +19 -20
Dockerfile
CHANGED
|
@@ -35,7 +35,6 @@ RUN mkdir -p /home/user/code/models && \
|
|
| 35 |
cd /home/user/code/models && \
|
| 36 |
wget -q https://huggingface.co/Mungert/Qwen3.5-2B-GGUF/resolve/main/Qwen3.5-2B-q6_k_m.gguf
|
| 37 |
|
| 38 |
-
|
| 39 |
# Clone and build OpenBLAS as the non-root user
|
| 40 |
RUN git clone https://github.com/OpenMathLib/OpenBLAS.git /home/user/code/models/OpenBLAS && \
|
| 41 |
cd /home/user/code/models/OpenBLAS && \
|
|
@@ -50,6 +49,23 @@ RUN cd /home/user/code/models/OpenBLAS && \
|
|
| 50 |
# Switch back to the non-root user
|
| 51 |
USER user
|
| 52 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 53 |
# Clone repositories using the GITHUB_TOKEN secret
|
| 54 |
RUN --mount=type=secret,id=GITHUB_TOKEN,mode=0444,required=true \
|
| 55 |
git clone https://x-access-token:$(cat /run/secrets/GITHUB_TOKEN)@github.com/Mungert69/NetworkMonitorLib.git /home/user/code/NetworkMonitorLib && \
|
|
@@ -62,29 +78,13 @@ RUN git -C /home/user/code/models/llama.cpp apply \
|
|
| 62 |
# /home/user/code/NetworkMonitorLLM/patches/qwen35_session_tokens_insert_fix.diff \
|
| 63 |
# /home/user/code/NetworkMonitorLLM/patches/qwen35_mrope_kv_restore_fix.diff
|
| 64 |
|
| 65 |
-
#
|
| 66 |
-
RUN
|
| 67 |
-
cd /home/user/code/models/llama.cpp && \
|
| 68 |
export PKG_CONFIG_PATH=/opt/OpenBLAS/lib/pkgconfig:$PKG_CONFIG_PATH && \
|
| 69 |
cmake -B build -DGGML_BLAS=ON -DGGML_BLAS_VENDOR=OpenBLAS -DBLAS_INCLUDE_DIRS=/home/user/code/models/OpenBLAS -DLLAMA_CURL=OFF && \
|
| 70 |
cmake --build build --config Release -j2 && \
|
| 71 |
cp /home/user/code/models/llama.cpp/build/bin/* /home/user/code/models/llama.cpp/
|
| 72 |
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
# Install .NET 10.0 as the non-root user
|
| 76 |
-
RUN wget https://dot.net/v1/dotnet-install.sh -O dotnet-install.sh && \
|
| 77 |
-
chmod +x dotnet-install.sh && \
|
| 78 |
-
./dotnet-install.sh --channel 10.0
|
| 79 |
-
|
| 80 |
-
# Set persistent environment variables
|
| 81 |
-
ENV DOTNET_ROOT=/home/user/.dotnet
|
| 82 |
-
ENV PATH=$PATH:$DOTNET_ROOT:$DOTNET_ROOT/tools
|
| 83 |
-
|
| 84 |
-
# Verify .NET installation and current user
|
| 85 |
-
RUN whoami && dotnet --version
|
| 86 |
-
|
| 87 |
-
|
| 88 |
# Copy files into the container as the non-root user
|
| 89 |
COPY --chown=user:user appsettings.json /home/user/code/app/appsettings.json
|
| 90 |
COPY --chown=user:user index.html /home/user/code/app/wwwroot/index.html
|
|
@@ -110,4 +110,3 @@ RUN cp -r /home/user/code/NetworkMonitorLLM/bin/Release/net10.0/* /home/user/cod
|
|
| 110 |
WORKDIR /home/user/code/app
|
| 111 |
|
| 112 |
CMD ["dotnet", "NetworkMonitorLLM.dll", "--urls", "http://0.0.0.0:7860"]
|
| 113 |
-
|
|
|
|
| 35 |
cd /home/user/code/models && \
|
| 36 |
wget -q https://huggingface.co/Mungert/Qwen3.5-2B-GGUF/resolve/main/Qwen3.5-2B-q6_k_m.gguf
|
| 37 |
|
|
|
|
| 38 |
# Clone and build OpenBLAS as the non-root user
|
| 39 |
RUN git clone https://github.com/OpenMathLib/OpenBLAS.git /home/user/code/models/OpenBLAS && \
|
| 40 |
cd /home/user/code/models/OpenBLAS && \
|
|
|
|
| 49 |
# Switch back to the non-root user
|
| 50 |
USER user
|
| 51 |
|
| 52 |
+
# Clone llama.cpp as the non-root user
|
| 53 |
+
RUN git clone https://github.com/ggerganov/llama.cpp /home/user/code/models/llama.cpp
|
| 54 |
+
|
| 55 |
+
|
| 56 |
+
|
| 57 |
+
# Install .NET 10.0 as the non-root user
|
| 58 |
+
RUN wget https://dot.net/v1/dotnet-install.sh -O dotnet-install.sh && \
|
| 59 |
+
chmod +x dotnet-install.sh && \
|
| 60 |
+
./dotnet-install.sh --channel 10.0
|
| 61 |
+
|
| 62 |
+
# Set persistent environment variables
|
| 63 |
+
ENV DOTNET_ROOT=/home/user/.dotnet
|
| 64 |
+
ENV PATH=$PATH:$DOTNET_ROOT:$DOTNET_ROOT/tools
|
| 65 |
+
|
| 66 |
+
# Verify .NET installation and current user
|
| 67 |
+
RUN whoami && dotnet --version
|
| 68 |
+
|
| 69 |
# Clone repositories using the GITHUB_TOKEN secret
|
| 70 |
RUN --mount=type=secret,id=GITHUB_TOKEN,mode=0444,required=true \
|
| 71 |
git clone https://x-access-token:$(cat /run/secrets/GITHUB_TOKEN)@github.com/Mungert69/NetworkMonitorLib.git /home/user/code/NetworkMonitorLib && \
|
|
|
|
| 78 |
# /home/user/code/NetworkMonitorLLM/patches/qwen35_session_tokens_insert_fix.diff \
|
| 79 |
# /home/user/code/NetworkMonitorLLM/patches/qwen35_mrope_kv_restore_fix.diff
|
| 80 |
|
| 81 |
+
# Build llama.cpp with OpenBLAS support after patches
|
| 82 |
+
RUN cd /home/user/code/models/llama.cpp && \
|
|
|
|
| 83 |
export PKG_CONFIG_PATH=/opt/OpenBLAS/lib/pkgconfig:$PKG_CONFIG_PATH && \
|
| 84 |
cmake -B build -DGGML_BLAS=ON -DGGML_BLAS_VENDOR=OpenBLAS -DBLAS_INCLUDE_DIRS=/home/user/code/models/OpenBLAS -DLLAMA_CURL=OFF && \
|
| 85 |
cmake --build build --config Release -j2 && \
|
| 86 |
cp /home/user/code/models/llama.cpp/build/bin/* /home/user/code/models/llama.cpp/
|
| 87 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 88 |
# Copy files into the container as the non-root user
|
| 89 |
COPY --chown=user:user appsettings.json /home/user/code/app/appsettings.json
|
| 90 |
COPY --chown=user:user index.html /home/user/code/app/wwwroot/index.html
|
|
|
|
| 110 |
WORKDIR /home/user/code/app
|
| 111 |
|
| 112 |
CMD ["dotnet", "NetworkMonitorLLM.dll", "--urls", "http://0.0.0.0:7860"]
|
|
|