Skip to content

chore: Custom GitHub runner image with Unreal docker pre-installed#1340

Open
tustanivsky wants to merge 33 commits into
mainfrom
chore/custom-ue-image
Open

chore: Custom GitHub runner image with Unreal docker pre-installed#1340
tustanivsky wants to merge 33 commits into
mainfrom
chore/custom-ue-image

Conversation

@tustanivsky

@tustanivsky tustanivsky commented Apr 14, 2026

Copy link
Copy Markdown
Collaborator

This PR adds custom GitHub runner image generation workflows aimed at reducing CI times. Instead of pulling large Unreal Engine Docker images at the beginning of every job, they are pre-pulled and baked into reusable runner snapshots. As a result, build/test checks can start with the required Docker images already available locally, eliminating image download time and reducing network-related variability.

Custom Image Generation

Three dedicated, single-purpose image-builder workflows are introduced, each producing its own named snapshot:

Workflow Snapshot Builder Runner UE versions
custom-image-windows.yml unreal-image-windows unreal-image-creating-runner-windows 4.27, 5.5-5.8
custom-image-linux.yml unreal-image-linux unreal-image-creating-runner-linux 4.27, 5.2-5.8
custom-image-android.yml unreal-image-android unreal-image-creating-runner-linux 5.4-5.8

Each workflow runs on workflow_dispatch and a weekly schedule. During execution it:

  • Frees up disk space on the builder runner.
  • Authenticates with GHCR.
  • Pulls the required Docker images, logging available disk space after each pull.
  • Verifies that all expected images were pulled successfully.
  • Creates a GitHub Actions custom image snapshot from the prepared environment.

Custom image generation runner specs:

  • 8 CPU cores
  • 32GB RAM
  • 300 GB SSD
  • x64 arch

The set of Unreal Engine versions included in the pre-built images is constrained by the available disk space on the image-generation runners. Priority is given to the three latest engine versions, while UE 4.27 is retained to maintain backward compatibility.

Runners that consume custom images (belong to Large Runners for GDX group):

  • windows-latest-unreal
  • ubuntu-latest-unreal
  • android-latest-unreal

Build Time Optimization

As Unreal sample project packaging now becomes the primary contributor to CI execution time, the following optimizations were introduced to improve its performance:

  • Forced Unreal Build Tool to use all available logical CPU cores for compilation (-UBTArgs="-AllCores").
  • Removed recursive submodule checkout from build jobs.
  • Enable unity build when running checks against PR's branch.

Benchmarks

Per-platform build time comparison before and after integrating custom GitHub runner images and implementing the CI optimizations described above.

Windows

Engine Before Avg After Avg Improvement
4.27 32m 15s 14m 15s ✅ 56% faster (2.26×)
5.5 58m 14s 16m 14s ✅ 72% faster (3.59×)
5.6 51m 23s 16m 51s ✅ 67% faster (3.05×)
5.7 72m 41s 15m 33s ✅ 79% faster (4.67×)
5.8 63m 00s 17m 24s ✅ 72% faster (3.62×)

Linux

Engine Before Avg After Avg Improvement
4.27 18m 05s 11m 43s ✅ 35% faster (1.54×)
5.2 17m 44s 10m 09s ✅ 43% faster (1.75×)
5.3 19m 03s 12m 29s ✅ 34% faster (1.52×)
5.4 22m 46s 14m 16s ✅ 37% faster (1.60×)
5.5 24m 01s 15m 29s ✅ 36% faster (1.55×)
5.6 24m 00s 14m 29s ✅ 40% faster (1.66×)
5.7 23m 10s 14m 29s ✅ 37% faster (1.60×)
5.8 26m 00s 13m 48s ✅ 47% faster (1.88×)

Android

Engine Before Avg After Avg Improvement
5.4 33m 08s 20m 00s ✅ 40% faster (1.66×)
5.5 30m 32s 22m 32s ✅ 26% faster (1.35×)
5.6 31m 55s 22m 51s ✅ 28% faster (1.40×)
5.7 31m 32s 22m 01s ✅ 30% faster (1.43×)
5.8 33m 46s 23m 26s ✅ 31% faster (1.44×)

Estimated Cost

Based on the average build times above, the per-platform test matrix consumes approximately 290 minutes of runner time and costs an estimated $8.16/run ($2.35 Linux + $3.37 Windows + $2.44 Android) on 8-core runners (rates: $0.022/min Linux & Android, $0.042/min Windows - confirm against Actions runner pricing).

In order to further reduce CI execution time and compute costs, the following optimizations were applied:

  • Enabled cancel-in-progress for pull request workflows, ensuring that in-flight jobs are automatically canceled when newer commits are pushed to the same PR. Workflows running on main and release branches continue to run to completion regardless of subsequent commits.
  • Split the test job matrix so that pull requests run a reduced set of engine versions (UE 4.27 plus the three latest Unreal Engine releases) while full coverage across all supported versions is retained for main and release branch workflows.

With these changes in place, the pull-request test matrix (the most common execution path) drops to approximately 190 minutes of runner time, an estimated $5.44/run ($1.26 Linux + $2.68 Windows + $1.50 Android).

#skip-changelog

@github-actions

github-actions Bot commented Apr 14, 2026

Copy link
Copy Markdown
Contributor

Semver Impact of This PR

🟢 Patch (bug fixes)

📋 Changelog Preview

This is how your changes will appear in the changelog.
Entries from this PR are highlighted with a left border (blockquote style).


Bug Fixes 🐛

  • Prevent potential script injection in crash-reporter-build workflow by fix-it-felix-sentry in #1324

Internal Changes 🔧

Deps

  • Update Native SDK to v0.13.6 by github-actions in #1339
  • Update Android Gradle Plugin to v6.4.0 by github-actions in #1338
  • Update Cocoa SDK to v9.10.0 by github-actions in #1335
  • Update Java SDK to v8.38.0 by github-actions in #1336
  • Update Native SDK to v0.13.5 by github-actions in #1334
  • Update Cocoa SDK to v9.9.0 by github-actions in #1332
  • Update CLI to v3.3.5 by github-actions in #1323

Other

  • Custom GitHub runner image with Unreal docker pre-installed by tustanivsky in #1340
  • Update validate-pr workflow by stephanie-anderson in #1328

Other

  • Fix intermittent crash when capturing screenshots due to invalid viewport by tustanivsky in #1331
  • Suppress superfluous warnings when detecting for SteamOS by yangskyboxlabs in #1326
  • Add out-of-process screenshot capturing on Windows by tustanivsky in #1325

🤖 This preview updates automatically when you update the PR.

@tustanivsky tustanivsky changed the title Add consent-aware offline caching chore: Custom GitHub runner image with Unreal docker pre-installed Apr 14, 2026
@tustanivsky tustanivsky force-pushed the chore/custom-ue-image branch from 4880a84 to c6300ce Compare June 10, 2026 12:39
@tustanivsky tustanivsky force-pushed the chore/custom-ue-image branch from b1c447a to 8c5dfb4 Compare June 15, 2026 08:12
Comment thread .github/workflows/custom-image-linux.yml
@linear-code

linear-code Bot commented Jun 24, 2026

Copy link
Copy Markdown

DI-2071

DI-2071

@tustanivsky tustanivsky marked this pull request as ready for review June 24, 2026 18:10
Comment thread .github/workflows/custom-image-android.yml Outdated

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Want reviews to match your repository better? Bugbot Learning can learn team-specific rules from PR activity. A team admin can enable Learning in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit f4a303d. Configure here.

Comment thread .github/workflows/test-linux.yml
Comment thread .github/workflows/ci.yml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant