mirror of
https://github.com/harvard-edge/cs249r_book.git
synced 2026-05-01 18:19:18 -05:00
🏗️ FOLDER NAMING: Standardize to build-quarto-* pattern - docker/quarto-build-linux/ → docker/build-quarto-linux/ - docker/quarto-build-windows/ → docker/build-quarto-windows/ - Emphasizes these are BUILD instructions, not final products 🐳 CONTAINER NAMING: Clean quarto-* pattern - quarto-build-linux → quarto-linux:latest - quarto-build-windows → quarto-windows:latest - Follows Docker Hub conventions (nginx:latest, not nginx-build:latest) 🔧 WORKFLOW FIX: Resolve build-manager-enhanced error - Fixed 'steps.strategy.outputs.workflow' error (Line 280, Col 15) - GitHub Actions doesn't support dynamic workflow paths with 'uses' - Replaced with conditional steps using static workflow references - Now uses proper container builds when available, falls back gracefully 📝 UPDATES: - All workflow files: Updated paths and container names - All Dockerfiles: Updated internal COPY paths - All documentation: Updated references This creates clear separation between build assets and built products while fixing the workflow syntax error that prevented execution.
3.4 KiB
3.4 KiB
Quarto Build Container
This directory contains the Docker container configuration for the MLSysBook build system.
Purpose
The container pre-installs all dependencies to eliminate the 30-45 minute setup time for Linux builds, reducing build times from 45 minutes to 5-10 minutes.
Structure
docker/quarto-build/
├── Dockerfile # Container definition
├── README.md # This file
└── .dockerignore # Files to exclude from build
Container Contents
- Base: Ubuntu 22.04
- TeX Live: Full distribution (texlive-full)
- R: R-base with all required packages
- Python: Python 3.13 with all requirements
- Quarto: Version 1.7.31
- Tools: Inkscape, Ghostscript, fonts
- Dependencies: All from
tools/dependencies/
Build Process
The container is built and tested via GitHub Actions:
# Trigger container build
gh workflow run build-container.yml
Usage
The container is used in the containerized build workflow:
container:
image: ghcr.io/harvard-edge/cs249r_book/quarto-build:latest
options: --user root
Testing
The container build includes 17 comprehensive tests:
- Quarto functionality
- Python packages (all from requirements.txt)
- R packages (all from install_packages.R)
- TeX Live and LaTeX engines
- Inkscape SVG to PDF conversion
- Ghostscript PDF compression
- Fonts and graphics libraries
- Quarto render test
- TikZ compilation test
- System resources check
- Network connectivity
- Book structure compatibility
- Quarto configuration files
- Dependencies files accessibility
- Quarto check (same as workflow)
- Actual build process simulation
- Memory and disk space verification
Registry
- Registry: GitHub Container Registry (ghcr.io)
- Image:
ghcr.io/harvard-edge/cs249r_book/quarto-build - Tags:
latest,main,dev, branch-specific tags - Size: ~2-3GB (includes TeX Live, R, Python packages)
Performance
The container reduces build times significantly:
- Traditional Linux build: 45 minutes (including dependency installation)
- Containerized build: 5-10 minutes (dependencies pre-installed)
- Container size: ~2-3GB (optimized with multi-layer cleanup)
- Build phases: 11 optimized phases with progress tracking
Recent Improvements (2025)
- Fixed dependency path issues after repository restructuring
- Improved error handling and progress tracking
- Optimized TeX Live package installation
- Enhanced cleanup procedures for smaller image size
- Added comprehensive testing (17 test scenarios)
- Fixed PATH environment variables for all tools
Build Phases
- System Dependencies - Core Ubuntu packages and libraries
- Inkscape Installation - SVG to PDF conversion capability
- Quarto Installation - Latest Quarto CLI (v1.7.31)
- TeX Live Installation - Complete LaTeX distribution
- Ghostscript Installation - PDF processing capabilities
- R Installation - R base and development packages
- Python Installation - Python 3 with pip
- Python Packages - All production requirements
- R Packages - All required R libraries
- R Package Verification - Validation of successful installation
- Comprehensive Cleanup - Size optimization and cache clearing
- Traditional build: 45 minutes
- Containerized build: 5-10 minutes
- Improvement: 80-90% time reduction