Building from Source¶
This guide covers building Bazzite AI components locally.
Prerequisites¶
- Just task runner installed (
brew install justorcargo install just) - Podman or Docker for container builds
- Git for source control
Building the OS Image¶
# Navigate to repository
cd bazzite-ai
# Build OS image with default tag (stable)
just build
# Build with custom tag
just build my-tag
# Build bootable ISO
just build-iso
Output Locations¶
| Build | Output |
|---|---|
| OS Image | Pushed to GHCR (if configured) |
| ISO | output/bootiso/ |
Building Pods¶
Single Pod¶
# Build specific variant
just pod build nvidia-python
# With custom tag
just pod build nvidia-python my-tag
All Pods¶
Available Pod Variants¶
base- CPU-only foundationnvidia- CUDA/cuDNNnvidia-python- PyTorch MLjupyter- JupyterLabdevops- Cloud toolsplaywright- Browser automationgithubrunner- CI/CD
Cache Control¶
# Rebuild without cache
just rebuild-pod my-tag none
# Use local cache only
just rebuild-pod my-tag local
# Use all caches (default)
just rebuild-pod my-tag all
Building Documentation¶
# Build documentation site
just docs-build
# Serve locally for preview
just docs-serve
# Open http://localhost:8000
Documentation System¶
- Engine: MkDocs Material
- Source:
docs/directory - Output:
site/directory - Config:
mkdocs.yml
Pixi Lock Files¶
For pods using pixi (nvidia-python, jupyter, playwright):
# Generate lock file for specific variant
just generate-pixi-lock nvidia-python
# Generate all lock files
just generate-pixi-locks
Testing Builds¶
Test Pod¶
# Test CUDA access
just test-cuda-pod my-tag
# Test DevOps tools
just test-devops-pod my-tag
# Test GitHub runner
just test-githubrunner-pod my-tag
Test OS Changes¶
Use overlay testing for rapid iteration:
# Enable overlay (symlinks system_files to /usr)
just test overlay enable
# Test your changes
ujust <your-command>
# Disable overlay
just test overlay disable
Buildcache Architecture¶
Bazzite AI uses a unified buildcache strategy for efficiency:
Cache Layers¶
The Containerfile is organized for maximum cache efficiency:
- Stable layers (packages, tools) - Rarely change
- Moderate layers (configurations) - Occasional changes
- Volatile layers (system_files) - Frequent changes
Changing a script only invalidates subsequent layers.
CI/CD Integration¶
GitHub Actions workflows:
| Workflow | Trigger | Action |
|---|---|---|
ci-validate.yml | PR, Push | Run pre-commit, validate syntax |
build-os.yml | Release, Manual | Build and push OS image |
build-pods.yml | Release, Manual | Build and push all pods |
docs.yml | Push to main | Deploy documentation |
Common Tasks¶
Add a Package to OS¶
- Edit appropriate script in
build_files/os/orbuild_files/shared/ - Test with overlay:
just test overlay enable - Rebuild:
just build
Add a Tool to a Pod¶
- Edit
pods/<variant>/Containerfileor build scripts - Update pixi.toml if using pixi
- Rebuild:
just pod build <variant> - Test:
podman run -it ghcr.io/atrawog/bazzite-ai-pod-<variant>:latest
Update Dependencies¶
# Regenerate pixi lock files
just generate-pixi-locks
# Commit updated locks
git add pods/*/pixi.lock
git commit -m "Chore: Update pixi lock files"
Troubleshooting¶
Build Fails: "No space left"¶
# Clean podman storage
podman system prune -a
# Or clean specific images
podman rmi $(podman images -q)
Build Fails: "Permission denied"¶
Ensure you're running as your user, not root:
Cache Not Working¶
Documentation Build Fails¶
See Also¶
- Pod Architecture - Pod inheritance and build system
- OS Architecture - Immutable OS structure
- CLAUDE.md - Development policies