|
| 1 | +# VC3D CI dependencies |
| 2 | + |
| 3 | +Prebuilt build environments for `ScrollPrize/villa`'s |
| 4 | +`volume-cartographer` (VC3D) CI jobs. |
| 5 | + |
| 6 | +Installing Qt, OpenCV, Ceres, CGAL, LLVM, and the sparse-solver stack is the |
| 7 | +slowest part of a clean VC3D build. This repository installs those dependencies |
| 8 | +once and publishes three platform-specific artifacts to GHCR: |
| 9 | + |
| 10 | +| Target | Published artifact | How CI uses it | |
| 11 | +| --- | --- | --- | |
| 12 | +| Ubuntu 26.04, amd64 | `ghcr.io/scrollprize/vc3d-deps/linux:ubuntu-26.04` | Docker builder image | |
| 13 | +| Windows, amd64 | `ghcr.io/scrollprize/vc3d-deps/windows:ucrt64` | MSYS2/UCRT64 snapshot (`.7z`) | |
| 14 | +| macOS 15, arm64 | `ghcr.io/scrollprize/vc3d-deps/macos:15-arm64` | Homebrew dependency snapshot (`.tar.zst`) | |
| 15 | + |
| 16 | +The moving platform tags above are convenient for PR CI. Every publication is |
| 17 | +also tagged `sha-<commit>` so release jobs can pin an immutable input. For full |
| 18 | +reproducibility, resolve and pin an OCI digest rather than a moving tag. |
| 19 | + |
| 20 | +## Publishing |
| 21 | + |
| 22 | +Each platform has a separate workflow. A push to `main` publishes only the |
| 23 | +platform whose manifest, build script, or workflow changed. All three workflows |
| 24 | +also support manual dispatch. |
| 25 | + |
| 26 | +The repository package must be visible to `ScrollPrize/villa`, and the consuming |
| 27 | +job needs `packages: read`. Publishing jobs use the repository `GITHUB_TOKEN` |
| 28 | +and need `packages: write`; no long-lived registry credential is required. |
| 29 | + |
| 30 | +## Consuming from `villa` |
| 31 | + |
| 32 | +### Linux |
| 33 | + |
| 34 | +The existing `volume-cartographer/scripts/ci.sh` can pull and run the image, or |
| 35 | +the job can use it directly: |
| 36 | + |
| 37 | +```yaml |
| 38 | +permissions: |
| 39 | + contents: read |
| 40 | + packages: read |
| 41 | + |
| 42 | +jobs: |
| 43 | + build: |
| 44 | + runs-on: ubuntu-24.04 |
| 45 | + container: |
| 46 | + image: ghcr.io/scrollprize/vc3d-deps/linux:ubuntu-26.04 |
| 47 | + credentials: |
| 48 | + username: ${{ github.actor }} |
| 49 | + password: ${{ secrets.GITHUB_TOKEN }} |
| 50 | + steps: |
| 51 | + - uses: actions/checkout@v4 |
| 52 | + - working-directory: volume-cartographer |
| 53 | + run: | |
| 54 | + cmake --preset ci-release-tests-gcc -DVC_USE_CCACHE=ON |
| 55 | + ninja -C build/ci-release-tests-gcc |
| 56 | + ctest --preset ci-release-tests-gcc |
| 57 | +``` |
| 58 | +
|
| 59 | +### Windows |
| 60 | +
|
| 61 | +Pull the snapshot with ORAS, restore it, then run the build with the included |
| 62 | +MSYS2 Bash. There is no package installation in the consuming job. |
| 63 | +
|
| 64 | +```yaml |
| 65 | +permissions: |
| 66 | + contents: read |
| 67 | + packages: read |
| 68 | + |
| 69 | +steps: |
| 70 | + - uses: actions/checkout@v4 |
| 71 | + - uses: actions/checkout@v4 |
| 72 | + with: |
| 73 | + repository: ScrollPrize/vc3d-deps |
| 74 | + path: vc3d-deps |
| 75 | + - uses: oras-project/setup-oras@v1 |
| 76 | + - shell: pwsh |
| 77 | + env: |
| 78 | + GHCR_TOKEN: ${{ github.token }} |
| 79 | + run: | |
| 80 | + $env:GHCR_TOKEN | oras login ghcr.io -u '${{ github.actor }}' --password-stdin |
| 81 | + oras pull ghcr.io/scrollprize/vc3d-deps/windows:ucrt64 -o $env:RUNNER_TEMP |
| 82 | + & .\vc3d-deps\windows\restore.ps1 ` |
| 83 | + -Archive "$env:RUNNER_TEMP\vc3d-windows-ucrt64.7z" |
| 84 | + - name: Configure, build, and test |
| 85 | + working-directory: volume-cartographer |
| 86 | + shell: C:\msys64\usr\bin\bash.exe -leo pipefail {0} |
| 87 | + env: |
| 88 | + MSYSTEM: UCRT64 |
| 89 | + CHERE_INVOKING: '1' |
| 90 | + PATH: C:\msys64\ucrt64\bin;C:\msys64\usr\bin;${{ env.PATH }} |
| 91 | + run: | |
| 92 | + cmake --preset ci-windows-mingw -DVC_USE_CCACHE=ON |
| 93 | + ninja -C build/ci-windows-mingw |
| 94 | + ctest --test-dir build/ci-windows-mingw --output-on-failure |
| 95 | +``` |
| 96 | +
|
| 97 | +The example assumes this repository is checked out at `vc3d-deps`, for example |
| 98 | +with `actions/checkout`'s `repository` and `path` inputs. |
| 99 | + |
| 100 | +### macOS |
| 101 | + |
| 102 | +The macOS snapshot is tied to the runner image and architecture in its tag. |
| 103 | +Restore it only on `macos-15` arm64 runners. |
| 104 | + |
| 105 | +```yaml |
| 106 | +permissions: |
| 107 | + contents: read |
| 108 | + packages: read |
| 109 | +
|
| 110 | +steps: |
| 111 | + - uses: actions/checkout@v4 |
| 112 | + - uses: actions/checkout@v4 |
| 113 | + with: |
| 114 | + repository: ScrollPrize/vc3d-deps |
| 115 | + path: vc3d-deps |
| 116 | + - uses: oras-project/setup-oras@v1 |
| 117 | + - shell: bash |
| 118 | + env: |
| 119 | + GHCR_TOKEN: ${{ github.token }} |
| 120 | + run: | |
| 121 | + printf '%s' "$GHCR_TOKEN" | oras login ghcr.io -u '${{ github.actor }}' --password-stdin |
| 122 | + oras pull ghcr.io/scrollprize/vc3d-deps/macos:15-arm64 -o "$RUNNER_TEMP" |
| 123 | + vc3d-deps/macos/restore.sh "$RUNNER_TEMP/vc3d-macos-15-arm64.tar.zst" |
| 124 | + - working-directory: volume-cartographer |
| 125 | + run: ./scripts/build_macos.sh --ccache |
| 126 | +``` |
| 127 | + |
| 128 | +The restore helper adds the captured formula closure to Homebrew's standard |
| 129 | +Apple Silicon prefix, `/opt/homebrew`, and relinks it. It refuses to run on the |
| 130 | +wrong OS, architecture, or prefix. `HOMEBREW_NO_AUTO_UPDATE=1` should remain set |
| 131 | +in the build job. |
| 132 | + |
| 133 | +## Updating dependencies |
| 134 | + |
| 135 | +- Linux packages: edit `linux/install-deps.sh`. |
| 136 | +- Windows packages: edit `windows/packages.txt`. |
| 137 | +- macOS formulae: edit `macos/formulae.txt`. |
| 138 | + |
| 139 | +Keep these lists synchronized with VC3D's CMake configuration and packaging |
| 140 | +requirements. Open a PR here first, let the new artifacts publish from `main`, |
| 141 | +then update `villa` to consume the new immutable tag or digest. |
| 142 | + |
| 143 | +## Why Windows and macOS are archives |
| 144 | + |
| 145 | +[GitHub Actions container actions run only on Linux][container-actions]. GitHub |
| 146 | +offers [custom VM images][custom-images] for larger Linux and Windows runners, |
| 147 | +but not macOS, and the current `villa` workflows use standard hosted runners. |
| 148 | +Native filesystem snapshots preserve the toolchains needed by NSIS and |
| 149 | +`macdeployqt` without changing those runner types. |
| 150 | + |
| 151 | +[container-actions]: https://docs.github.com/actions/concepts/workflows-and-actions/custom-actions#docker-container-actions |
| 152 | +[custom-images]: https://docs.github.com/actions/how-tos/manage-runners/larger-runners/use-custom-images |
0 commit comments