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

ci: heavy linux workload on ubuntu-latest-4-cores #658

Merged
merged 22 commits into from
Oct 31, 2024

Conversation

bruno-garcia
Copy link
Member

@bruno-garcia bruno-garcia commented Oct 14, 2024

Also fixes #473 (comment)

image

Looking at the large runner here, looks like we need to use the right name

#skip-changelog

@bruno-garcia
Copy link
Member Author

Status: Downloaded newer image for ghcr.io/epicgames/unreal-engine:dev-slim-5.4.1
29d835b3ddc370bc69d060b9993670e0e890fc1a2313a49416fe5c09f66844c8
+ docker logout ghcr.io
Removing login credentials for ghcr.io
+ docker exec --user root unreal useradd -u 1000 -g 1000 --create-home gh
useradd: UID 1000 is not unique
Error: Process completed with exit code 4.

@tustanivsky any idea what's up?

@bruno-garcia
Copy link
Member Author

A problem I see already is that it'll run the build in series. Since we have 1 agent, and 3 parallel builds for it.

@vaind vaind marked this pull request as draft October 16, 2024 08:41
@tustanivsky
Copy link
Collaborator

Status: Downloaded newer image for ghcr.io/epicgames/unreal-engine:dev-slim-5.4.1
29d835b3ddc370bc69d060b9993670e0e890fc1a2313a49416fe5c09f66844c8
+ docker logout ghcr.io
Removing login credentials for ghcr.io
+ docker exec --user root unreal useradd -u 1000 -g 1000 --create-home gh
useradd: UID 1000 is not unique
Error: Process completed with exit code 4.

@tustanivsky any idea what's up?

After investigating this for a while I've figured out that there are some differences between the standard and large GitHub runners in terms of user configuration. On both of them we run agent on behalf of runner user however it has different UIDs:

  • 1001 on standard runner:
$ cat /etc/passwd
...
runneradmin:x:1000:1000:Ubuntu:/home/runneradmin:/bin/bash
runner:x:1001:122:,,,:/home/runner:/bin/bash
  • 1000 on large runner:
$ cat /etc/passwd
...
runner:x:1000:1000:Ubuntu:/home/runner:/bin/bash

At the same time UE docker container provided by Epic Games already has a ue4 user with UID 1000 which causes the above error when we're running the following command:

docker exec --user root unreal useradd -u $uid -g $gid --create-home $user

This step is required to install UE4 CLI that we're using later on to build the plugin and run tests. Since it's just a convenience utility for us I'll see if we can get rid of it and use the Unreal's build tools directly to avoid dealing with that matching UIDs issue.

@@ -126,7 +126,7 @@ jobs:

test:
name: Test UE ${{ matrix.unreal }}
runs-on: ubuntu-latest
runs-on: ubuntu-latest-4-cores-arm64
Copy link
Member Author

Choose a reason for hiding this comment

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

@bitsandfoxes should we make this a matrix instead? So it runs on both 4-cores and 4-cores-arm64?

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh actually that won't work because there are not arm64 docker images for UE?

WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested

Copy link
Collaborator

Choose a reason for hiding this comment

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

There's no official arm64 docker images for UE so it won't work (for now at least). However we may utilize our new arm64-runner for the future CI pipeline improvements (#575) and proper support of this arch (#473)

Copy link
Collaborator

@tustanivsky tustanivsky left a comment

Choose a reason for hiding this comment

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

Removing ue4cli usages from the existing workflow spared us from creating additional user in docker container and allowed to avoid UIDs collision problem entirely.

Also, with this large GitHub runner we now can package the sample app in CI for all three UE version within a reasonable amount of time and without a risk to run out of space.

@tustanivsky
Copy link
Collaborator

@bruno-garcia Are there any additional changes required within the scope of this PR beyond the introduction of the ubuntu-latest-4-cores runner to our CI pipeline?

Comment on lines +216 to +237
docker exec -w /workspace/checkout/${{ matrix.app }} unreal /home/ue4/UnrealEngine/Engine/Build/BatchFiles/RunUAT.sh BuildCookRun \
-project=/workspace/checkout/${{ matrix.app }}/SentryPlayground.uproject \
-archivedirectory=/workspace/checkout/${{ matrix.app }}/Builds \
-platform=Linux \
-nop4 \
-cook \
-build \
-stage \
-prereqss \
-package \
-archive
docker exec -w /workspace/checkout/${{ matrix.app }} unreal bash -c "
cp -r '/home/ue4/Library/Logs/Unreal Engine/LocalBuildLogs' Saved/Logs "
docker exec -w /workspace/checkout/${{ matrix.app }} unreal /home/ue4/UnrealEngine/Engine/Binaries/Linux/UnrealEditor \
/workspace/checkout/${{ matrix.app }}/SentryPlayground.uproject \
-ReportExportPath=/workspace/checkout/${{ matrix.app }}/Saved/Automation \
-ExecCmds="Automation RunTests Sentry;quit" \
-TestExit="Automation Test Queue Empty" \
-Unattended \
-NoPause \
-NoSplash \
-NullRHI
-NullRHI
Copy link
Contributor

@bitsandfoxes bitsandfoxes Oct 29, 2024

Choose a reason for hiding this comment

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

Could you explain what's going on here? If I read that right:

  1. We're first building the project via the RunUAT.sh but with all the flags.
  2. We're copying some logs to somewhere else
  3. We're running some tests but from within the Editor

Do I get that right?

Copy link
Collaborator

@tustanivsky tustanivsky Oct 29, 2024

Choose a reason for hiding this comment

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

Yes, that's correct.

The ue4cli tool handled all the flags internally so the corresponding command looked cleaner but since we had to get rid of it, we now must specify them explicitly.

Caching build logs can be useful if some issues during the sample packaging arise. This step was moved here as it has finally become possible for all supported UE versions (and not only for 4.27 as previously) to complete the packaging without the risk of running out of disk space.

To run tests we need the Editor executable, it's a common syntax for the corresponding command.

@bitsandfoxes bitsandfoxes marked this pull request as ready for review October 29, 2024 14:18
@bitsandfoxes
Copy link
Contributor

Merging this to move forward on it.

@bitsandfoxes bitsandfoxes merged commit 3055132 into main Oct 31, 2024
15 checks passed
@bitsandfoxes bitsandfoxes deleted the bruno-garcia-patch-1 branch October 31, 2024 12:03
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.

arm64 support
3 participants