Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
61a8730
fix: Add ca-tor region mapping for ICR
manavgup Nov 14, 2025
07a13c4
fix: Handle soft-deleted Code Engine projects
manavgup Nov 14, 2025
e85f26e
fix: Pull images before Trivy scan and fix deployment idempotency
manavgup Nov 14, 2025
d6ad762
fix: Add Trivy registry credentials and verify image pull
manavgup Nov 14, 2025
ae6dc9c
fix: Add disk space cleanup before Docker builds
manavgup Nov 14, 2025
116b7ff
fix: More aggressive cleanup to prevent disk space issues
manavgup Nov 14, 2025
def756e
fix: Reduce Docker cache usage to prevent disk space exhaustion
manavgup Nov 14, 2025
a0c37ff
fix: Add Code Engine project selection to smoke-test job
manavgup Nov 15, 2025
3b54038
fix: Require build jobs to succeed before deployment
manavgup Nov 15, 2025
7a5390a
fix: Pass project name from infrastructure job to smoke-test
manavgup Nov 15, 2025
9ecb884
fix: Make security scans non-blocking
manavgup Nov 15, 2025
156025f
fix: Prevent CUDA torch installation in Docker build
manavgup Nov 15, 2025
81fad2c
fix: Remove poetry export command that requires plugin
manavgup Nov 15, 2025
4adf32c
fix: Add deploy-infrastructure to smoke-test needs to access project …
manavgup Nov 15, 2025
2f28ed3
feat: Improve smoke-test and add timeouts following best practices
manavgup Nov 15, 2025
739f9de
fix: Add image verification steps to catch missing images early
manavgup Nov 15, 2025
f837171
feat: Add semantic versioning and image cleanup for registry management
manavgup Nov 15, 2025
1e7bef6
feat: Integrate PROJECT_VERSION from .env/Makefile into workflow
manavgup Nov 15, 2025
835e608
fix: Add version extraction step to backend build job
manavgup Nov 15, 2025
c37ed95
fix: Read PROJECT_VERSION from .env file first (matches Makefile beha…
manavgup Nov 15, 2025
041aff7
fix: Update both backend and frontend to read PROJECT_VERSION from .env
manavgup Nov 15, 2025
3ac7089
docs: Add comprehensive CI/CD workflow and versioning documentation
manavgup Nov 15, 2025
2071b56
docs: Add dedicated versioning strategy documentation
manavgup Nov 15, 2025
307869e
docs: Add versioning section to development index
manavgup Nov 15, 2025
4a477f5
fix: Improve smoke-test to detect and report failed app states
manavgup Nov 15, 2025
cda99a2
feat: Add pre-check for failed app states in smoke-test
manavgup Nov 15, 2025
711fe02
feat: Add post-deployment verification and revision status
manavgup Nov 15, 2025
85fe50d
feat: Add post-deployment verification for frontend
manavgup Nov 15, 2025
6dfdbf6
fix: Use fallback strategy for image tags in deploy jobs
manavgup Nov 15, 2025
16d66e9
fix: Add fallback strategy for frontend image tags
manavgup Nov 15, 2025
0f3d81d
fix: Handle soft-deleted projects in deploy-backend and deploy-frontend
manavgup Nov 15, 2025
4367cf4
fix: Check for soft-deleted projects before selecting
manavgup Nov 15, 2025
7e112f0
fix: Use --name flag for ibmcloud ce app update command
manavgup Nov 15, 2025
3820827
fix: Use --name flag for backend app update command
manavgup Nov 15, 2025
ce807a6
fix: Add email-validator and fix frontend nginx backend URL
manavgup Nov 15, 2025
16ef175
fix: Correct nginx proxy_pass syntax and get backend URL dynamically
manavgup Nov 15, 2025
269ec56
feat: Get backend URL dynamically for frontend nginx config
manavgup Nov 15, 2025
e9a4df9
fix: Pass BACKEND_URL env var to frontend app for nginx
manavgup Nov 15, 2025
50996ca
fix: Use correct port 8080 for frontend app
manavgup Nov 15, 2025
ac8f1b0
chore: Update poetry.lock after adding email-validator
manavgup Nov 15, 2025
b6b2c3a
fix: Update deploy-direct script to match workflow logic
manavgup Nov 15, 2025
7802216
fix: Prevent CUDA/NVIDIA libraries from being installed
manavgup Nov 15, 2025
c484486
fix: Add CPU-only environment variables to top-level ENV block
manavgup Nov 15, 2025
9a1c8cb
fix: Backend email-validator and frontend deployment dependency
manavgup Nov 15, 2025
a6166af
fix: Use backend/Dockerfile.backend instead of Dockerfile.codeengine
manavgup Nov 15, 2025
058bac7
fix: Configure for ca-tor region and fix SKIP_AUTH default
manavgup Nov 15, 2025
aa37734
fix: Revert region default change, keep SKIP_AUTH fix
manavgup Nov 15, 2025
14633ba
fix(deps): Add transformers[vision] for AutoModelForImageTextToText
manavgup Nov 16, 2025
0d69731
fix(docker): preserve numpy._core.tests in cleanup
manavgup Nov 16, 2025
0732ed7
Trigger new deployment with latest fixes
manavgup Nov 16, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,078 changes: 1,013 additions & 65 deletions .github/workflows/deploy_complete_app.yml

Large diffs are not rendered by default.

70 changes: 44 additions & 26 deletions Dockerfile.codeengine
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,30 @@
FROM python:3.12-slim AS builder

# Pre-configure poetry to install to system Python
# Set environment variables to force CPU-only mode (prevents CUDA dependencies)
ENV PYTHONUNBUFFERED=1 \
PYTHONDONTWRITEBYTECODE=1 \
POETRY_VERSION=2.1.3 \
POETRY_HOME="/opt/poetry" \
POETRY_VIRTUALENVS_IN_PROJECT=false \
POETRY_VIRTUALENVS_CREATE=false \
POETRY_NO_INTERACTION=1 \
POETRY_CACHE_DIR="/opt/poetry/cache"
POETRY_CACHE_DIR="/opt/poetry/cache" \
CUDA_VISIBLE_DEVICES="" \
FORCE_CPU=1 \
TORCH_CUDA_ARCH_LIST=""

ENV PATH="$POETRY_HOME/bin:$PATH"

# Install system dependencies
RUN apt-get update && \
apt-get install -y build-essential curl && \
apt-get install -y --no-install-recommends build-essential curl && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

# Install Rust and poetry
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y && . $HOME/.cargo/env \
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y && . "$HOME/.cargo/env" \
&& curl -sSL https://install.python-poetry.org | python3 -

# Add Rust to PATH
Expand All @@ -37,35 +42,48 @@ ARG POETRY_ROOT_MIGRATION=20251027
# Poetry config moved from backend/ to project root
COPY pyproject.toml poetry.lock ./

# Install CPU-only PyTorch first to avoid CUDA dependencies (~6GB savings)
# Using torch 2.6.0 CPU-only version (compatible with ARM64 and x86_64)
# Note: torchvision doesn't have +cpu builds, use regular version
RUN --mount=type=cache,target=/root/.cache/pip \
pip install --no-cache-dir \
torch==2.6.0+cpu \
--index-url https://download.pytorch.org/whl/cpu && \
pip install --no-cache-dir torchvision==0.21.0

# Configure pip globally to prevent any CUDA torch reinstalls
RUN pip config set global.extra-index-url https://download.pytorch.org/whl/cpu

# Install docling without dependencies first (prevents CUDA torch pull)
# Install CPU-only PyTorch first to avoid CUDA dependencies (~6GB savings)
# Using torch 2.6.0 CPU-only version (compatible with ARM64 and x86_64)
# Note: torchvision doesn't have +cpu builds, use regular version
RUN --mount=type=cache,target=/root/.cache/pip \
pip install --no-cache-dir --no-deps docling
pip install --no-cache-dir \
torch==2.6.0+cpu \
--index-url https://download.pytorch.org/whl/cpu && \
pip install --no-cache-dir torchvision==0.21.0

# Now install all dependencies via Poetry, which will:
# - Skip torch/torchvision (already installed)
# - Skip docling (already installed)
# - Install everything else
# Install CPU-only transformers and sentence-transformers BEFORE docling
# These are dependencies of docling and might pull CUDA versions
RUN --mount=type=cache,target=/root/.cache/pip \
--mount=type=cache,target=/root/.cache/pypoetry \
poetry install --only main --no-root --no-cache

# Clean up system Python installation
pip install --no-cache-dir \
transformers==4.46.0 \
sentence-transformers==5.1.2 \
--index-url https://download.pytorch.org/whl/cpu \
--extra-index-url https://pypi.org/simple

# Configure pip globally to ONLY use CPU torch index
# This prevents any package from pulling CUDA versions
RUN pip config set global.index-url https://download.pytorch.org/whl/cpu && \
pip config set global.extra-index-url https://pypi.org/simple

# Use Poetry to install dependencies directly (skipping torch/torchvision/transformers/sentence-transformers)
# Poetry will respect the already-installed CPU-only packages
RUN poetry install --only main --no-root --no-interaction && \
# Verify we still have CPU-only torch
python -c "import torch; assert not torch.cuda.is_available(), 'CUDA torch detected!'; print('βœ“ CPU-only torch confirmed')" && \
# Verify no CUDA libraries are installed
python -c "import sys; import subprocess; result = subprocess.run(['find', '/usr/local/lib/python3.12/site-packages', '-name', '*cuda*', '-o', '-name', '*nvidia*'], capture_output=True, text=True); assert not result.stdout.strip(), f'CUDA/NVIDIA libraries found: {result.stdout}'; print('βœ“ No CUDA/NVIDIA libraries detected')"

# Clean up system Python installation - more aggressive cleanup
RUN find /usr/local -name "*.pyc" -delete && \
find /usr/local -name "__pycache__" -type d -exec rm -rf {} + 2>/dev/null || true && \
find /usr/local -name "tests" -type d -exec rm -rf {} + 2>/dev/null || true && \
find /usr/local -name "*.egg-info" -type d -exec rm -rf {} + 2>/dev/null || true
find /usr/local -name "test" -type d -exec rm -rf {} + 2>/dev/null || true && \
find /usr/local -name "*.egg-info" -type d -exec rm -rf {} + 2>/dev/null || true && \
find /usr/local -name "*.dist-info" -type d -exec rm -rf {} + 2>/dev/null || true && \
find /usr/local -name "*.so.*" ! -name "*.so" -delete 2>/dev/null || true && \
find /usr/local -name "*.a" -delete 2>/dev/null || true && \
rm -rf /root/.cache/pip /root/.cache/pypoetry /opt/poetry/cache 2>/dev/null || true && \
rm -rf /root/.cargo/registry /root/.cargo/git 2>/dev/null || true

# Final stage - clean runtime
FROM python:3.12-slim
Expand Down
6 changes: 4 additions & 2 deletions backend/Dockerfile.backend
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,16 @@ COPY pyproject.toml poetry.lock ./
# https://github.com/docling-project/docling/blob/main/Dockerfile
# Note: We normalize dependency strings by removing spaces before parentheses
# (e.g., "psutil (>=7.0.0,<8.0.0)" -> "psutil>=7.0.0,<8.0.0")
# and handle extras syntax (e.g., "pydantic[email]>=2.8.2" -> "pydantic[email]>=2.8.2")
RUN --mount=type=cache,target=/root/.cache/pip \
python -c "import tomllib; f=open('pyproject.toml','rb'); data=tomllib.load(f); deps = data['project']['dependencies']; print('\n'.join(d.replace(' (', '').replace(')', '') for d in deps))" | \
python -c "import tomllib; f=open('pyproject.toml','rb'); data=tomllib.load(f); deps = data['project']['dependencies']; print('\n'.join(d.replace(' (', '(').replace(') ', ')') if '[' in d else d.replace(' (', '').replace(')', '') for d in deps))" | \
xargs pip install --no-cache-dir --extra-index-url https://download.pytorch.org/whl/cpu

# Clean up system Python installation
# IMPORTANT: Preserve numpy._core.tests - it's a required module, not test code
RUN find /usr/local -name "*.pyc" -delete && \
find /usr/local -name "__pycache__" -type d -exec rm -rf {} + 2>/dev/null || true && \
find /usr/local -name "tests" -type d -exec rm -rf {} + 2>/dev/null || true && \
find /usr/local -name "tests" -type d ! -path "*/numpy/*" -exec rm -rf {} + 2>/dev/null || true && \
find /usr/local -name "*.egg-info" -type d -exec rm -rf {} + 2>/dev/null || true

# Final stage - clean runtime
Expand Down
Loading
Loading