Skip to content

Commit fdbfd33

Browse files
authored
0.8.0-preview (#83)
0.8.0-preview
2 parents 1f8e984 + cc2b1fe commit fdbfd33

File tree

11 files changed

+199
-76
lines changed

11 files changed

+199
-76
lines changed

.buildkite/nightly.steps.yaml

Lines changed: 29 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
script_runner: &script_runner
2+
agents:
3+
- "agent_count=8"
4+
- "capable_of_building=platform"
5+
- "environment=production"
6+
- "machine_type=quarter"
7+
- "permission_set=builder"
8+
- "platform=linux"
9+
- "queue=${CI_LINUX_BUILDER_QUEUE:-v3-1572524284-e64831bf1e88b227-------z}"
10+
- "scaler_version=2"
11+
- "working_hours_time_zone=london"
12+
113
common: &common
214
agents:
315
- "agent_count=1"
@@ -7,7 +19,7 @@ common: &common
719
- "permission_set=builder"
820
- "platform=windows"
921
- "scaler_version=2"
10-
- "queue=${CI_WINDOWS_BUILDER_QUEUE:-v3-1569490589-f9345a43b21a6cec-------z}"
22+
- "queue=${CI_WINDOWS_BUILDER_QUEUE:-v4-2019-11-07-bk3700-fbffad576b9676d7}" # Has FASTbuild disabled
1123
timeout_in_minutes: 60 # TODO(ENG-548): reduce timeout once agent-cold-start is optimised.
1224
retry:
1325
automatic:
@@ -17,9 +29,21 @@ common: &common
1729
plugins:
1830
- ca-johnson/taskkill#v4.1: ~
1931

32+
# NOTE: step labels turn into commit-status names like {org}/{repo}/{pipeline}/{step-label}, lower-case and hyphenated.
33+
# These are then relied on to have stable names by other things, so once named, please beware renaming has consequences.
34+
2035
steps:
21-
- label: "build-and-deploy-:windows:"
22-
command: powershell -NoProfile -NonInteractive -InputFormat Text -Command ./ci/setup-and-build.ps1
36+
- label: "generate-pipeline-steps"
37+
commands:
38+
- "chmod -R +rwx ci"
39+
- "ci/generate-pipeline-steps.sh"
40+
env:
41+
ENGINE_VERSION: "${ENGINE_VERSION}"
42+
<<: *script_runner
43+
44+
- wait
45+
46+
- label: "slack-notify"
47+
if: build.env("SLACK_NOTIFY") == "true" || build.branch == "master"
48+
command: "powershell -NoProfile -NonInteractive -InputFormat Text -Command ./ci/slack-notify.ps1"
2349
<<: *common # This folds the YAML named anchor into this step. Overrides, if any, should follow, not precede.
24-
artifact_paths:
25-
- "UnrealEngine/Engine/Programs/AutomationTool/Saved/Logs/*"
-2.79 KB
Binary file not shown.
-1.14 KB
Binary file not shown.

Game/Source/GDKShooter/Private/Controllers/GDKPlayerController.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@ void AGDKPlayerController::BeginPlay()
5858

5959
void AGDKPlayerController::Tick(float DeltaTime)
6060
{
61+
Super::Tick(DeltaTime);
62+
6163
if (GetPawn())
6264
{
6365
LatestPawnYaw = GetPawn()->GetActorRotation().Yaw;

Game/Source/GDKShooter/Public/Game/Components/DeathmatchSpawnerComponent.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ class GDKSHOOTER_API UDeathmatchSpawnerComponent : public UActorComponent
2626
UFUNCTION(BlueprintCallable)
2727
void DisableSpawning() { bSpawningEnabled = false; }
2828

29+
UFUNCTION(BlueprintCallable)
30+
bool IsSpawningEnabled() { return bSpawningEnabled; }
31+
2932
protected:
3033
AActor* GetSpawnPoint(APlayerController* Controller);
3134

Game/Source/GDKShooter/Public/Game/Components/TimerComponent.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ class GDKSHOOTER_API UTimerComponent : public UActorComponent
4343
UPROPERTY(EditDefaultsOnly)
4444
bool bAutoStart = false;
4545
UPROPERTY(EditDefaultsOnly)
46-
int32 DefaultTimerDuration = 300;
46+
int32 DefaultTimerDuration = 7200;
4747

4848
UPROPERTY(Replicated, BlueprintReadOnly)
4949
bool bIsTimerRunning = false;

ci/deploy.ps1

Lines changed: 7 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ param(
88
Start-Event "deploy-game" "build-unreal-gdk-example-project-:windows:"
99
# Use the shortened commit hash gathered during GDK plugin clone and the current date and time to distinguish the deployment
1010
$date_and_time = Get-Date -Format "MMdd_HHmm"
11-
$deployment_name = "exampleproject_${date_and_time}_$($gdk_commit_hash)"
11+
$deployment_name = "exampleproject$($env:STEP_NUMBER)_${date_and_time}_$($gdk_commit_hash)"
1212
$assembly_name = "$($deployment_name)_asm"
1313

1414
pushd "spatial"
@@ -66,74 +66,21 @@ pushd "spatial"
6666
"--snapshot=$deployment_snapshot_path", `
6767
"--cluster_region=$deployment_cluster_region", `
6868
"--log_level=debug", `
69-
"--tags=ttl_1_hours"
69+
"--tags=ttl_1_hours", `
70+
"--deployment_description=`"Engine commit: $($env:ENGINE_COMMIT_HASH)`"" `
7071
)
7172

7273
if ($launch_deployment_process.ExitCode -ne 0) {
7374
Write-Log "Failed to launch a Spatial cloud deployment. Error: $($launch_deployment_process.ExitCode)"
7475
Throw "Deployment launch failed"
7576
}
7677

77-
# Send a Slack notification with a link to the new deployment and to the build.
78-
# Read Slack webhook secret from the vault and extract the Slack webhook URL from it.
79-
$slack_webhook_secret = "$(imp-ci secrets read --environment=production --buildkite-org=improbable --secret-type=slack-webhook --secret-name=unreal-gdk-slack-web-hook)"
80-
$slack_webhook_url = $slack_webhook_secret | ConvertFrom-Json | %{$_.url}
81-
82-
$deployment_url = "https://console.improbable.io/projects/${project_name}/deployments/${deployment_name}/overview"
83-
$gdk_commit_url = "https://github.com/spatialos/UnrealGDK/tree/${gdk_commit_hash}"
84-
$build_url = "$env:BUILDKITE_BUILD_URL"
85-
86-
$json_message = [ordered]@{
87-
text = "Example Project build created by $env:BUILDKITE_BUILD_CREATOR succeeded and a deployment has been launched."
88-
attachments= @(
89-
@{
90-
fallback = "Find deployment here: $deployment_url and build here: $build_url"
91-
color = "good"
92-
fields= @(
93-
@{
94-
title = "GDK branch"
95-
value = "$gdk_branch_name"
96-
short = "true"
97-
}
98-
@{
99-
title = "Example Project branch"
100-
value = "$env:BUILDKITE_BRANCH"
101-
short = "true"
102-
}
103-
)
104-
actions= @(
105-
@{
106-
type = "button"
107-
text = "Take me to the deployment"
108-
url = "$deployment_url"
109-
style = "primary"
110-
}
111-
@{
112-
type = "button"
113-
text = "Take me to the GDK commit"
114-
url = "$gdk_commit_url"
115-
style = "primary"
116-
}
117-
@{
118-
type = "button"
119-
text = "Take me to the build"
120-
url = "$build_url"
121-
style = "primary"
122-
}
123-
)
124-
}
125-
)
126-
}
127-
128-
$json_request = $json_message | ConvertTo-Json -Depth 10
129-
130-
Invoke-WebRequest -UseBasicParsing "$slack_webhook_url" -ContentType "application/json" -Method POST -Body "$json_request"
131-
132-
}
133-
else {
78+
buildkite-agent meta-data set "deployment-name-$($env:STEP_NUMBER)" "$deployment_name"
79+
buildkite-agent meta-data set "project-name" "$project_name"
80+
buildkite-agent meta-data set "gdk-commit-hash" "$gdk_commit_hash)"
81+
} else {
13482
Write-Log "Deployment will not be launched as you have passed in an argument specifying that it should not be (START_DEPLOYMENT=${launch_deployment}). Remove it to have your build launch a deployment."
13583
}
136-
13784
Finish-Event "launch-deployment" "deploy-unreal-gdk-example-project-:windows:"
13885

13986
popd

ci/generate-pipeline-steps.sh

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
#!/bin/bash
2+
set -euo pipefail
3+
4+
# Download the unreal-engine.version file from the GDK repo so we can run the example project builds on the same versions the GDK was run against
5+
# This is not the pinnacle of engineering, as we rely on GitHub's web interface to download the file, but it seems like GitHub disallows git archive
6+
# which would be our other option for downloading a single file
7+
GDK_BRANCH_LOCAL="${GDK_BRANCH:-master}"
8+
NUMBER_OF_TRIES=0
9+
while [ $NUMBER_OF_TRIES -lt 5 ]; do
10+
CURL_TIMEOUT=$((10<<NUMBER_OF_TRIES))
11+
NUMBER_OF_TRIES=$((NUMBER_OF_TRIES+1))
12+
echo "Trying to download unreal-engine.version from GitHub's UnrealGDK repository, try: $NUMBER_OF_TRIES, timeout: $CURL_TIMEOUT seconds ..."
13+
curl -L -m $CURL_TIMEOUT https://raw.githubusercontent.com/spatialos/UnrealGDK/$GDK_BRANCH_LOCAL/ci/unreal-engine.version -o ci/unreal-engine.version
14+
if [ $? -eq 0 ]; then
15+
break
16+
fi
17+
done
18+
19+
# This script generates BuildKite steps for each engine version we want to test against.
20+
# We retrieve these engine versions from the unreal-engine.version file in the UnrealGDK repository.
21+
# The steps are based on the template in nightly.template.steps.yaml.
22+
23+
if [ -z "${ENGINE_VERSION}" ]; then
24+
echo "Generating build steps for each engine version listed in unreal-engine.version"
25+
STEP_NUMBER=1
26+
IFS=$'\n'
27+
for commit_hash in $(cat < ci/unreal-engine.version); do
28+
REPLACE_STRING="s|ENGINE_COMMIT_HASH_PLACEHOLDER|$commit_hash|g; s|STEP_NUMBER_PLACEHOLDER|$STEP_NUMBER|g"
29+
sed $REPLACE_STRING ci/nightly.template.steps.yaml | buildkite-agent pipeline upload
30+
STEP_NUMBER=$((STEP_NUMBER+1))
31+
done
32+
# We generate one build step for each engine version, which is one line in the unreal-engine.version file.
33+
# The number of engine versions we are dealing with is therefore the counting variable from the above loop minus one.
34+
STEP_NUMBER=$((STEP_NUMBER-1))
35+
buildkite-agent meta-data set "engine-version-count" "$STEP_NUMBER"
36+
else
37+
echo "Generating steps for the specified engine version: $ENGINE_VERSION"
38+
sed "s|ENGINE_COMMIT_HASH_PLACEHOLDER|$ENGINE_VERSION|g" ci/nightly.template.steps.yaml | buildkite-agent pipeline upload
39+
fi

ci/nightly.template.steps.yaml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
common: &common
2+
agents:
3+
- "agent_count=1"
4+
- "capable_of_building=gdk-for-unreal"
5+
- "environment=production"
6+
- "machine_type=quad"
7+
- "permission_set=builder"
8+
- "platform=windows"
9+
- "scaler_version=2"
10+
- "queue=${CI_WINDOWS_BUILDER_QUEUE:-v4-2019-11-07-bk3700-fbffad576b9676d7}" # Has FASTbuild disabled
11+
timeout_in_minutes: 60 # TODO(ENG-548): reduce timeout once agent-cold-start is optimised.
12+
retry:
13+
automatic:
14+
# This is designed to trap and retry failures because agent lost connection. Agent exits with -1 in this case.
15+
- exit_status: -1
16+
limit: 3
17+
plugins:
18+
- ca-johnson/taskkill#v4.1: ~
19+
20+
steps:
21+
- label: "build-and-deploy-:windows:-ENGINE_COMMIT_HASH_PLACEHOLDER"
22+
command: "powershell -NoProfile -NonInteractive -InputFormat Text -Command ./ci/setup-and-build.ps1"
23+
<<: *common # This folds the YAML named anchor into this step. Overrides, if any, should follow, not precede.
24+
artifact_paths:
25+
- "UnrealEngine/Engine/Programs/AutomationTool/Saved/Logs/*"
26+
env:
27+
ENGINE_COMMIT_HASH: "ENGINE_COMMIT_HASH_PLACEHOLDER"
28+
STEP_NUMBER: "STEP_NUMBER_PLACEHOLDER"

ci/setup-and-build.ps1

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ pushd "$exampleproject_home"
3535
Start-Event "get-gdk-head-commit" "build-unreal-gdk-example-project-:windows:"
3636
pushd $gdk_home
3737
# Get the short commit hash of this gdk build for later use in assembly name
38-
$gdk_commit_hash = (git rev-parse HEAD).Substring(0,7)
38+
$gdk_commit_hash = (git rev-parse HEAD).Substring(0,6)
3939
Write-Log "GDK at commit: $gdk_commit_hash on branch $gdk_branch_name"
4040
popd
4141
Finish-Event "get-gdk-head-commit" "build-unreal-gdk-example-project-:windows:"
@@ -55,7 +55,6 @@ pushd "$exampleproject_home"
5555

5656
Finish-Event "set-up-engine" "build-unreal-gdk-example-project-:windows:"
5757

58-
5958
Start-Event "associate-uproject-with-engine" "build-unreal-gdk-example-project-:windows:"
6059
pushd $engine_directory
6160
$unreal_version_selector_path = "Engine\Binaries\Win64\UnrealVersionSelector.exe"
@@ -104,14 +103,6 @@ pushd "$exampleproject_home"
104103
"-run=GenerateSchemaAndSnapshots", `
105104
"-MapPaths=`"/Maps/FPS-Start_Small`""
106105
)
107-
108-
# TODO (GV-29) this is also being done as part of setup.bat. We should look into calling setup.bat instead of this, but need to make sure it doesn't brake if called after setup-gdk.ps1
109-
$core_gdk_schema_path = "$($gdk_home)\SpatialGDK\Extras\schema\*"
110-
$schema_std_lib_path = "$($gdk_home)\SpatialGDK\Binaries\ThirdParty\Improbable\Programs\schema\*"
111-
New-Item -Path "$($exampleproject_home)\spatial\schema\unreal" -Name "gdk" -ItemType Directory -Force
112-
New-Item -Path "$($exampleproject_home)\spatial" -Name "\build\dependencies\schema\standard_library" -ItemType Directory -Force
113-
Copy-Item "$($core_gdk_schema_path)" -Destination "$($exampleproject_home)\spatial\schema\unreal\gdk" -Force -Recurse
114-
Copy-Item "$($schema_std_lib_path)" -Destination "$($exampleproject_home)\spatial\build\dependencies\schema\standard_library" -Force -Recurse
115106
popd
116107
Finish-Event "generate-schema" "build-unreal-gdk-example-project-:windows:"
117108

0 commit comments

Comments
 (0)