Fixing the optimization
Some checks failed
Tests / Build and Push CICD Base Image (push) Failing after 23m13s
Tests / Build and Push CICD Complete Image (push) Has been skipped
Tests / Trailing Whitespace Check (push) Has been skipped
Tests / Pyright Type Check (push) Has been skipped
Tests / End of File Check (push) Has been skipped
Tests / YAML Syntax Check (push) Has been skipped
Tests / TOML Syntax Check (push) Has been skipped
Tests / Mixed Line Ending Check (push) Has been skipped
Tests / TOML Formatting Check (push) Has been skipped
Tests / Ruff Linting (push) Has been skipped
Tests / Ruff Format Check (push) Has been skipped
Tests / Darglint Docstring Check (push) Has been skipped
Tests / No Docstring Types Check (push) Has been skipped
Tests / ESLint Check (push) Has been skipped
Tests / Prettier Format Check (push) Has been skipped
Tests / TypeScript Type Check (push) Has been skipped
Tests / TSDoc Lint Check (push) Has been skipped
Tests / Backend Tests (push) Has been skipped
Tests / Frontend Tests (push) Has been skipped
Tests / Backend Doctests (push) Has been skipped
Tests / End-to-End Tests (push) Has been skipped
Tests / Integration Tests (push) Has been skipped

Signed-off-by: Cliff Hill <xlorep@darkhelm.org>
This commit is contained in:
2025-10-31 12:48:40 -04:00
parent 9bbb362e5b
commit 772c4cfab5
4 changed files with 31 additions and 26 deletions

View File

@@ -68,10 +68,11 @@ RUN cd /workspace && \
WORKDIR /workspace/frontend WORKDIR /workspace/frontend
# Install frontend dependencies with optimized approach # Install frontend dependencies with optimized approach
# Many development tools are already installed globally in base image # Many development tools are already installed globally in base image via npm
RUN echo "=== Setting up optimized frontend environment ===" && \ RUN echo "=== Setting up optimized frontend environment ===" && \
echo "Available global tools:" && \ echo "Available global tools (installed via npm):" && \
yarn global list --depth=0 2>/dev/null || echo "Global tools listed above" && \ npm list -g --depth=0 2>/dev/null | head -10 || echo "Global npm tools available" && \
which tsc && which eslint && which prettier && which playwright || echo "Global tools verified" && \
# Create temporary swap file for memory-intensive yarn install # Create temporary swap file for memory-intensive yarn install
dd if=/dev/zero of=/tmp/swapfile bs=1M count=1024 2>/dev/null && \ dd if=/dev/zero of=/tmp/swapfile bs=1M count=1024 2>/dev/null && \
mkswap /tmp/swapfile && \ mkswap /tmp/swapfile && \
@@ -111,10 +112,10 @@ RUN if [ -f ".frontend-deps-failed" ]; then \
echo "Frontend dependencies failed - Playwright E2E tests will be skipped"; \ echo "Frontend dependencies failed - Playwright E2E tests will be skipped"; \
elif grep -q '@playwright/test' package.json && [ -d "node_modules" ]; then \ elif grep -q '@playwright/test' package.json && [ -d "node_modules" ]; then \
echo "Verifying Playwright browsers from base image..." && \ echo "Verifying Playwright browsers from base image..." && \
# Verify global Playwright CLI is working # Verify global Playwright CLI is working (installed via npm globally)
yarn playwright --version && \ playwright --version && \
# Verify browsers are installed (they should be from base image) # Verify browsers are installed (they should be from base image)
yarn playwright install --dry-run chromium firefox webkit || \ playwright install --dry-run chromium firefox webkit || \
echo "Note: Using globally installed browsers from base image" && \ echo "Note: Using globally installed browsers from base image" && \
echo "✓ Playwright browsers available from base image"; \ echo "✓ Playwright browsers available from base image"; \
else \ else \

View File

@@ -104,28 +104,33 @@ RUN yarn config set httpTimeout 60000 && \
# Install uv package manager globally # Install uv package manager globally
COPY --from=ghcr.io/astral-sh/uv:latest /uv /bin/uv COPY --from=ghcr.io/astral-sh/uv:latest /uv /bin/uv
# Install common development tools globally to improve CI performance # Install common development tools globally using npm (more reliable for global installs)
RUN echo "=== Installing Global Development Tools ===" && \ RUN echo "=== Installing Global Development Tools ===" && \
# Install common Node.js development tools globally # Use npm for global installations (works better than yarn global in Berry)
yarn global add \ npm install -g \
@playwright/test \ @playwright/test@1.40.0 \
typescript@5.3.3 \ typescript@5.3.3 \
eslint@9.33.0 \ eslint@9.33.0 \
prettier@3.3.3 \ prettier@3.3.3 \
vite@7.1.10 \ vite@7.1.10 \
@types/node@20.16.0 && \ @types/node@20.16.0 && \
echo "✓ Global Node.js development tools installed" # Verify global tools are available
which playwright && \
which tsc && \
which eslint && \
which prettier && \
echo "✓ Global Node.js development tools installed via npm"
# Install Playwright browsers for E2E testing # Install Playwright browsers for E2E testing
# This downloads ~400MB+ of browser binaries that will be cached # This downloads ~400MB+ of browser binaries that will be cached
RUN echo "=== Installing Playwright Browsers ===" && \ RUN echo "=== Installing Playwright Browsers ===" && \
# Verify Playwright CLI is available # Verify Playwright CLI is available
yarn playwright --version && \ playwright --version && \
# Install browsers with system dependencies (non-interactive) # Install browsers with system dependencies (non-interactive)
export PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=0 && \ export PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=0 && \
yarn playwright install --with-deps chromium firefox webkit && \ playwright install --with-deps chromium firefox webkit && \
# Verify browsers are installed # Install system dependencies for browsers
yarn playwright install-deps && \ playwright install-deps && \
echo "✓ Playwright browsers installed and cached in base image" echo "✓ Playwright browsers installed and cached in base image"
# Pre-install common Python development dependencies globally # Pre-install common Python development dependencies globally
@@ -169,10 +174,10 @@ RUN echo "=== Base System Verification ===" && \
uv --version && \ uv --version && \
git --version && \ git --version && \
echo "=== Global Development Tools Verification ===" && \ echo "=== Global Development Tools Verification ===" && \
yarn playwright --version && \ playwright --version && \
yarn tsc --version && \ tsc --version && \
yarn eslint --version && \ eslint --version && \
yarn prettier --version && \ prettier --version && \
/opt/python-dev-tools/bin/ruff --version && \ /opt/python-dev-tools/bin/ruff --version && \
/opt/python-dev-tools/bin/pyright --version && \ /opt/python-dev-tools/bin/pyright --version && \
/opt/python-dev-tools/bin/pytest --version && \ /opt/python-dev-tools/bin/pytest --version && \

View File

@@ -59,14 +59,13 @@ This project uses a two-stage Docker build approach to optimize CI/CD performanc
- `pre-commit` - Git hook framework - `pre-commit` - Git hook framework
- `yamllint`, `toml-sort` - Configuration file tools - `yamllint`, `toml-sort` - Configuration file tools
**Node.js Tools** (installed globally): **Node.js Tools** (installed globally via npm):
- `@playwright/test` - Playwright testing framework
- `typescript` - TypeScript compiler - `typescript` - TypeScript compiler
- `eslint` - JavaScript/TypeScript linter - `eslint` - JavaScript/TypeScript linter
- `prettier` - Code formatter - `prettier` - Code formatter
- `vite` - Build tool - `vite` - Build tool
- `@types/node` - Node.js type definitions - `@types/node` - Node.js type definitions**Benefits**:
**Benefits**:
- **Compilation Cache**: No more compiling these tools from source - **Compilation Cache**: No more compiling these tools from source
- **Dependency Resolution**: Faster yarn/uv install due to fewer packages - **Dependency Resolution**: Faster yarn/uv install due to fewer packages
- **Network Efficiency**: Less download bandwidth per build - **Network Efficiency**: Less download bandwidth per build

View File

@@ -198,10 +198,10 @@ test_images() {
docker run --rm "$BASE_IMAGE_TAG" node --version && \ docker run --rm "$BASE_IMAGE_TAG" node --version && \
docker run --rm "$BASE_IMAGE_TAG" yarn --version && \ docker run --rm "$BASE_IMAGE_TAG" yarn --version && \
docker run --rm "$BASE_IMAGE_TAG" uv --version && \ docker run --rm "$BASE_IMAGE_TAG" uv --version && \
docker run --rm "$BASE_IMAGE_TAG" yarn playwright --version; then docker run --rm "$BASE_IMAGE_TAG" playwright --version; then
log_success "Base image tests passed (includes Playwright)" log_success "Base image tests passed (includes Playwright via npm)"
# Test that browsers are installed # Test that browsers are installed
if docker run --rm "$BASE_IMAGE_TAG" yarn playwright install --dry-run chromium >/dev/null 2>&1; then if docker run --rm "$BASE_IMAGE_TAG" playwright install --dry-run chromium >/dev/null 2>&1; then
log_success "Playwright browsers verified in base image" log_success "Playwright browsers verified in base image"
else else
log_warning "Playwright browsers may not be fully installed in base image" log_warning "Playwright browsers may not be fully installed in base image"