Skip to content

Commit 8f58343

Browse files
committed
requiremets change
1 parent e96d3fc commit 8f58343

File tree

4 files changed

+77
-35
lines changed

4 files changed

+77
-35
lines changed
Lines changed: 38 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
11
FROM python:3.11-slim-bookworm
22

3+
# -------------------------------
4+
# Working directory
5+
# -------------------------------
36
WORKDIR /app
47

8+
# -------------------------------
9+
# System dependencies (single layer)
10+
# -------------------------------
511
RUN apt-get update && apt-get install -y \
612
curl \
713
gcc \
@@ -10,16 +16,45 @@ RUN apt-get update && apt-get install -y \
1016
wget \
1117
&& rm -rf /var/lib/apt/lists/*
1218

13-
RUN mkdir -p /app /tmp/huggingface \
19+
# -------------------------------
20+
# Directories required for OpenShift / HuggingFace
21+
# (OpenShift runs with random UID)
22+
# -------------------------------
23+
RUN mkdir -p /app \
24+
/tmp/huggingface \
25+
/tmp/huggingface/transformers \
1426
&& chmod -R 777 /app /tmp/huggingface
1527

28+
# -------------------------------
29+
# Environment hardening (CRITICAL)
30+
# -------------------------------
31+
ENV PYTHONPATH=/app
32+
ENV PYTHONUNBUFFERED=1
33+
34+
# HuggingFace caches
1635
ENV HF_HOME=/tmp/huggingface
1736
ENV TRANSFORMERS_CACHE=/tmp/huggingface/transformers
18-
ENV PYTHONPATH=/app
1937

38+
# 🚫 Disable pip cache (fixes overlayfs failures)
39+
ENV PIP_NO_CACHE_DIR=1
40+
ENV PIP_DISABLE_PIP_VERSION_CHECK=1
41+
42+
# 🚫 Prevent CUDA / NVIDIA probing
43+
ENV CUDA_VISIBLE_DEVICES=""
44+
ENV TORCH_CUDA_ARCH_LIST=""
45+
46+
# -------------------------------
47+
# Python dependencies
48+
# -------------------------------
2049
COPY requirements.txt .
21-
RUN pip install -r requirements.txt
50+
RUN pip install --no-cache-dir -r requirements.txt
2251

52+
# -------------------------------
53+
# Application source
54+
# -------------------------------
2355
COPY . .
2456

57+
# -------------------------------
58+
# Run FastAPI
59+
# -------------------------------
2560
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8002"]
Lines changed: 27 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,28 @@
1-
fastapi
2-
uvicorn
3-
redis
4-
kubernetes
5-
sentence-transformers
6-
transformers
7-
langchain
8-
langchain-community
9-
faiss-cpu
1+
# FastAPI stack
2+
fastapi==0.110.0
3+
uvicorn==0.27.0
4+
httpx==0.27.0
5+
python-dotenv==1.0.1
6+
7+
# Infra / orchestration
8+
redis==5.0.1
9+
kubernetes==29.0.0
1010
openshift==0.13.1
11-
python-dotenv
12-
tiktoken
13-
#email-validator
14-
openai
15-
psutil
16-
py-spy
17-
ipython
18-
httpx
11+
psutil==5.9.8
12+
13+
# LLM / embeddings (CPU ONLY)
14+
sentence-transformers==2.5.1
15+
transformers==4.37.2
16+
faiss-cpu==1.7.4
17+
18+
# LangChain (pinned to compatible versions)
19+
langchain==0.1.16
20+
langchain-community==0.0.34
21+
22+
# Tokenization / LLM APIs
23+
tiktoken==0.6.0
24+
openai==1.12.0
25+
26+
# Debug / dev (optional but safe)
27+
ipython==8.22.2
28+
py-spy==0.3.14

demo/demo-1-basics/anomaly_isolation_forest/Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ RUN apt-get update && \
1313
wget \
1414
&& rm -rf /var/lib/apt/lists/*
1515

16+
17+
1618
# Copy requirement files and install dependencies
1719
COPY requirements.txt .
1820
RUN pip install -r requirements.txt
Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,15 @@
11
fastapi==0.110.0
22
uvicorn==0.27.0
3+
34
scikit-learn==1.3.0
4-
pandas==2.2.0
55
numpy==1.26.0
6+
pandas==2.2.0
67
joblib==1.3.2
7-
redis
8-
typing_inspect
9-
pandas
10-
apscheduler
11-
httpx
12-
asyncio
13-
sqlalchemy
14-
psycopg2-binary>=2.9
15-
# fastapi
16-
# uvicorn
17-
# scikit-learn
18-
# pandas
19-
# numpy
20-
# joblib
8+
9+
redis==5.0.1
10+
typing-inspect==0.9.0
11+
apscheduler==3.10.4
12+
httpx==0.27.0
13+
14+
sqlalchemy==2.0.25
15+
psycopg2-binary==2.9.9

0 commit comments

Comments
 (0)