Files
Vijay Janapa Reddi 5a66c935f1 Fix book build failures and harden book checks
- Vol II: close the margin note wrapping the storage-compute figure,
  move the bandwidth figure out of its callout, and separate the NPU
  figure from the preceding footnote so all three cross-references
  resolve; widen Table 11.3 so it stays inside the page trim.
- Landing pages: hide the download card, star counter, and podcast from
  EPUB output and point the cover and podcast at shared/assets.
- Vol I/II frontmatter image paths, table column widths, Vol III
  equation labels, Vol IV lint fixes and SVG newline repairs, and
  regenerated volume bibliographies.
- Bibliography integrity scan ignores math spans; currency check skips
  render caches; Prentice Hall joins the canonical publisher list.
- Unprefixed chapter URLs publish redirect stubs to numbered pages.
- Remove stray test files, duplicate quiz files, unused cover options,
  generated figure lists, and outdated review scripts; drop generator
  metadata from quiz files.
- Repoint documentation at current chapter paths and deduplicate
  pre-commit file patterns.
2026-09-12 09:17:53 +02:00

110 lines
3.4 KiB
Markdown

# 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.9.27
- **Tools**: Inkscape, Ghostscript, fonts
- **Dependencies**: All from `tools/dependencies/`
## Build Process
The container is built and tested via GitHub Actions:
```bash
# Trigger container build
gh workflow run build-container.yml
```
## Usage
The container is used in the containerized build workflow:
```yaml
container:
image: ghcr.io/harvard-edge/cs249r_book/quarto-build:latest
options: --user root
```
## Testing
The container build includes 17 comprehensive tests:
1. Quarto functionality
2. Python packages (all from requirements.txt)
3. R packages (all from install_packages.R)
4. TeX Live and LaTeX engines
5. Inkscape SVG to PDF conversion
6. Ghostscript PDF compression
7. Fonts and graphics libraries
8. Quarto render test
9. TikZ compilation test
10. System resources check
11. Network connectivity
12. Book structure compatibility
13. Quarto configuration files
14. Dependencies files accessibility
15. Quarto check (same as workflow)
16. Actual build process simulation
17. 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
1. **System Dependencies** - Core Ubuntu packages and libraries
2. **Inkscape Installation** - SVG to PDF conversion capability
3. **Quarto Installation** - Latest Quarto CLI (v1.9.27)
4. **TeX Live Installation** - Complete LaTeX distribution
5. **Ghostscript Installation** - PDF processing capabilities
6. **R Installation** - R base and development packages
7. **Python Installation** - Python 3 with pip
8. **Python Packages** - All production requirements
9. **R Packages** - All required R libraries
10. **R Package Verification** - Validation of successful installation
11. **Comprehensive Cleanup** - Size optimization and cache clearing
- **Traditional build**: 45 minutes
- **Containerized build**: 5-10 minutes
- **Improvement**: 80-90% time reduction