mirror of
https://github.com/aaronpo97/the-biergarten-app.git
synced 2026-05-31 17:53:59 +00:00
@@ -22,7 +22,7 @@ RUN curl -L https://github.com/ggml-org/llama.cpp/archive/refs/tags/b9012.tar.gz
|
|||||||
# Pull llama.cpp binaries to use during build if needed
|
# Pull llama.cpp binaries to use during build if needed
|
||||||
COPY --from=ghcr.io/ggml-org/llama.cpp:full-cuda /app/lib*.so* /usr/local/lib/
|
COPY --from=ghcr.io/ggml-org/llama.cpp:full-cuda /app/lib*.so* /usr/local/lib/
|
||||||
|
|
||||||
WORKDIR /workspace/app
|
WORKDIR /app
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
# Build the C++ pipeline
|
# Build the C++ pipeline
|
||||||
@@ -34,6 +34,8 @@ FROM nvidia/cuda:12.6.3-runtime-ubuntu24.04 AS runtime
|
|||||||
|
|
||||||
# Install only necessary runtime shared libraries
|
# Install only necessary runtime shared libraries
|
||||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||||
|
curl \
|
||||||
|
ca-certificates \
|
||||||
libboost-json1.83.0 \
|
libboost-json1.83.0 \
|
||||||
libboost-program-options1.83.0 \
|
libboost-program-options1.83.0 \
|
||||||
libgomp1 \
|
libgomp1 \
|
||||||
@@ -41,20 +43,20 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
|
|||||||
zlib1g \
|
zlib1g \
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
ENV APP_ROOT=/workspace/app \
|
ENV APP_ROOT=/app \
|
||||||
LD_LIBRARY_PATH="/usr/local/lib:${LD_LIBRARY_PATH}"
|
LD_LIBRARY_PATH="/usr/local/lib:${LD_LIBRARY_PATH}"
|
||||||
|
|
||||||
WORKDIR /workspace/app/build
|
WORKDIR /app/build
|
||||||
|
|
||||||
# Copy only the compiled binaries from the builder
|
# Copy only the compiled binaries from the builder
|
||||||
COPY --from=builder /workspace/app/build/biergarten-pipeline ./
|
COPY --from=builder /app/build/biergarten-pipeline ./
|
||||||
|
|
||||||
# Copy required config files
|
# Copy required config files
|
||||||
COPY locations.json /workspace/app/build/
|
COPY locations.json /app/build/
|
||||||
COPY beer-styles.json /workspace/app/build/
|
COPY beer-styles.json /app/build/
|
||||||
|
|
||||||
# Copy prompt templates
|
# Copy prompt templates
|
||||||
COPY prompts /workspace/app/prompts
|
COPY prompts /app/prompts
|
||||||
|
|
||||||
# Copy only the necessary shared libraries from builder/llama-bin
|
# Copy only the necessary shared libraries from builder/llama-bin
|
||||||
COPY --from=ghcr.io/ggml-org/llama.cpp:full-cuda /app/lib*.so* /usr/local/lib/
|
COPY --from=ghcr.io/ggml-org/llama.cpp:full-cuda /app/lib*.so* /usr/local/lib/
|
||||||
|
|||||||
@@ -5,8 +5,8 @@ set -e
|
|||||||
MODEL_PATH="${BIERGARTEN_MODEL_PATH:-/workspace/models/google_gemma-4-E4B-it-Q6_K.gguf}"
|
MODEL_PATH="${BIERGARTEN_MODEL_PATH:-/workspace/models/google_gemma-4-E4B-it-Q6_K.gguf}"
|
||||||
OUTPUT_DIR="${BIERGARTEN_OUTPUT_DIR:-/workspace/output}"
|
OUTPUT_DIR="${BIERGARTEN_OUTPUT_DIR:-/workspace/output}"
|
||||||
LOG_PATH="${BIERGARTEN_LOG_PATH:-/workspace/logs/pipeline.log}"
|
LOG_PATH="${BIERGARTEN_LOG_PATH:-/workspace/logs/pipeline.log}"
|
||||||
EXECUTABLE="/workspace/app/build/biergarten-pipeline"
|
EXECUTABLE="/app/build/biergarten-pipeline"
|
||||||
PROMPT_DIR="/workspace/app/prompts"
|
PROMPT_DIR="/app/prompts"
|
||||||
|
|
||||||
echo "--- Starting Biergarten Pipeline Environment Check ---"
|
echo "--- Starting Biergarten Pipeline Environment Check ---"
|
||||||
|
|
||||||
@@ -14,14 +14,6 @@ echo "--- Starting Biergarten Pipeline Environment Check ---"
|
|||||||
mkdir -p "$OUTPUT_DIR"
|
mkdir -p "$OUTPUT_DIR"
|
||||||
mkdir -p "$(dirname "$LOG_PATH")"
|
mkdir -p "$(dirname "$LOG_PATH")"
|
||||||
|
|
||||||
# 2. Check for model file
|
|
||||||
if [ ! -f "$MODEL_PATH" ]; then
|
|
||||||
echo "ERROR: Model not found at $MODEL_PATH"
|
|
||||||
echo "Current /workspace/models contents:"
|
|
||||||
ls -lh /workspace/models 2>/dev/null || echo "(directory does not exist)"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# 3. Build the command arguments
|
# 3. Build the command arguments
|
||||||
ARGS=(
|
ARGS=(
|
||||||
"--model" "$MODEL_PATH"
|
"--model" "$MODEL_PATH"
|
||||||
@@ -44,6 +36,24 @@ if [[ -n "$BIERGARTEN_EXTRA_ARGS" ]]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
echo "--- Executing: $EXECUTABLE ${ARGS[*]} ---"
|
echo "--- Executing: $EXECUTABLE ${ARGS[*]} ---"
|
||||||
|
# 2. Ensure model directory exists
|
||||||
|
mkdir -p "$(dirname "$MODEL_PATH")"
|
||||||
|
|
||||||
|
# 3. Download model if missing
|
||||||
|
if [ ! -f "$MODEL_PATH" ]; then
|
||||||
|
echo "Model not found. Downloading..."
|
||||||
|
|
||||||
|
curl -L \
|
||||||
|
-o "$MODEL_PATH" \
|
||||||
|
"https://huggingface.co/bartowski/google_gemma-4-E4B-it-GGUF/resolve/main/google_gemma-4-E4B-it-Q6_K.gguf?download=true"
|
||||||
|
|
||||||
|
echo "Download complete."
|
||||||
|
fi
|
||||||
|
|
||||||
|
# 4. Verify model exists
|
||||||
|
if [ ! -f "$MODEL_PATH" ]; then
|
||||||
|
echo "ERROR: Model still not found after download attempt."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
# Execute the binary directly, replacing the shell process
|
# Execute the binary directly, replacing the shell process
|
||||||
exec "$EXECUTABLE" "${ARGS[@]}"
|
exec "$EXECUTABLE" "${ARGS[@]}"
|
||||||
|
|||||||
Reference in New Issue
Block a user