From 6c19aaa8a82f8bf9bb5923da17fa33ed78d276e4 Mon Sep 17 00:00:00 2001 From: Cliff Hill Date: Wed, 29 Oct 2025 16:01:39 -0400 Subject: [PATCH] Getting better memory limits in place. Signed-off-by: Cliff Hill --- Dockerfile.cicd | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/Dockerfile.cicd b/Dockerfile.cicd index d6c7016..c9b28a4 100644 --- a/Dockerfile.cicd +++ b/Dockerfile.cicd @@ -1,6 +1,10 @@ # CICD Setup - Clean base image with development tools only FROM ubuntu:22.04 +# Build args for cache busting +ARG GITHUB_SHA +ENV GITHUB_SHA=${GITHUB_SHA} + # Set timezone and make installs non-interactive ENV DEBIAN_FRONTEND=noninteractive ENV TZ=America/New_York @@ -156,19 +160,20 @@ RUN echo "# CI optimizations for ARM64 memory constraints" >> .yarnrc.yml && \ echo "enableScripts: false" >> .yarnrc.yml && \ echo "preferDeferredVersions: true" >> .yarnrc.yml -# Install frontend dependencies with conservative memory management -RUN export NODE_OPTIONS="--max-old-space-size=800 --max-semi-space-size=64 --optimize-for-size" && \ +# Install frontend dependencies (conservative for 4GB Raspberry Pi workers) +# Cache bust: ${GITHUB_SHA} +RUN export NODE_OPTIONS="--max-old-space-size=1024 --max-semi-space-size=64" && \ export UV_WORKERS=1 && \ echo "Memory info before install:" && \ free -h || true && \ for i in 1 2 3; do \ - echo "Attempt $i: Installing frontend dependencies with conservative memory..." && \ + echo "Attempt $i: Installing frontend dependencies (Pi 400 compatible)..." && \ timeout 2400 yarn install --immutable --mode=skip-build \ && break || \ - (echo "Attempt $i failed, cleaning up and retrying..." && \ + (echo "Attempt $i failed, cleaning up and retrying..." && \ rm -rf node_modules .yarn/cache .yarn/install-state.gz && \ yarn cache clean --all 2>/dev/null || true && \ - sleep 45); \ + sleep 60); \ done && \ rm -rf .yarn/cache && \ swapoff /tmp/swapfile 2>/dev/null || true && \ @@ -187,10 +192,15 @@ RUN cd /workspace/backend && \ RUN cd /workspace/frontend && \ echo "=== Frontend Tools Verification ===" && \ - yarn eslint --version && \ - yarn prettier --version && \ - yarn tsc --version && \ - yarn vitest --version + if [ -d "node_modules" ]; then \ + yarn eslint --version && \ + yarn prettier --version && \ + yarn tsc --version && \ + yarn vitest --version; \ + else \ + echo "ERROR: node_modules not found - frontend dependencies not installed"; \ + exit 1; \ + fi # Create a script to set up SSH for git operations (using secrets mount) RUN echo '#!/bin/bash' > /usr/local/bin/setup-ssh && \