Skip to content

Commit 1bdde8f

Browse files
committed
Update entrypoint.sh file
1 parent 6f939ee commit 1bdde8f

2 files changed

Lines changed: 11 additions & 7 deletions

File tree

pipelines/Dockerfile.terratorch

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,14 @@ WORKDIR /terratorch
5555

5656
ENV HF_HOME=/app/models/huggingface_cache \
5757
TERRATORCH_SEGMENTATION_IO_PROCESSOR_CONFIG='{"output_path": "/data/output/"}' \
58-
PATH="/home/appuser/.local/bin:${PATH}"
58+
PATH="/home/appuser/.local/bin:${PATH}" \
59+
PYTHONUNBUFFERED=1 \
60+
PYTHONDONTWRITEBYTECODE=1
5961

6062
# Install Python dependencies with cache mount for faster rebuilds
6163
RUN pip install --upgrade pip && \
6264
pip install --timeout=7200 \
6365
terratorch[vllm]==1.2.1 \
64-
# "vllm>=0.6.0" \
6566
'diffusers<=0.34.0' \
6667
ipython \
6768
nbformat \
@@ -121,8 +122,11 @@ RUN chmod +x /app/entrypoint.sh /app/healthcheck.sh
121122

122123
# Switch to non-root user
123124
USER appuser
125+
124126
WORKDIR /opt/app-root/src
127+
125128
EXPOSE 8000
129+
126130
HEALTHCHECK --interval=30s --timeout=10s --start-period=120s --retries=3 \
127131
CMD ["/bin/bash", "/app/healthcheck.sh"]
128132

pipelines/entrypoint.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
#!/bin/bash
22
set -e
33

4-
if [ "$APP_MODE" = "v" ]; then
5-
echo "Starting in Standard TerraTorch mode..."
4+
if [ "$APP_MODE" = "vllm" ]; then
5+
echo "Starting in VLLM mode"
66

77
MODEL_NAME=${MODEL_NAME:-"ibm-nasa-geospatial/Prithvi-EO-2.0-300M-TL-Sen1Floods11"}
88
PLUGIN_NAME=${PLUGIN_NAME:-"terratorch_segmentation"}
9-
HF_HOME=${HF_HOME:-"/workspace/models/huggingface_cache"}
9+
HF_HOME=${HF_HOME:-"/app/models/huggingface_cache"}
1010

1111
echo "=========================================="
1212
echo "vLLM Prithvi Flood Detection Server"
@@ -18,8 +18,8 @@ if [ "$APP_MODE" = "v" ]; then
1818
echo ""
1919
# 1. Clear Hugging Face lock files
2020
# This prevents the 'OSError: PermissionError' if a previous pod crashed
21-
echo "Checking for stale lock files in /workspace/models..."
22-
find /workspace/models -name "*.lock" -delete
21+
echo "Checking for stale lock files in /app/models..."
22+
find /app/models -name "*.lock" -delete
2323

2424
# 2. Verify GPU availability
2525
# This logs the GPU status to help debug 'Pending' or 'Runtime' errors

0 commit comments

Comments
 (0)