Showcase
How ambientCG builds 40,000 downloadable files with Dagu
ambientCG publishes about 2,800 CC0 materials, HDRIs and 3D models as roughly 40,000 ZIP files, all built by Dagu pipelines. The same pipelines add each new asset, rebuild the library for new releases, and run in CI as tests.
Built by ambientCG / Lennart Demes ·
All downloadable files along with preview media are built using several different Dagu pipelines…
- downloads a month
- 4M+
- CC0 assets
- ~2,800
- ZIP files built by Dagu
- ~40,000
- steps in the longest pipeline
- 22
The problem
Lennart Demes started ambientCG in 2018 to publish free 3D textures. It has grown into one of the largest CC0 libraries of PBR materials, HDRIs and 3D models, with several hundred thousand unique visitors a month.
Each asset is offered in many resolutions, with ready-to-use files for common 3D programs, which adds up to about 40,000 ZIP files. Adding one asset means building all of its ZIPs, and a release with new features means rebuilding the whole library.
How it's built
Everything a build needs lives in one Docker container: Dagu, PowerShell Core for the scripts, Blender, OpenUSD and other tools.
The same pipelines run in three places:
- New assets, on Lennart's workstation. He runs Dagu in Docker Desktop to build each asset as he adds it.
- Full rebuilds, on a dedicated laptop. When a release adds new features, the same pipeline rebuilds the whole library over several days.
- Pipeline tests, in GitHub Actions. The pipeline has its own CI: a GitHub Actions job runs Dagu on test builds to check that assets still build after a change to a PowerShell script or a DAG.
The surface pipeline
Lennart's surface pipeline, redrawn from a screenshot of its graph in Dagu's web UI:
One material, as built
What made it work
- No servers to run. Dagu is one binary that keeps its state in files, so the whole build system fits in one Docker image with nothing else to set up. The same pipelines run on Lennart's workstation, on a laptop for full rebuilds, and in GitHub Actions.
- Existing tools as steps. The steps call PowerShell scripts, Blender, OpenUSD and other tools. Steps that don't depend on each other can run at the same time, like the four programs' files in the surface pipeline.
- A failed check stops the build. In Dagu, the steps that depend on a failed step don't run. Both exports depend on the test steps, so a file that fails its test isn't exported.
- The pipeline is tested before it runs. Dagu needs no server, so the pipeline's own CI runs it in GitHub Actions and checks that assets still build after a change to a script or a DAG.
Numbers and pipeline from Lennart Demes and ambientCG.com.
Dagu is one binary with no database. It runs next to your scripts, on whatever machine you have.