Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add 'uet cmake' command to distribute CMake-based builds over UBA #34

Merged
merged 7 commits into from
Dec 25, 2024

Conversation

hach-que
Copy link
Member

@hach-que hach-que commented Oct 31, 2024

This adds a uet cmake command which can be used to distribute CMake-based builds with the Unreal Build Accelerator and Kubernetes. This is mostly useful to rapidly build the Clang compiler.

image

Running uet cmake --help will also give you the "how to use it" information described below.

Prerequisites

Before you can distribute builds, you must configure your BuildConfiguration.xml file located at %appdata%\Unreal Engine\UnrealBuildTool\BuildConfiguration.xml with the settings to connect to the Kubernetes cluster. The Kubernetes cluster must have Windows nodes in it. You can use RKM (https://src.redpoint.games/redpointgames/rkm) to spin up a Kubernetes cluster with Windows nodes with a single command.

<?xml version="1.0" encoding="utf-8"?>
<Configuration xmlns="https://www.unrealengine.com/BuildConfiguration">
  <Kubernetes>
    <Namespace>default</Namespace>
    <Context>defafult</Context>
    <SmbServer>10.0.0.100</SmbServer>
    <SmbShare>ShareName</SmbShare>
    <SmbUsername>Domain\Username</SmbUsername>
    <SmbPassword>Password</SmbPassword>
  </Kubernetes>
</Configuration>

The 'Smb' settings specify a network share that all Windows nodes can access as the specified user. The Unreal Build Accelerator will be copied to this share and the containers will copy from this network share.

Your kubectl configuration must be connected to the cluster already, as per the 'Context' setting. You can get the context name by running kubectl config get-contexts. The 'Namespace' setting specifies what Kubernetes namespace to launch UBA agents into.

Using it

To distribute builds, you must first generate your CMake project using:

uet cmake -- ...

You should omit -G; this command will automatically select the Ninja project generator which is required to distribute builds.

Once you've generated your project, you can distribute the build using:

uet cmake -e 5.4 -- --build ...

NOTE: You must use Unreal Engine 5.4 at this time. Refer to #112 which tracks Unreal Engine 5.5 support.

The presence of --build in the CMake arguments is what this tool uses to determine whether CMake is generating project files or running the build. You only need to specify -e as an argument to this command when running the build; it is not necessary during generation.

All arguments past the -- are forwarded to CMake intact. CMake must be on your PATH or installed as part of Visual Studio 2022 Community in it's default installation location.

@hach-que hach-que added migrated from gitlab Migrated from GitLab back burner No ETA on resolution labels Oct 31, 2024
@hach-que hach-que changed the title Use DOTNET_STARTUP_HOOKS and Harmony to hotpatch UBT and UAT, and add support for Kubernetes-based UBA Add internal commands for running CMake builds over UBA Oct 31, 2024
@hach-que hach-que changed the title Add internal commands for running CMake builds over UBA Add 'uet cmake' command to distribute CMake-based builds over UBA Dec 25, 2024
@hach-que hach-que removed the back burner No ETA on resolution label Dec 25, 2024
@hach-que hach-que merged commit 2e3e7dd into main Dec 25, 2024
21 checks passed
@hach-que hach-que deleted the cmake-uba branch December 25, 2024 00:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
migrated from gitlab Migrated from GitLab
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant